Closed Bug 1483600 Opened 5 years ago Closed 5 years ago

Raptor webext content script is not injected into geckoview example app page after updating URL


(GeckoView :: General, defect, P1)



(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- fixed


(Reporter: rwood, Assigned: mbrubeck)


(Blocks 1 open bug)



(1 file)

When using a webext in geckoview (example app), the background scripts defined in the extension manifest are injected into the page, however it looks like content_scripts defined in the manifest are not loading after browsing to a URL.

The geckoview_example app starts up (I have it start with about:blank instead of the default, using the 'url' cmd line option when launching the activity). Then I use browser.tabs.update and change the URL to the speedometer benchmark URL. The URL changes and the benchmark starts running, however the 'benchmark_relay.js' webext content script [1] is not injected into the benchmark page (which causes the benchmark results to never be received by raptor). The page name is in the 'matches' list in the 'content_scripts' webext section. Tried setting it to '<all_urls>' anyway but still it wouldn't load.

On Firefox Desktop raptor creates a new tab first (about:blank) and then uses browser.tabs.update to change to the benchmark URL. I'm wondering if maybe in geckoview since there's no new tab created, maybe browsing to the URL via tabs.update is for some reason causing the extension content_scripts not to be injected - but totally just guessing.

Matt can you take a look at this one too?
Flags: needinfo?(mbrubeck)
Assignee: nobody → mbrubeck
Flags: needinfo?(mbrubeck)
`ExtensionProcessScript.loadContentScript` is called as expected, but it does not inject the content script because `DocumentManager.globals.has(window.docShell.messageManager)` returns false here:
This happens because `DocumentManager.initGlobal` isn't called because GeckoView doesn't dispatch the "tab-content-frameloader-created" notification during content process initialization.
Comment on attachment 9001750 [details]
Bug 1483600 - Notify "tab-content-frameloader-created" in GeckoView content script. r=jchen

Jim Chen [:jchen] [:darchons] has approved the revision.
Attachment #9001750 - Flags: review+
With the geckoview_example app from your try push (comment 5) I verified that the raptor extension content script (benchmark-relay.js) is now injected into the speedometer page (and the benchmark results are now received successfully). AWESOME, thank you! :)
Pushed by
Notify "tab-content-frameloader-created" in GeckoView content script. r=jchen
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 63 → mozilla63
You need to log in before you can comment on or make changes to this bug.