dstein64 / highlight

A browser extension for automatically highlighting the important content on article pages.
MIT License
54 stars 13 forks source link

Switch to Manifest V3 #8

Closed dstein64 closed 8 months ago

dstein64 commented 2 years ago

This PR updates the extension to use Manifest V3.

Starting in January 2023, "the Chrome browser will no longer run Manifest V2 extensions." (source)

Firefox does not currently support Manifest V3, but it is scheduled to be available soon: "we are hoping to complete enough work on this project to support developer testing in Q4 2021 and start accepting v3 submissions in early 2022." (source)

dstein64 commented 2 years ago

~Currently autonomous highlighting and global highlighting don't work. The following change in manifest.json would fix the issue:~

   },
   "permissions": ["activeTab", "contextMenus", "scripting", "storage"],
   "optional_permissions": ["tabs", "clipboardWrite"],
+  "host_permissions": ["<all_urls>"],
   "background": {
     "service_worker": "src/eventPage.js"
   },

~There is currently no way to add optional host permissions, which the extension utilized under Manifest V2 in order to support autonomous highlighting and global highlighting.~

~The following links have related information. There is a proposal to add optional_host_permissions.~

~With optional_host_permissions the plugin could support autonomous highlighting and global highlighting in the same way it did under Manifest V2.~

   },
   "permissions": ["activeTab", "contextMenus", "scripting", "storage"],
   "optional_permissions": ["tabs", "clipboardWrite"],
+  "optional_host_permissions": ["<all_urls>"],
   "background": {
     "service_worker": "src/eventPage.js"
   },
dstein64 commented 2 years ago

Chromium 614b578 adds optional_host_permissions.

Support was added to Auto Highlight in eedb48218580aa3007086af41daec0240e157561.