-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Background scripts for Firefox result in build error when using Manifest V3 #8785
Comments
I am interested, so I would like to work on this. |
I think the change is similar to #8867, with the exception that the key here also points to a file that needs to be bundled (but that code should already be there) |
From PR #9068:
...but using version
Was this functionality actually not merged in PR #9068 ? Currently it seems it is not possible to use parcel to set up a usable cross-browser extension, because it doesn't support the |
Adding the Error details text to this issue so it's searchable:
|
I came up with a temporary solution in
This works for my case where:
|
Yes this will allow you to run the build for a Firefox extension with parcel, but not being able to have any type of background script/worker is a show stopper for me. I'd like to be able to use parcel for a cross-browser extension but if this cannot be fixed, then back to webpack :( Hopefully Firefox will speed up their promised support for |
This issue was about supporting I opened a separate issue in order to allow both keys in the manifest:
What for? Parcel does not require background scripts to be set. If you don't need it, remove the |
@fregante Thanks for clearing that up and creating the new issue. I had missed that I can currently use parcel to build both if I start with a separate So, for Firefox
And for Chrome
Then in
|
🐛 bug report
Firefox requires background scripts to be included in the manifest.json using 'background.scripts' instead of 'background.service_worker':
Including the above 'scripts' object in the manifest file results in 'Invalid Web Extension manifest' build failure.
🎛 Configuration (.babelrc, package.json, cli command)
Error encountered when running command: 'npm run build'
🤔 Expected Behavior
Parcel does not require Chrome specific manifest v3 parameters, including 'background.service_worker'
😯 Current Behavior
Parcel supports Chrome manifest v3 extensions, but does not seem to support Firefox's version of manifest v3.
Parcel build fails when background.service_worker is excluded from manifest.json in favor of Firefox's preferred background.scripts
💁 Possible Solution
A couple solutions come to mind:
-- Included as a nice-to-have: without support for named manifest files changes to the manifest will be required each time the extension is built for Firefox
🔦 Context
I have created a new browser extension using Parcel and manifest V3. I primarily used Chrome documentation when building the extension. When attempting to test and build the extension for use on Firefox, I noticed this issue with Parcel's support for manifest v3 using Firefox.
Firefox added support for manifest v3 on January 17, 2023 in Firefox 109.
Prevents Parcel from being used for Firefox extensions when creating a Manifest v3 extension using background scripts.
Relevant Mozilla developer docs.
💻 Code Sample
See other samples in this S/O post.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: