-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manifest Version 3 background.Service_Worker is currently disabled #2532
Comments
This isn't a bug, Firefox does not support service workers in MV3 yet. Instead, event pages (even-driven background scripts) are recommended, see: https://extensionworkshop.com/documentation/develop/manifest-v3-migration-guide/ |
I developed an extension for Chrome with the service_worker but FF refuses to even load it. I don't want to use any build tools, this is nonsense. As for me the service_worker is a compositely valid usage scenario when I need to preserve a state. |
@stokito Before you put firefox on blast, I encourage you to understand why MV3 is not supported by firefox. MV3 is poorly designed, removing features from mv2 like persistent background pages and proxy extensions while providing no alternative. This breaks many useful plugins in the ecosystem and sets the precedent of WebExtension becoming an overfitted API instead of one which is permissive and allows for experimenting with new interaction models. Some things to read (seems like writing on this topic is sparse): |
ok, so it's Embrace, extend, and extinguish policy of Google, right? Anyway, maybe few simple "extend" should be made by FF to just support what we have today in Chrome. Looks like the main goal of Google is to kill extensions i.e. ad blockers to keep mass surveillance and manipulation. But adblockers will anyway found a their way. They can invest their time into learning manifest up to v42. |
I 100% agree with what @stokito says, The world of extensions is chaotic. I am stuck trying to figure out simple things and it has been almost more than 2-3 days, all the documentation and stuff are good but still browsers should not do so and establish a common ground. They are as good as the support they provide. |
A lot of misinformation here. Firefox does, in fact, support Manifest v3: https://www.mozilla.org/firefox/109.0/releasenotes/ The issue right now is that support for (disclaimer: I don't work for Mozilla, I just have randomly stumbled upon this issue) |
The simples way for now (at least for me) is just to use "service_worker": "background_script.js" when i publish to chrome and "scripts": ["background_script.js"] if i publish for Firefox. Manifest v3 is a really bad thing behind the scenes tho |
Yeah, changing the manifest while publishing the extension is a good solution at least for now. |
The FF at least can ignore the incorrect |
indeed, but which user wants to keep an extension already showing a warning (at least in german even named "Error"("Fehler") instead of warning) when installing it? ^^ |
I can't find any documentation saying Can someone provide a full example of something that actually works? |
You can see it here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background |
You can now use both when coding and testing locally, thank to YujiSoftware: "background": {
"service_worker": "background.js",
"scripts": ["background.js"]
}, EDIT: remove |
One of my extensions got rejected from Chrome Web Store review when I used this approach, and was only accepted after I removed the "scripts" line. This policy doesn't seem to be applied consistently (another extension was permitted), so I might have been able to appeal. |
Manifest V3 disagreement issue; see: mozilla/web-ext#2532 (comment)
It happened to mine, but I showed them that Chrome does allow that key and they accepted it eventually (I had to submit a new version anyway) The links where: |
In its current state, and presumably since the [Manifest V3 migration](#186), the extension doesn't work on Firefox. However, it can be made fully functional with a small change When loading the extension in Firefox, the following is reported ``` There was an error during the temporary add-on installation. Error details background.service_worker is currently disabled ``` Firefox doesn't currently support `background.service_worker` in Manifest V3: https://bugzilla.mozilla.org/show_bug.cgi?id=1573659. This property was added when migrating to V3: #186 If you remove this section from the manifest, it will work on V3. The only caveat is that the icon won't change when on a GOV.UK page I also tried changing `service_worker` to `scripts` and using an array per [this suggestion](mozilla/web-ext#2532 (comment)), which also makes the extension functional, but doesn't make the icon-changing script work. I suspect the `icon.js` code would need updating for cross-browser support. Other suggestions later in that thread might be worth exploring, but it might make more sense to hold off until Firefox adds proper support if the user base is low
At least not as a service worker, and providing different manifest files for a feature we don't even use sounds not very useful: mozilla/web-ext#2532
In its current state, and presumably since the [Manifest V3 migration](#186), the extension doesn't work on Firefox. However, it can be made fully functional with a small change When loading the extension in Firefox, the following is reported ``` There was an error during the temporary add-on installation. Error details background.service_worker is currently disabled ``` Firefox doesn't currently support `background.service_worker` in Manifest V3: https://bugzilla.mozilla.org/show_bug.cgi?id=1573659. This property was added when migrating to V3: #186 If you remove this section from the manifest, it will work on V3. The only caveat is that the icon won't change when on a GOV.UK page I also tried changing `service_worker` to `scripts` and using an array per [this suggestion](mozilla/web-ext#2532 (comment)), which also makes the extension functional, but doesn't make the icon-changing script work. I suspect the `icon.js` code would need updating for cross-browser support. Other suggestions later in that thread might be worth exploring, but it might make more sense to hold off until Firefox adds proper support if the user base is low
Is this a feature request or a bug?
feature request ( Error: background.service_worker is currently disabled )
What is the current behavior?
In my extension manifest (v3) file, I have the following defined for my background properties:
"background": { "service_worker": "serviceWorker.js" }
I'm using the --firefox-preview flag/I've also tried this on the nightly build and I get the following error (and the extension isn't loaded)
WebExtError: installTemporaryAddon: Error: Error: Could not install add-on at 'C:\Users\sootieRope\source\repos\tb-extension\TubeBuddy.Web\assets\builds\FireFox_Production_LocalDebug': Error: background.service_worker is currently disabled at RemoteFirefox.installTemporaryAddon (file:///C:/Users/sootieRope/AppData/Roaming/npm/node_modules/web-ext/lib/firefox/remote.js:90:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async FirefoxDesktopExtensionRunner.startFirefoxInstance (file:///C:/Users/sootieRope/AppData/Roaming/npm/node_modules/web-ext/lib/extension-runners/firefox-desktop.js:218:27) at async FirefoxDesktopExtensionRunner.run (file:///C:/Users/sootieRope/AppData/Roaming/npm/node_modules/web-ext/lib/extension-runners/firefox-desktop.js:51:5) at async Promise.all (index 0) at async MultiExtensionRunner.run (file:///C:/Users/sootieRope/AppData/Roaming/npm/node_modules/web-ext/lib/extension-runners/index.js:68:5) at async run (file:///C:/Users/sootieRope/AppData/Roaming/npm/node_modules/web-ext/lib/cmd/run.js:178:3) at async Program.execute (file:///C:/Users/sootieRope/AppData/Roaming/npm/node_modules/web-ext/lib/program.js:263:7) at async file:///C:/Users/sootieRope/AppData/Roaming/npm/node_modules/web-ext/bin/web-ext.js:13:1
What is the expected or desired behavior?
serviceworker support, I've tried using the scripts: [] property and it doesn't seem to load either.
Version information (for bug reports)
The text was updated successfully, but these errors were encountered: