-
Notifications
You must be signed in to change notification settings - Fork 10
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
Migrated the code base to manifest v3 #7
base: master
Are you sure you want to change the base?
Conversation
@@ -407,7 +407,7 @@ | |||
"maxArgs": 2 | |||
} | |||
}, | |||
"pageAction": { | |||
"Action": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying this file is less than ideal because this is library code. The polyfill does not support MV3.
Moreover, it might not be needed anymore since chrome now supports many promise based APIs.
Try replacing this file with:
const global = typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : this
global.browser = typeof browser === 'undefined' ? chrome : browser
@@ -16,8 +16,7 @@ | |||
"default_title": "CGPA" | |||
}, | |||
"background": { | |||
"scripts": ["browser-polyfill.js", "background.js"], | |||
"persistent": false | |||
"service_worker": "worker-wrapper.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firefox MV3 is currently in beta and does not support background service worker.
Lets wait for merging this. We can merge this when firefox supports this.
If that does not happen before chrome ends mv2 support, we can create a script to generate 2 different manifest files.
Updated the manifest.json to the new version of manifest and made the corresponding changes to other files. Added new file worker-wrapper.js to include multiple background scripts in service_worker.
Tested and is working fine.