Skip to content
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 v3 #55

Closed
tomcollis opened this issue Oct 2, 2021 · 15 comments · Fixed by #75
Closed

Manifest v3 #55

tomcollis opened this issue Oct 2, 2021 · 15 comments · Fixed by #75

Comments

@tomcollis
Copy link

I've just started experimenting with browser extensions and came across this from OctoPrint - Open in Bundle Viewer which was based on your template.

Do you have plans to update this template or rather recreate this template for version 3 of the manifest.json?

Chrome Developers - Intro to Manifest v3

@fregante
Copy link
Owner

fregante commented Oct 2, 2021

Thanks for opening the issue!

The issue is that Parcel does not support the Manifest v3 yet so the only way to use v3 is to use webpack (or to avoid the WebExtension transformer, which would change the template substantially). This is tracked in parcel-bundler/parcel#6079 and there's nothing that can be done in this repo unfortunately.

You have until early 2022 to publish your v2 extension and then Parcel hopefully will update the transformer to support v3 before the "end of life for v2" in 2023.

If it's urgent, your only choice is to use a previous, webpack-based version. This is the last one before moving to Parcel: https://github.com/fregante/browser-extension-template/tree/a0f9cbe27c854e98d52033783a9e951246217dab

👆 but it's not advised at this point.

@fregante
Copy link
Owner

fregante commented Oct 2, 2021

Please leave a 👍 on parcel-bundler/parcel#6079 if you're interested

@tomcollis
Copy link
Author

Thank you, I have liked the issue you suggested.

@fregante
Copy link
Owner

I'll keep this open until I update Parcel here if you don't mind.

@fregante fregante reopened this Oct 11, 2021
@Andonvr
Copy link

Andonvr commented Feb 7, 2022

This is still a problem, and apparently the Chrome Web Store has stopped accepting new Manifest V2 extensions. Does this mean we cannot publish extensions that have been written with this template?
image

@fregante
Copy link
Owner

fregante commented Feb 7, 2022

Unfortunately correct. There has been a PR on parcel's repo open for a while to add support

@phgn0
Copy link

phgn0 commented Mar 8, 2022

FYI for anyone looking for a hacky immediate workaround, you can manually patch the @parcel/transformer-webextension module via https://github.com/ds300/patch-package to recognize the new schema. It worked for me in lindylearn/unclutter@3bc830e.

@aspiers
Copy link

aspiers commented Apr 10, 2022

I see from this comment 3 days ago that apparently all the work is done, and it's just awaiting final review. Does this mean that until it's merged we can in theory just specify a dependency on the GitHub PR branch?

@aspiers
Copy link

aspiers commented Apr 10, 2022

Hrm, maybe not, since @parcel/transformer-webextension is a separate package in a workspace subdirectory, and I can't see any obvious way to specify a dependency on a subdirectory of a GitHub branch. I notice that this StackOverflow question seems to ask how to do that, and didn't get any answers in 9 months, so maybe it's just not possible and ds300/patch-package is the best way.

@fregante
Copy link
Owner

Monorepos are a mess of tangled dependencies so I'd advise against trying to load that separately 😳

Hopefully they're only a few days away from merging…

@aspiers
Copy link

aspiers commented Apr 11, 2022

OK thanks for the advice! Yes hopefully indeed, since I'm working on an extension which I'd love to have published in the Chrome Web Store before a conference coming up soon...

@fregante
Copy link
Owner

The PR has been merged. Try running this in a few hours:

npm install -D parcel@nightly @parcel/config-webextension@nightly

@fregante
Copy link
Owner

fregante commented Apr 14, 2022

You can see the progress in the PR #75

However unfortunately it doesn't work due to:

@aspiers
Copy link

aspiers commented Apr 25, 2022

What is left to do on this?

@fregante
Copy link
Owner

fregante commented Apr 26, 2022

Thanks for the ping! I updated parcel, tested it and it works as expected!

Note

This change effectively drops support for Firefox until they support Manifest v3: https://bugzilla.mozilla.org/show_bug.cgi?id=1578284

To enable support manually:

  1. Run npm run build
  2. In the distribution/manifest.json file, revert the same changes you see in #75:
    • set manifest_version to 2
    • move host_permissions items back to permissions
    • restore the previous background key
  3. Save that version just for Firefox

Repository owner locked and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants