Closed
Bug 1483600
Opened 6 years ago
Closed 6 years ago
Raptor webext content script is not injected into geckoview example app page after updating URL
Categories
(GeckoView :: General, defect, P1)
GeckoView
General
Tracking
(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)
RESOLVED
FIXED
mozilla63
People
(Reporter: rwood, Assigned: mbrubeck)
References
(Blocks 1 open bug)
Details
Attachments
(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.
[1] https://searchfox.org/mozilla-central/source/testing/raptor/webext/raptor/
Matt can you take a look at this one too?
Flags: needinfo?(mbrubeck)
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
Flags: needinfo?(mbrubeck)
Assignee | ||
Updated•6 years ago
|
Blocks: webext-geckoview
Updated•6 years ago
|
status-firefox61:
--- → wontfix
status-firefox62:
--- → wontfix
status-firefox63:
--- → affected
status-firefox-esr52:
--- → wontfix
status-firefox-esr60:
--- → wontfix
Priority: -- → P1
Assignee | ||
Comment 2•6 years ago
|
||
`ExtensionProcessScript.loadContentScript` is called as expected, but it does not inject the content script because `DocumentManager.globals.has(window.docShell.messageManager)` returns false here:
https://dxr.mozilla.org/mozilla-central/rev/4e56a2f51ad739ca52046723448f3129a58f1666/toolkit/components/extensions/extension-process-script.js#510
Assignee | ||
Comment 3•6 years ago
|
||
This happens because `DocumentManager.initGlobal` isn't called because GeckoView doesn't dispatch the "tab-content-frameloader-created" notification during content process initialization.
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
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+
Reporter | ||
Comment 7•6 years ago
|
||
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 mbrubeck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cc1ffa88e12c
Notify "tab-content-frameloader-created" in GeckoView content script. r=jchen
Comment 9•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Updated•6 years ago
|
Product: Firefox for Android → GeckoView
Updated•6 years ago
|
Target Milestone: Firefox 63 → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•