Simon-Tesla / RaccoonyWebEx

A WebExtension that adds shiny features to art sites
MIT License
42 stars 4 forks source link

Chrome Manifest v3 support (Jan 2024 sunset) #134

Open Eupeptic1 opened 2 years ago

Eupeptic1 commented 2 years ago

Description

Google will eventually require extensions to support "Manifest V3", in order for that extension to appear in their Web Store and work in Chrome.

Chrome currently warns about this when you install Raccoony, but Raccoony still works.

Steps to reproduce

  1. Use a recent version of Chrome. I know 102.0.5005.61 exhibits this behavior. Based on Google's stated timeline, 97.0 and newer probably exhibit this behavior.
  2. Uninstall Raccoony from Chrome, if installed.
  3. Go to the Chrome Web Store, search for Raccoony, and install it into Chrome. Currently this will install Raccoony 1.2.5.
  4. Open Chrome's "extensions" page
  5. Observe an "error" button on Raccoony's entry.
  6. Click the "error" button to get a message that Raccoony uses Manifest V2, which is deprecated.

Expected behavior

No "error" button or message about deprecation on Chrome's "extensions" page.

Eupeptic1 commented 2 years ago

Analysis

The message in Chrome directs you to https://developer.chrome.com/blog/mv2-transition/ . Further information is available at https://blog.chromium.org/2020/12/manifest-v3-now-available-on-m88-beta.html and https://developer.chrome.com/docs/extensions/mv3/mv2-sunset/ .

Basically, Raccoony can be updated as-is on the Web Store until January 2023, and Chrome will still run it until then. After that, Google won't accept updates for it anymore, and Chrome won't run it anymore.

The two big take-aways I have from reading the above links are

  1. V3 will disallow remote content in WebExtensions.
  2. V3 will give the user more granular control over permissions of WebExtensions.

I don't think 1 is a very big deal for us. Raccoony has several external dependencies, but I think that the build process involves downloading those from a Node.js repository, and then copying the needed pieces of those dependencies into one (or a few) big Javascript files that the browser ends up loading. (Kind of the same idea as a statically-linked native executable on Linux.) The browser doesn't have to go out to external sites and download code when Raccoony is running.

2 is probably not a big deal, unless the default permissions are more restrictive than what Raccoony requires in order to operate. There may be a way for Raccoony to ask for non-default permissions at install time. If not, we may have to tell the users "turn permissions X and Y on at install time, or Raccoony won't work".

I hope that it's as simple as asking Node.js to target Manifest V3 when building. (Edge either supports Manifest V3 now, or will have to soon, so one would hope that MSFT makes their own dev tools work with their own browser.)

Simon-Tesla commented 2 years ago

This looks like a good resource for the nuts and bolts of the migration: https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/

Shouldn't be too onerous, but there is definitely a certain amount of work to be done. The biggest pain will likely be that I'll have to fork the manifests for Chrome and FF as Firefox's Manifest v3 support isn't quite baked yet: https://blog.mozilla.org/addons/2022/05/18/manifest-v3-in-firefox-recap-next-steps/

Simon-Tesla commented 2 years ago

(Alternately, I could just choose to not support Chrome anymore, given that they seem pretty interested in using manifest v3 to kill ad blockers and such. We'll see. I might just wait for FF's Manifest v3 work to be fully baked before I do the migration, even if that leaves Chrome out in the cold for a bit.)

Simon-Tesla commented 1 year ago

Looks like the timeline for this has been pushed out another year: https://developer.chrome.com/blog/more-mv2-transition/

My perspective on this is shifting more towards waiting for Firefox's Manifest v3 support to roll out publicly before doing anything to migrate, and again, if that means leaving Chrome out of the support matrix for a while (less likely with the new timeline), so be it.

Simon-Tesla commented 1 year ago

Info on the Firefox side: https://blog.mozilla.org/addons/2022/11/17/manifest-v3-signing-available-november-21-on-firefox-nightly/

Simon-Tesla commented 1 year ago

And: https://blog.mozilla.org/addons/2022/11/17/unified-extensions-button-and-how-to-handle-permissions-in-manifest-v3/

Simon-Tesla commented 1 year ago

More documentation on migrating to MV3: https://extensionworkshop.com/documentation/publish/distribute-manifest-versions/

Simon-Tesla commented 1 year ago

Also apparently the timeline has slipped to some indefinite future point again: https://groups.google.com/u/1/a/chromium.org/g/chromium-extensions/c/zQ77HkGmK9E

Simon-Tesla commented 5 months ago

This is on hold, along with any other Chrome-specific work. Firefox plans to support V2 for the foreseeable future: https://blog.mozilla.org/addons/2024/03/13/manifest-v3-manifest-v2-march-2024-update/