Closed Bug 1342708 Opened 7 years ago Closed 7 years ago

webextension browser frames missing autocompletepopup (datalist, etc)


(WebExtensions :: Frontend, defect, P2)



(firefox54 wontfix, firefox55 fixed)

Tracking Status
firefox54 --- wontfix
firefox55 --- fixed
webextensions +


(Reporter: callahad, Assigned: mixedpuppy)


(Blocks 2 open bugs)


(Keywords: DevAdvocacy, Whiteboard: [parity-chrome], triaged)


(2 files)

In browser_action popups, input elements with associated datalists do not provide automatic completion. See screenshot.


1. Clone and check out revision 6031ac56f7a462f3a35fe412e49e45dcfa88b329 of
2. Load it as a temporary / unpacked add-on
3. Click the add-on's icon and type "en"

What should happen:

- Completions of "en", "en-au", "en-ca", etc. should appear

What actually happens:

- No completions are shown

The exact same code, run in web content, works as expected:
Priority: -- → P2
Whiteboard: [parity-chrome] → [parity-chrome], triaged
I looked into this, to see if it might be similar to bug 1269421, just a matter of wiring the right attribute on the browser ("autocompletepopup" I believe), but that doesn't seem enough.

This might be either a platform limitation (nested popups), or some other part of wiring missing on our end, but I'm not familiar enough to know where to look next. Still, I'd be happy to if someone can point me in a direction.
webextensions: --- → ?
Assignee: nobody → mixedpuppy
webextensions: ? → +
This should be fixed by setting the context attribute on the browser to contentAreaContextMenu.

We may also have to make sure content.js is loaded.
BTW, we had this issue in socialapi, bug 805227, which was fixed in bug 782850, the basics of which is setting the context attribute.
eh, I was wrong.  context does fix of course the context menu, which fixes using other things (spell check), but not the datalist which as zombie pointed out is autocompletepopup.
AutoCompletePopup.jsm purposely ignores any non-tabbrowser browser.

Removing that code makes this work in the sidebar, however it still is not working in popups (e.g. browserAction).  This also requires loading the content.js frame script, which is happening for the popups in bug 1299371.  content.js initializes AutoCompletePopup.jsm.
Depends on: 1299371
Comment on attachment 8853579 [details]
Bug 1342708 fix datalist failure in webext popups,

The changes in browser-content.js are necessary only for browserAction and seem necessary due to the preload mechanism.  formfill is connected during preload, but then disconnected prior to popup opening.  We do not receive DOMContentLoaded during the browserAction popup opening.
Attachment #8853579 - Attachment description: Bug 1342708 WIP exploring datalist failure in webext popups → Bug 1342708 fix autocompletepopup in sidebar and browseraction
Attachment #8853579 - Flags: feedback?(kmaglione+bmo)
Comment on attachment 8853579 [details]
Bug 1342708 fix datalist failure in webext popups,

::: toolkit/components/satchel/AutoCompletePopup.jsm:149
(Diff revision 2)
>        return;
>      }
>      let window = browser.ownerGlobal;
> -    let tabbrowser = window.gBrowser;
> -    if (Services.focus.activeWindow != window ||
> +    // Also check parent in case this is a sidebar.
> +    if (![window, window.parent].includes(Services.focus.activeWindow)) {

Just check ``.

::: toolkit/content/browser-content.js:1459
(Diff revision 2)
>      "FormAutoComplete:RequestFocus",
>    ],
>    init() {
>      addEventListener("unload", this);
> +    if (!content.document.readyState == "complete") {

`readyState != "complete"`. `false` will never equal "complete".
Attachment #8853579 - Flags: feedback?(kmaglione+bmo) → feedback+
Summary: Datalist completions do not display in WebExtension popups → webextension browser frames missing autocompletepopup (datalist, etc)
Depends on: 1353060
Comment on attachment 8853579 [details]
Bug 1342708 fix datalist failure in webext popups,
Attachment #8853579 - Flags: review?(kmaglione+bmo) → review+
Pushed by
fix datalist failure in webext popups, r=kmag
Blocks: 1369559
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
54 RC build is released. Mark 54 won't fix.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.