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

Update to Chrome Extension Manifest v3 #13

Open
0xdevalias opened this issue Dec 13, 2022 · 6 comments · May be fixed by #20
Open

Update to Chrome Extension Manifest v3 #13

0xdevalias opened this issue Dec 13, 2022 · 6 comments · May be fixed by #20
Assignees

Comments

@0xdevalias
Copy link
Owner

0xdevalias commented Dec 13, 2022

  • https://developer.chrome.com/blog/mv2-transition/
    • Manifest V3 is more secure, performant, and privacy-preserving than its predecessor. It is an evolution of the extension platform that takes into consideration both the changing web landscape and the future of browser extensions.

    • January 17, 2022: New Manifest V2 extensions will no longer be accepted by the Chrome Web Store. Developers may still push updates to existing Manifest V2 extensions, but no new Manifest V2 items may be submitted.

    • January 2023: The Chrome browser will no longer run Manifest V2 extensions. Developers may no longer push updates to existing Manifest V2 extensions.

  • https://developer.chrome.com/blog/more-mv2-transition/
    • Starting in January in Chrome 112, Chrome may run experiments to turn off support for Manifest V2 extensions in Canary, Dev, and Beta channels.

    • Starting in June in Chrome 115, Chrome may run experiments to turn off support for Manifest V2 extensions in all channels, including stable channel.

    • For developers who still own extensions running Manifest V2, we recommend completing migration to Manifest V3 well ahead of the release of these Chrome versions because those extensions may stop working at any time following the aforementioned dates.

  • https://developer.chrome.com/docs/extensions/mv3/mv2-sunset/
    • December 9, 2022: The Manifest V2 deprecation timelines are under review and the experiments scheduled for early 2023 are being postponed. For more information, read the update in the chromium-extensions Google Group.

    • https://groups.google.com/u/1/a/chromium.org/g/chromium-extensions/c/zQ77HkGmK9E
      • Pausing Manifest V2 phase-out changes

      • we’re postponing any January experiments to turn off Manifest V2 in pre-release channels of Chrome and changes to the featured badge in the Chrome Webstore, and we'll be evaluating all downstream milestones as well. Expect to hear more about the updated phase-out plan and schedule by March of 2023. Our guiding principle will be to give developers sufficient time to update and test their extensions after the launch of these new capabilities before turning off Manifest V2.

  • https://developer.chrome.com/blog/resuming-the-transition-to-mv3
    • Resuming the transition to Manifest V3

    • The phase-out timeline
      We will begin disabling Manifest V2 extensions in pre-stable versions of Chrome (Dev, Canary, and Beta) as early as June 2024, in Chrome 127 and later. Users impacted by the rollout will see Manifest V2 extensions automatically disabled in their browser and will no longer be able to install Manifest V2 extensions from the Chrome Web Store. Also in June 2024, Manifest V2 extensions will lose their Featured badge in the Chrome Web Store if they currently have one.

  • https://blog.chromium.org/2024/05/manifest-v2-phase-out-begins.html
    • Manifest V2 phase-out begins

    • Starting on June 3 on the Chrome Beta, Dev and Canary channels, if users still have Manifest V2 extensions installed, some will start to see a warning banner when visiting their extension management page - chrome://extensions - informing them that some (Manifest V2) extensions they have installed will soon no longer be supported. At the same time, extensions with the Featured badge that are still using Manifest V2 will lose their badge.

  • https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline
    • Manifest V2 support timeline
      Understand when Manifest V2 will stop working for extensions

    • June 3 2024: the Manifest V2 phase-out begins.
      Starting on June 3 on the Chrome Beta, Dev and Canary channels, if users still have Manifest V2 extensions installed, some will start to see a warning banner when visiting their extension management page - chrome://extensions - informing them that some (Manifest V2) extensions they have installed will soon no longer be supported. At the same time, extensions with the Featured badge that are still using Manifest V2 will lose their badge.

      This will be followed gradually in the coming months by the disabling of those extensions. Users will be directed to the Chrome Web Store, where they will be recommended Manifest V3 alternatives for their disabled extension. For a short time after the extensions are disabled, users will still be able to turn their Manifest V2 extensions back on, but over time, this toggle will go away as well.

  • https://developer.chrome.com/docs/extensions/mv3/known-issues/
  • https://developer.chrome.com/docs/extensions/whatsnew/#m104-favicon-api
    • Manifest V3 extensions can now access favicons using a new URL pattern: chrome-extension://<id>/_favicon/, where is the ID of your extension. This replaces the Manifest V2 platform's chrome://favicons API. See the Favicon API docs for more information.

@0xdevalias
Copy link
Owner Author

0xdevalias commented Apr 16, 2024

Here is the official migration guide:

And this may also be potentially useful:

@0xdevalias
Copy link
Owner Author

0xdevalias commented Jul 15, 2024

It seems like Chrome 127 is when MV2 extensions will start getting disabled, and according to the release timeline, that will hit stable release tomorrow (Jul 17 2024):

  • https://developer.chrome.com/blog/resuming-the-transition-to-mv3
    • Resuming the transition to Manifest V3

    • The phase-out timeline
      We will begin disabling Manifest V2 extensions in pre-stable versions of Chrome (Dev, Canary, and Beta) as early as June 2024, in Chrome 127 and later. Users impacted by the rollout will see Manifest V2 extensions automatically disabled in their browser and will no longer be able to install Manifest V2 extensions from the Chrome Web Store. Also in June 2024, Manifest V2 extensions will lose their Featured badge in the Chrome Web Store if they currently have one.

Edit: At 4:11pm on 17/07/2024, it says stable will release in ~8hrs; which would basically be at midnight/the start of 18/07/2024 (AEST)

@0xdevalias
Copy link
Owner Author

0xdevalias commented Jul 17, 2024

I tried running the extension-manifest-converter:

It seems to have merged all of the existing .js files (src/bg/background.js, js/chromeExtensionApiAbstractions.js, js/googleAnalytics.js ) into a single service_worker.js file (and maybe makes some tweaks to that code in doing so). Not sure if this is a requirement, or it's just a limitation of this tool and we can still maintain separate files. Need to look deeper into that:

It also made the following minimal changes to manifest.json (ignoring whitespace changes):

diff --git a/manifest.json b/manifest.json
index 404abe8..a4494be 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,10 +1,12 @@
 {
   "name": "New Window With Tabs To Right",
   "version": "1.0.1",
-  "manifest_version": 2,
+  "manifest_version": 3,
   "description": "This extension creates a new window with the tabs to the right of the currently selected tab.",
   "homepage_url": "http://devalias.net/dev/chrome-extensions/",
-  "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
+  "content_security_policy": {
+    "extension_pages": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'"
+  },
   "permissions": [
     "tabs",
     "contextMenus"
@@ -16,12 +18,8 @@
   },
   "default_locale": "en",
   "background": {
-    "scripts": [
-      "js/googleAnalytics.js",
-      "js/chromeExtensionApiAbstractions.js",
-      "src/bg/background.js"
-    ],
-    "persistent": true
+    "persistent": true,
+    "service_worker": "service_worker.js"
   },
   "commands": {
     "newWindowWithCurrentAndTabsToRight": {

Given the simplicity of this extension, I assume there probably won't be a lot of changes to be made to convert it; and so it's not all that surprising that the changes this conversion tool made were so minimal; but now we really need to go through the migration checklist to figure out more specifically what needs to be done; and if these changes are required/optimal:

@0xdevalias
Copy link
Owner Author

0xdevalias commented Sep 26, 2024

Last time I was working on this, I was exploring a way to implement 'options toggles' in the contextMenu, so that, as an example, the user could toggle on/off the 'page' context menu (eg. right-click on page) as per this issue:

And tangentially this issue:

Here is the (private) ChatGPT reference that I was exploring that in for context:

My notes from then was that "it is seeming like it might be more effort than it's worth, and maybe implementing a proper options page would be a better choice"; though I this was before the ChatGPT o1-preview and o1-mini models were released; so they may be able to come up with a better 'wholistic solution' than I was struggling with with the 4o model on its own.

Here is a new (private) ChatGPT o1-preview reference exploring how to implement this using the same method I was exploring previously:

@0xdevalias
Copy link
Owner Author

I'm exploring some ideas for refactoring everything into more modular code files/patterns in this (private) ChatGPT o1-preview conversation:

@0xdevalias
Copy link
Owner Author

I'm exploring some ideas for implementing settings / context menu options toggles for changing the default onClick action of the extensions 'action icon' in this (private) ChatGPT o1-preview conversation:

This relates to the following issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant