Closed Bug 1954637 Opened 4 months ago Closed 4 months ago

Extension with empty background.scripts fails to load in Firefox 136

Categories

(WebExtensions :: General, defect, P1)

defect

Tracking

(firefox-esr128 unaffected, firefox136 wontfix, firefox137 wontfix, firefox138 fixed)

RESOLVED FIXED
138 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox136 --- wontfix
firefox137 --- wontfix
firefox138 --- fixed

People

(Reporter: robwu, Assigned: carlos-mozilla)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

bug 1930334 introduced stricter validation for background.scripts

https://searchfox.org/mozilla-central/rev/f07a6b1e84a609fbf9746f67be9edd43b3ed3362/toolkit/components/extensions/Schemas.sys.mjs#299

Now, when a manifest.json file contains "background" with an empty scripts array, it fails to load with the following error message:
background requires at least one of "scripts" or "page".

There are a few extensions in the wild that do specify an empty scripts.
Here is one user report: https://old.reddit.com/r/firefox/comments/1jd56z5/addon_spontaneously_saying_its_corrupt/

Since this change was not required and is breaking extensions in the wild, let's revert the change.

I have also filed a report with the extension author at https://github.com/Namesnipes/Growth-Tracker/issues/20

When I quickly counted, I counted 87 public extensions on AMO, one of which has 32k+ users. Most have fewer than 100 users.

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

:carlos, since you are the author of the regressor, bug 1930334, could you take a look?

For more information, please visit BugBot documentation.

Assignee: nobody → carlos
Status: NEW → ASSIGNED
Attachment #9472681 - Flags: approval-mozilla-beta?

It seems a bit counter-intuitive a background without any of (background.scripts, background.page, background.service_worker) throws, while an empty background.scripts does not. Are there clear criteria for a warning vs an error specified somewhere?

In any case, https://phabricator.services.mozilla.com/D241970 reverses the regression and adds a warning on an empty background.scripts property. Additional test coverage has been added.

Once serviceWorkers are fully implemented/enabled, should the browser prefer background.service_worker over an empty background.scripts?

Flags: needinfo?(carlos)

wontfix for 136 at this point, because the impact isn't clear, but please tell if you think otherwise.

Attachment #9472681 - Flags: approval-mozilla-beta? → approval-mozilla-beta-

The patch hasn't landed on mozilla-central and there is no uplift form, so guessing that the beta uplift request was an error.

Severity: -- → S2
Priority: -- → P1
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/1b6dc1d4a15a allow loading webExt with empty background.scripts r=robwu
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: