browser.runtime.onStartup doesn't work
Categories
(WebExtensions :: Untriaged, defect, P1)
Tracking
(firefox106 wontfix, firefox107 verified, firefox108 verified)
People
(Reporter: eight04, Assigned: rpl)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(6 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Steps to reproduce:
- Download extensions -
tabalanche-1.1.0.zip
andtabalanche-no-pouchdb-1.1.0.zip
in the attachment - Turn off signature verification (about:config -> change xpinstall.signatures.required to false)
- Install extensions (Ctrl-Shift-A -> Top-right gear icon -> Install addon from files)
- Open
about:debugging#/runtime/this-firefox
- Wait until all background scripts are stopped. https://i.imgur.com/B02QYcl.png
- Restart the browser.
Actual results:
The extension opens a new tab http://example.com/no-pouchdb
Expected results:
We should get two tabs. The one with pouchdb should also open a new tab http://example.com
at startup.
Comment 2•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•2 years ago
|
||
Hello,
I reproduced the issue on the latest Nightly (108.0a1/20221023100414) under Windows 10 x64 and Ubuntu 16.04 LTS.
I’ve also reproduced the issue on Beta Developer Edition (107.0b4/20221023190001) and an unbranded Beta (106.0b9/20221006191955) which should substitute a Firefox Release build. These builds were used as on normal Beta and Release I cannot turn off signature verification.
As per the original description, upon browser restart, only one tab is opened, with http://example.com/no-pouchdb. A second new tab with http://example.com is not opened at startup.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
Assignee | ||
Comment 6•2 years ago
|
||
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/894694e2e7d5 Fix issue related to runtime.onStartup persistent listeners wrongly cleared on idle timeout. r=mixedpuppy
Comment 8•2 years ago
|
||
bugherder |
Comment 9•2 years ago
|
||
Hello,
Verified as Fixed on the latest Nightly (108.0a1/20221026224258) under Windows 10 x64 and Ubuntu 16.04 LTS.
Following the STR in Comment 0, upon browser restart, two tabs are now opened, one with http://example.com/no-pouchdb
and one with http://example.com/
, confirming the fix.
See the attached screenshot for more details.
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
The patch landed in nightly and beta is affected.
:rpl, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox107
towontfix
.
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 12•2 years ago
|
||
Comment on attachment 9299987 [details]
Bug 1796586 - Fix issue related to runtime.onStartup persistent listeners wrongly cleared on idle timeout. r?mixedpuppy!
Beta/Release Uplift Approval Request
- User impact if declined: Extensions using an event page (background script with persistent false set in the manifest) that are subscribing a runtime.onStartup listener will not be automatically started on the next browser startup (unless they have also subscribed some other WebExtensions API events and that events gets triggered)
As side notes related to Android builds (set to yes below):
- The event pages support is technically enabled for MV2 extensions also on Android builds
- Firefox for Android only support a subset of the recommended extensions and so it may be affected but only if any of the extensions currently available in Firefox for Android are matching the conditions that would be triggering the issue (MV2 extensions with background.persistent set to false in the manifest and background page registering runtime.onStartup event listener).
- The patch landed is expected to fix the issue also on Android builds, if any of the extensions available on Firefox for Android is actually able to trigger the issue.
- QA verify the issue on Firefox for Android would be possible, but way less straightforward than verify it on Desktop builds (and it wouldn't technically provide much more, verify it on Desktop builds should be enough to ensure that the same conditions would also be matched on Android because that part of the WebExtensions internals is defined at toolkit level and it is shared by both Desktop and GeckoView builds).
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: Same STR used to verify the fix on Nightly
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): The fix is small and restricted to the special runtime.onStartup event, only the MV2 extensions using an event page and the runtime.onStartup would be affected by the change, MV2 extensions with a persistent background page (which should be the majority of the MV2 extensions currently available on AMO) the issue nor the fix should make any difference.
The patch with the fix also include an additional test to cover the specific issue and its expected behavior with the fix.
- String changes made/needed:
- Is Android affected?: Yes
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Comment on attachment 9299987 [details]
Bug 1796586 - Fix issue related to runtime.onStartup persistent listeners wrongly cleared on idle timeout. r?mixedpuppy!
Approved for Desktop 107.0b7 and Fenix/Focus 107.0b5
Comment 14•2 years ago
|
||
bugherder uplift |
Updated•2 years ago
|
Comment 15•2 years ago
|
||
Hello,
Verified as Fixed on the latest Beta Developer Edition (107.0b7/20221029133721) [Used Beta Developer Edition due to the requirement to turn off signature verification]. Tested on Windows 10 x64 and Ubuntu 16.04 LTS.
As per the STR in Comment 0, upon browser restart, two tabs are now opened, one with http://example.com/no-pouchdb and one with http://example.com/, confirming the fix.
See the attached screenshot for more details.
Comment 16•2 years ago
|
||
Reporter | ||
Comment 17•2 years ago
|
||
I can confirm that it is fixed when I try to restart the browser manually i.e.
- Close and open the browser again.
- Ctrl-Shit-J -> Ctrl-Alt-R
However, it seems that it still doesn't work if the restart is triggered by browser update.
Assignee | ||
Comment 18•1 year ago
|
||
(In reply to eight04 from comment #17)
I can confirm that it is fixed when I try to restart the browser manually i.e.
- Close and open the browser again.
- Ctrl-Shit-J -> Ctrl-Alt-R
However, it seems that it still doesn't work if the restart is triggered by browser update.
I'm sorry eight04, I missed to notice your last comment until now.
If a similar issue is still consistently reproducible on browser updates, it may be worth filing a new bug, the underlying issue would be likely different
(on browser updates the persistent listeners are expected to be all cleared as part of the extensions startupCache being invalidated, and the background page to be started up as a side effect of no persistent listeners being available, see here in ext-backgroundPage.js).
Hi Alex, would you mind to confirm if you can still trigger the issue on browser updates?
Comment 19•1 year ago
|
||
Tested the browser update scenario by installing the required add-ons on Nightly 108 and then updating to the latest Nightly 109.
On my end, both the tabs with http://example.com/no-pouchdb
and the one with http://example.com/
were opened after the browser restarted post-update.
See the attached video for more details.
Comment 20•1 year ago
|
||
Reporter | ||
Comment 21•1 year ago
|
||
Sorry, I forgot to update the comment. It is a different bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1741865#c60
Description
•