Open Bug 1688314 Opened 4 years ago Updated 3 months ago

Flutter layouting logic forces the WebExtensions browserAction popup width to 0px

Categories

(Toolkit :: Add-ons Manager, defect, P3)

Firefox 84
defect

Tracking

()

Tracking Status
firefox84 --- affected
firefox85 --- affected
firefox86 --- affected

People

(Reporter: loic.houdebine, Unassigned)

Details

Attachments

(6 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

I create a simple Add-On using a flutter web app.
This extension show a webpage in a popup.
An issue has been open in Flutter github : https://github.com/flutter/flutter/issues/47131
But the issue seems to be on Firefox side as the extension is working fine in Chrome.

Actual results:

The page is blank and no error in the debug console.

Expected results:

The popup should contain the web app

Hello,

I’ve managed to reproduce the issue on the latest Nightly (86.0a1/20210124215058), Beta (85.0/20210118153634) and Release (84.0.2/20210105180113) under Windows 10 x64 and Ubuntu 16.04 LTS, using the extension mentioned in https://github.com/flutter/flutter/issues/47131.

On all tested versions, clicking the add-on icon will produce an error in the add-on console, aside from the main problem, the blank pop-up. For further details, see screenshot01.

On Nightly though, clicking the add-on icon will generate some errors in the browser console as well, which do not appear in Release or Beta. See screenshot02.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image screenshot01.png
Attached image screenshot02.png

Hello,
Thank you for the answer.
For the issue on the first screen, I think this is only a warning and that's not the reason the pop-up is blank (the same warning is in Chrome but the extension still work).
To be sure I have created the same extension and manage to remove the warning on your first screenshot if you want to try :
https://github.com/zackattack73/flutter_firefox_extension

The pop-up is still blank and no error / warning in the console.

I did try on Nightly and the only thing I see in the console is this warning :
Use of nsIFile in content process is deprecated.

Luca will look at it.

Flags: needinfo?(lgreco)

Hello,

Thank you for the new add-on version @ loic.houdebine !

Re-tested on the latest Nightly (87.0a1/20210125172739), Beta (86.0b1/20210125185644) and Release (85.0/20210118153634) under Windows 10 x64.
Can confirm that with the new add-on you provided, no errors are displayed in the add-on console.

However, spam clicking the add-on icon does log several errors in the browser console. I’ll post the screenshots here in case they are relevant. Note that these screenshots have been taken on the latest Release 85.0.

Attached image 2021-01-26_11h33_21.png
Attached image 2021-01-26_11h33_42.png
Attached image 2021-01-26_11h34_12.png
Attached image 2021-01-26_11h34_35.png

Hello,
Thank you for your answer.
I wasn't able to get the same errors while spam clicking the add-on icon but I'm also new in Add-On development so maybe I did something wrong.

I have never seen these issues before and I wasn't able to find interesting information online.
If someone can provide any help that would be great !

I finally got some time to look into this and it seems that the flutter's layouting logic is forcing Firefox to resize the popup to 0px width.

I don't know flutter internal enough to quickly determine which part of flutter may be triggering that, but as a confirmation that is actually the case I tweaked the minimal test extension linked in comment 4 with the following few changes:

  • created a new "popup.html" resource packages in the same extension, this html document includes:
    • an iframe with a src set to "index.html" (which is the flutter demo app that is meant to be rendered in the popup)
    • a style tag with some CSS rules that ensure that the iframe will occupy all the space available in the popup.html document (to make the content of the frame to look like it is actually part of the top level container page)
  • in manifest.json, changed the browser_action's default_popup to be set to "popup.html" instead of "index.html"

And that did render the flutter demo app as expected (and the demo app does also work as expected).
While running into the iframe, it does not matter if flutter's layouting logic is setting the width to 0px, that would only have effect on the iframe and so the browserAction popup will still use the default browserAction popup size, and so the bug isn't triggered.

If I try to load that "index.html" into a tab, then the flutter demo app is rendered as expected without any change, that confirms that the bug is triggered for the browserAction popup because Firefox is reactive to flutter setting width to 0px on the browserAction popup window (on the contrary Firefox wouldn't to anything if the same is done when the exact same extension page is loaded in a tab).

Flags: needinfo?(lgreco)
Summary: Add-on popup show blank page without error (Flutter) → Flutter layouting logic forces the WebExtensions browserAction popup width to 0px

Setting priority to P3 and severity to S4 based on the analysis described in comment 12 (and workaround that can be used on the extension side to avoid the issue in the meantime, also described in the same comment).

Severity: -- → S4
Priority: -- → P3

Thank you so much for taking a look at the issue and thank you for the workaround !
If you have some time to share your "index.html" file (for example with a pull request on the test extension) it would be great.

Thanks again

(In reply to loic.houdebine from comment #14)

Thank you so much for taking a look at the issue and thank you for the workaround !
If you have some time to share your "index.html" file (for example with a pull request on the test extension) it would be great.

Sure, no problem at all, I still had the diff of the changes I described in comment 12 on my dev machine and so I just pasted the diff into an issue on the https://github.com/zackattack73/flutter_firefox_extension repository.

The Bugbug bot thinks this bug should belong to the 'Toolkit::Add-ons Manager' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Add-ons Manager
Product: WebExtensions → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: