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

Migrated the code base to manifest v3 #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adismort14
Copy link
Contributor

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.

@@ -407,7 +407,7 @@
"maxArgs": 2
}
},
"pageAction": {
"Action": {
Copy link
Member

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"
Copy link
Member

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.

@ambarvm ambarvm added the hacktoberfest-accepted Accept PR for hactoberfest without merging label Oct 24, 2022
@ambarvm ambarvm linked an issue Oct 24, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accept PR for hactoberfest without merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manifest v3
2 participants