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


(WebExtensions :: General, defect, P2)



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

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


(Reporter: robwu, Assigned: robwu)




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


(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 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

We currently don't support service_worker (bug 1573659). And as I explained in, 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 ( 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 . That requires
a different fix and is therefore saved for a follow-up.

Pushed by
Ignore service_worker property when off by pref r=rpl
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.