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

[Migration] support for Manifest v3 #66

Open
emorling opened this issue May 17, 2021 · 21 comments
Open

[Migration] support for Manifest v3 #66

emorling opened this issue May 17, 2021 · 21 comments
Labels
effort: high more than a week help wanted Issue with a clear description that the community can help with. impact: high unblocks new usecases, substantial improvement to existing feature, fixes a major bug 💡 Proposed Work This is work that _might_ be worth doing, but that hasn't been started yet. type: feature or enhancement An issue or pull request that adds a feature or enhances a current one

Comments

@emorling
Copy link

Any plans on upgrading this to work with manifest V3? Or a list of manual changes that need to be done? It doesn't seem to work out of the box for V3.

@abhijithvijayan abhijithvijayan added effort: med up to a week help wanted Issue with a clear description that the community can help with. impact: med minor perf improvements, fix broad userbase issues type: feature or enhancement An issue or pull request that adds a feature or enhances a current one 💡 Proposed Work This is work that _might_ be worth doing, but that hasn't been started yet. labels May 23, 2021
@sephentos

This comment has been minimized.

@emorling
Copy link
Author

emorling commented Jul 3, 2021

I think this is the best documentation on what an upgrade från V2 to V3 implies:

https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/

@abhijithvijayan
Copy link
Owner

abhijithvijayan commented Jul 4, 2021

@emorling i dont think manifest v3 is being pushed to firefox anytime soon.

https://blog.mozilla.org/addons/2021/05/27/manifest-v3-update/&sa=U&ved=2ahUKEwjzjvWNw8jxAhWyzDgGHdBMDxsQFjACegQIBxAB&usg=AOvVaw0PczMyb3bHfV4NeFcKdH8F

I will not be implementing this until a beta release from these browser vendors are out and they provide viable migration guides for both.

Background scripts are now being replaced with workers, so I dont want to make partial support to chome and no support to firefox.

Probably its a good call to wait. And I would like to see some open source extensions already working on this hell of a migration.

@abhijithvijayan
Copy link
Owner

abhijithvijayan commented Dec 2, 2021

@abhijithvijayan abhijithvijayan changed the title Manifest V3? [Migration] support for Manifest v3 Dec 8, 2021
@abhijithvijayan
Copy link
Owner

abhijithvijayan commented Jan 4, 2022

Update:

  • The underlying polyfill by Mozilla has an issue open with respect to support for Chrome's v3 APIs
    see: Support Chrome manifest v3 APIs mozilla/webextension-polyfill#329 (comment)

  • The initial steps to be done for the manifest.json mentioned in migration guide can be accomplished by vendor prefixed keys (docs]
    eg:

           "__chrome|opera|edge__manifest_version": 3,
           "__firefox__manifest_version": 2
    
    • Note: if you are going with keeping Opera/Edge/Other Chromium based browsers in sync with that of Chrome, the keys would have to be adjusted like __chrome|opera|edge__ & __firefox__. This depends on the browser backward compatibility you are intending to accomplish.
  • Dropping support for older chrome/edge/opera/brave versions by modifying targets field in .babelrc file

     	  "targets": {
                 "chrome": "88",
                 "firefox": "52",
                 "opera": "74",
                 "edge": "88"
          }
    
  • and also manifest.json should be updated

         "__firefox__browser_specific_settings": {
    	        "gecko": {
    	          "id": "{some_id}",
    	          "strict_min_version": "52.0"
    	        }
         },
         "__chrome__minimum_chrome_version": "88",
         "__opera__minimum_opera_version": "74",
    
    • Note: chrome can be of version 88 and opera can be of 74 (which has Chromium 88), for edge i think 88 is needed as from what i saw on wikipedia, edge keeps version in sync with that of chromium's.
  • Deprecated APIs will be rendered useless for users of Chromium-based browsers(before v87) after January 2023

  • using service workers for chrome can be adopted by providing a separate background script(using manifest vendor prefixed key)

     "background": {
           "__firefox__scripts": [
             "js/background.bundle.js"
           ],
           "__chrome|opera|edge__service_worker": "js/bgServiceWorker.js",
    },
    

I think this would help in the migration, If I get some time, I will test this myself. As of now all the extensions that i have is already on chrome store which means I have an year more for the migration. But for the new extensions created after January 17, migration is very much needed for chrome team to accept the extension into their store.

Hope this helps!

Like always, contributions & support are welcome from anyone.

@abhijithvijayan abhijithvijayan pinned this issue Jan 4, 2022
@abhijithvijayan abhijithvijayan added effort: high more than a week impact: high unblocks new usecases, substantial improvement to existing feature, fixes a major bug and removed impact: med minor perf improvements, fix broad userbase issues effort: med up to a week labels Jan 4, 2022
@princesust

This comment was marked as resolved.

@abhijithvijayan
Copy link
Owner

The extension hot reloading library also lacks support for this.

SimplifyJobs/webpack-ext-reloader#28

@abhijithvijayan
Copy link
Owner

abhijithvijayan commented Jun 13, 2022

The wext-manifest-loader library (v2.4.1) now supports env variables alongside vendor prefixes https://github.com/abhijithvijayan/wext-manifest-loader#2-how-can-i-conditionally-set-keys-based-on-environment

For development/production env for chrome we now can use manifest v3 fields
For development/production env for firefox we now can use manifest v2 fields

  "__chrome|opera|edge__manifest_version": 3,
  "__firefox__manifest_version": 2,

  "__chrome|opera|edge|dev__content_security_policy": {
    "extension_pages": "script-src 'self' http://localhost:8097; object-src 'self'"
  },

  "__chrome|opera|edge|prod__content_security_policy": {
    "extension_pages": "script-src 'self'; object-src 'self'"
  },

  "__firefox|dev__content_security_policy": "script-src 'self' http://localhost:8097; object-src 'self'",
  "__firefox|prod__content_security_policy": "script-src 'self'; object-src 'self'",

For chrome in production, the output manifest will have

  "manifest_version": 3,
  "content_security_policy": {
    "extension_pages": "script-src 'self'; object-src 'self'"
  }

For firefox in production, the output manifest will have

  "manifest_version": 2,
  "content_security_policy": "script-src 'self'; object-src 'self'"

@abhijithvijayan
Copy link
Owner

abhijithvijayan commented Jun 26, 2022

I have published an extension last week to firestore and chrome with manifest 2 and 3 combined(with content script only

https://github.com/abhijithvijayan/Resume-Downloader/blob/main/source/manifest.json

Edit:

https://pastebin.com/raw/rurMH5Zh

@ss5nathan

This comment was marked as outdated.

@lsmith77
Copy link

starting end of January 2023 Firefox will support MV3
https://blog.mozilla.org/addons/2022/11/17/manifest-v3-signing-available-november-21-on-firefox-nightly/

also staring January, Chrome store will no longer show the featured badge for MV2 extensions:
https://developer.chrome.com/docs/extensions/mv3/mv2-sunset/

@lsmith77
Copy link

seems like Google has postponed their timeline https://9to5google.com/2022/12/12/manifest-v2-chrome-extension/

@psiinon
Copy link

psiinon commented Jan 4, 2023

I've just tried to upload an extension with a v2 manifest to the Chrome store but get this error:
"You can no longer publish new Manifest V2 extensions. Try converting your extension to Manifest V3."

@clach04
Copy link

clach04 commented Dec 4, 2023

Looks like (almost) end of this year v2 will be blocked/purged https://developer.chrome.com/blog/more-mv2-transition/

In January 2024, following the expiration of the Manifest V2 enterprise policy, the Chrome Web Store will remove all remaining Manifest V2 items from the store.

@clach04
Copy link

clach04 commented Dec 4, 2023

https://github.com/kyle-n/WebExtensionTemplate appears to have v3 support

@lsmith77
Copy link

lsmith77 commented Dec 4, 2023

The timeline has since been updated but yeah in 2024 the migration looks to be happening https://developer.chrome.com/blog/resuming-the-transition-to-mv3/

@rushilsrivastava

This comment was marked as outdated.

@abhijithvijayan
Copy link
Owner

abhijithvijayan commented Jan 30, 2024

migrated dependency libraries to support both webpack 4 and webpack 5

wext-manifest-webpack-plugin@^1.4.0
wext-manifest-loader@^2.4.1

i will get the template to support webpack 5 too. hopefully all the depedencies support webpack 5 now

@dk-zone
Copy link

dk-zone commented Feb 2, 2024

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^5.90.0" from the root project
npm ERR!   webpack@"^5" from @types/[email protected]
npm ERR!   node_modules/@types/webpack
npm ERR!     dev @types/webpack@"^5.28.5" from the root project
npm ERR!     @types/webpack@"^5.28.5" from [email protected]
npm ERR!     node_modules/webpack-ext-reloader
npm ERR!       dev webpack-ext-reloader@"^1.1.12" from the root project
npm ERR!   16 more (@webpack-cli/configtest, @webpack-cli/info, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from [email protected]
npm ERR! node_modules/optimize-css-assets-webpack-plugin
npm ERR!   dev optimize-css-assets-webpack-plugin@"^6.0.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.0.0" from [email protected]
npm ERR!   node_modules/optimize-css-assets-webpack-plugin
npm ERR!     dev optimize-css-assets-webpack-plugin@"^6.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/dk/.npm/_logs/2024-02-02T19_20_04_233Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dk/.npm/_logs/2024-02-02T19_20_04_233Z-debug-0.log

@nakulrathore
Copy link

any update on this ? 🤔

@lsmith77
Copy link

@abhijithvijayan Google has announced that devs need to migrate to V3 by June.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: high more than a week help wanted Issue with a clear description that the community can help with. impact: high unblocks new usecases, substantial improvement to existing feature, fixes a major bug 💡 Proposed Work This is work that _might_ be worth doing, but that hasn't been started yet. type: feature or enhancement An issue or pull request that adds a feature or enhances a current one
Projects
None yet
Development

No branches or pull requests