-
-
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
Add support for Web Extension manifest V3 #7050
Conversation
|
While trying to add HMR, I came across this issue, which is probably not a blocker because most people will just I'm moving this out of draft stage because I really don't know how to get HMR working but this MV3 transformer does seem to work properly beyond that, so until we can work something out it's a useful addition. |
packages/transformers/webextension/src/WebExtensionTransformer.js
Outdated
Show resolved
Hide resolved
Finished adding tests, this PR should now be ready for merging. |
packages/transformers/webextension/src/WebExtensionTransformer.js
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
great job @101arrowz ! Thank you so much! Is there a way we can "Buy you a coffe/beer"? And of course the same goes for the reviewer @devongovett :) |
@101arrowz thank you very much! 🚀 |
@101arrowz thank you very much for your work! 🚀 We look forward to the release and start updating extensions 🎉 |
In a few hours, you'll be able to test it out in tonight's nightly release. Please do, and report any issues you find. It'll be officially released in the next minor, which should be in a few days if all goes well. |
Awesome, thanks you so much for reviewing!
Feel free to donate to the Open Collective for Parcel, the maintainers deserve the support more than I do :) |
Also for anyone testing please refer to the docs at parcel-bundler/website#1014 (live at this link). @devongovett The docs should probably be implemented before the next minor release. |
Any tips for a novice on how to grab the nightly? |
|
(Nightly releases are at midnight UTC, so you'll need to wait until then.) |
(And also make sure to install the nightly versions of both |
Hmm, seems nightly release action is failing: https://github.com/parcel-bundler/parcel/runs/5993495011?check_suite_focus=true last successfuly published nightly was 4 days ago 🤔 |
It seems that the manifest validator is too strict and doesn't say why. It immediately fails when the
Also it automatically adds a broken/unnecessary Input manifest{
"name": "Awesome Extension",
"version": "0.0.0",
"description": "An awesome new browser extension",
"homepage_url": "https://github.com/fregante/browser-extension-template",
"manifest_version": 3,
"minimum_chrome_version": "100",
"icons": {
"128": "icon.png"
},
"permissions": [
"storage"
],
"host_permissions": [
"https://github.com/*"
],
"content_scripts": [
{
"matches": [ "https://github.com/fregante/browser-extension-template/*" ],
"js": [ "content.js" ],
"css": [ "content.css" ],
"run_at": "document_end"
}
],
"options_ui": {
"browser_style": true,
"page": "options.html"
},
"background": {
"service_worker": "background.js",
"type": "module"
}
} Output manifest{
"name": "Awesome Extension",
"version": "0.0.0",
"description": "An awesome new browser extension",
"homepage_url": "https://github.com/fregante/browser-extension-template",
"manifest_version": 3,
"minimum_chrome_version": "100",
"icons": { "128": "icon.da91f5eb.png" },
"permissions": ["storage"],
"host_permissions": [
"https://github.com/*"
],
"content_scripts": [
{
"matches": ["https://github.com/fregante/browser-extension-template/*"],
"js": ["manifest.e36317c5.js"],
"css": ["manifest.d108b4c6.css"],
"run_at": "document_end"
}
],
"options_ui": { "browser_style": true, "page": "options.29b7abd3.html" },
"background": {
"service_worker": "background.2784684d.js",
"type": "module"
},
"web_accessible_resources": [
{
"matches": ["https://github.com/fregante/browser-extension-template/*"],
"extension_ids": [],
"resources": []
}
]
} And chrome throws with:
Live test at fregante/browser-extension-template#75 |
Please open new issues for bugs. I just tried a small example and it does say why it failed for browser_specific_settings:
|
I've installed the nighly's but when I build I get the following error:
This used to work and I couldn't find anything in the new docs that I needed to change |
Did you try the suggestion in the error message? |
@rickiesmooth See the comment from @101arrowz:
|
@devongovett in my app code I couldn't find the |
running production on top of parcel nightly release - thug dev life 🤷 |
This was released in v2.5.0 earlier today fyi |
@101arrowz @devongovett found few issues: #7997 |
↪️ Pull Request
Adds support for Manifest V3 to
@parcel/transformer-webextension
.Closes #6079
Fixes #6494
Fixes #7568
Fixes #7385
Fixes #7835 (mostly)
Fixes #7808
Fixes #5865
HMR is not working due to MV3 restrictions on CSP. Refreshing the page does update the extension though.
✔️ PR Todo