Closed Bug 1860304 Opened 6 months ago Closed 5 months ago

Background page fails to load if background.service_worker and background.scripts are both present

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(firefox-esr115 wontfix, firefox118 wontfix, firefox119 wontfix, firefox120 wontfix, firefox121 fixed)

RESOLVED FIXED
121 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox118 --- wontfix
firefox119 --- wontfix
firefox120 --- wontfix
firefox121 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Regression)

Details

(Keywords: dev-doc-complete, regression, Whiteboard: [wecg][addons-jira])

Attachments

(1 file)

When manifest.json's background declaration contains both service_worker and an event page, the extension loads but the background page fails to start up.

The expected cross-browser behavior (as established in https://github.com/w3c/webextensions/issues/282) is to ignore scripts if service_worker is supported, but to use scripts otherwise (WECG proposal / implemented by Safari). Chrome currently fails to load the extension, but will reduce it to a non-fatal warning in crbug.com/1418934.

We currently don't support service_worker (bug 1573659). And as I explained in https://bugzilla.mozilla.org/show_bug.cgi?id=1775618#c1, there is already a bug that prevents the Service worker from loading if scripts and service_worker are both present. Fixing that was not a high priority because we haven't turned on support for service workers.

Today, I saw a report (https://github.com/w3c/webextensions/issues/282#issuecomment-1773034430) that stated that the background page fails to load if both are present. Upon investigation, it turns out that this is caused by a combination of bugs:

Set release status flags based on info from the regressing bug 1609920

Thanks for opening this! As far as I know having an unrecognised property under background would not prevent the background page/scripts to load. Unless it's the service_worker. Is it known when an extension with both scripts and service_worker started becoming unsupported?

Severity: -- → S4
Priority: -- → P2

Set release status flags based on info from the regressing bug 1609920

When a background page and service_worker are specified simultaneously,
load the background page instead of neither (i.e. the bug).

This patch only fixes the issue when
extensions.backgroundServiceWorker.enabled is false; When true, the
service worker is expected to load but doesn't due to
https://bugzilla.mozilla.org/show_bug.cgi?id=1775618#c1 . That requires
a different fix and is therefore saved for a follow-up.

Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/bf96c386d8c7
Ignore service_worker property when off by pref r=rpl
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch

Needs MDN release note entry.

Keywords: dev-doc-needed

The patch landed in nightly and beta is affected.
:robwu, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox120 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(rob)
Flags: needinfo?(rob)

Release note available for review in "Background page load fail bug fix release note" #30097

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: