"Dark Background and Light Text" add-on stops working
Categories
(WebExtensions :: General, defect)
Tracking
(firefox-esr115 unaffected, firefox126 unaffected, firefox127 unaffected, firefox128 fixed)
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox126 | --- | unaffected |
firefox127 | --- | unaffected |
firefox128 | --- | fixed |
People
(Reporter: alice0775, Assigned: robwu)
References
(Regression)
Details
(Keywords: nightly-community, regression, Whiteboard: [addons-jira])
Attachments
(1 file)
Steps to reproduce:
- Install "Dark Background and Light Text" add-on ( https://addons.mozilla.org/en-US/firefox/addon/dark-background-light-text/ )
- Open any web site such as https://ftp.mozilla.org/pub/firefox/nightly/
Actual results:
"Dark Background and Light Text" add-on does not work.
Background color of the web page is white
The following error is shown in Browser Console:
Uncaught (in promise) Error: Type error for parameter contentScriptOptions (Unexpected property "matchOriginAsFallback") for contentScripts.register.
f moz-extension://66a005e5-6702-42f9-b8df-19f7fafcfc5e/background.js:1
background.js:1:8683
Expected results:
Background color of the web page is dark color
Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=40766d50ef1f07d0598cba24fb616f62edc438ac&tochange=d062a9fa5bb6dbbf536b4f11890b5dc61bd191c9
Suspect: Bug 1853411 or Bug 1475831
![]() |
Reporter | |
Updated•1 year ago
|
Comment 1•1 year ago
|
||
hey Rob, would you mind to look into this regression which seems to be originating from Bug 1475831 changes?
Comment 2•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Toolkit::Add-ons Manager' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Assignee | ||
Comment 3•1 year ago
|
||
This extension does something special - undocumented but understandable.
It reads the content_scripts declaration from manifest.json, with browser.runtime.getManifest().content_scripts
. Then it transforms all properties, renaming snake_case to camelCase, which happens to be the convention used in the contentScripts.register API.
In bug 1475831 I added a new key to the content script API, match_origin_as_fallback, and added support for the same in the scripting API in bug 1853411. The contentScripts.register (and MV2 userScripts.register, and tabs.executeScript) APIs did not get this new API because these APIs are MV3-only and the scripting API is the recommended alternative.
We could fix the issue by also introducing support for matchOriginAsFallback in the contentScripts.register API (and others for consistency).
An alternative is to mark the property as "optional": "omit-key-if-missing"
. Then the key won't show up in the return value of runtime.getManifest()
.
Assignee | ||
Comment 5•1 year ago
|
||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 7•11 months ago
|
||
bugherder |
Description
•