Migrate AMR to support Manifest V3
The new chrome manifest version 3 is coming soon and that will essentially no longer support V2 that current AMR heavily relies on (background.js)
Key timeline:
January 2023 Chrome Web Store stops accepting updates to existing Manifest V2 extensions Chrome stops running Manifest V2 extensions
What it means for AMR: due to change of how extension are going to be working in V3, AMR can no longer rely on consistent background.js script and instead will need to adopt the new suggest approach by using Service workers
Some basic testing of switching over, there are considerable amount of changes, that needs to be done, but most of them are not really due to a change of how the background script works.
Key issues that would need to be resolved:
-
no window object, therefore window["AMR_STORE"] needs to be resolved back to store (vuex). I believe this was fix (hack really) to solve circular dependecies. -
replace document in files that are used by background service worker -
no localStorage, can be replaced with browser.storage.local or browser.storage.sync if we want to sync options. -
convert setTimeout for background chapter refresh to alarms -
remove global instantiation of utility classes that depend on store (part of fixes for window["AMR_STORE"]) -
migrate permissions, and other new browser api's to use manifest v3 alternatives -
mirrors not to use window this is big one, but finally could be a good way to refactor mirrors and how they get injected.
so first thing is
-
circular dependencies and window["AMR_STORE"] issues
but it's true that pretty much every single file will need to be modified one way or another
Next stage changes
-
Convert mirrors to use the new structure with cheerio -
Check inconsistent MangaFox image loading