From 41634a5597e3aeb31e4148e03cacb563b0fa213b Mon Sep 17 00:00:00 2001 From: Aditya Sankhla Date: Sun, 16 Oct 2022 11:00:00 +0530 Subject: [PATCH 1/2] Migrated the code the manifest V3 --- background.js | 2 +- browser-polyfill.js | 4 ++-- manifest.json | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/background.js b/background.js index 8583f29..57e38d7 100644 --- a/background.js +++ b/background.js @@ -7,7 +7,7 @@ const gradesPageRule = { }, }), ], - actions: [new browser.declarativeContent.ShowPageAction()], + actions: [new browser.declarativeContent.ShowAction()], }; browser.runtime.onInstalled.addListener(function () { diff --git a/browser-polyfill.js b/browser-polyfill.js index 51f7fb6..bdd5c91 100644 --- a/browser-polyfill.js +++ b/browser-polyfill.js @@ -407,7 +407,7 @@ "maxArgs": 2 } }, - "pageAction": { + "Action": { "getPopup": { "minArgs": 1, "maxArgs": 1 @@ -1235,4 +1235,4 @@ module.exports = browser; } }); -//# sourceMappingURL=browser-polyfill.js.map +// sourceMappingURL=browser-polyfill.js.map diff --git a/manifest.json b/manifest.json index ab52f1f..bd1b4cb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { "name": "IITBh CGPA", - "version": "2.3", + "version": "2.4", "description": "Calculate CGPA directly from AIMS Portal. Click on the extension logo when on AIMS portal's courses page to see your CGPA.", "permissions": ["activeTab", "declarativeContent"], - "page_action": { + "action": { "default_popup": "popup.html", "show_matches": [ "*://aimsportal.iitbhilai.ac.in/iitbhAims/courseReg/myCrsHistoryPage*" @@ -16,8 +16,7 @@ "default_title": "CGPA" }, "background": { - "scripts": ["browser-polyfill.js", "background.js"], - "persistent": false + "service_worker": "worker-wrapper.js" }, "content_scripts": [ { @@ -32,5 +31,5 @@ "32": "images/32x32.png", "128": "images/128x128.png" }, - "manifest_version": 2 + "manifest_version": 3 } From 2ede249a975cadea20c3ae3fd282d317dcf57139 Mon Sep 17 00:00:00 2001 From: Aditya Sankhla Date: Sun, 16 Oct 2022 11:00:23 +0530 Subject: [PATCH 2/2] worker-wrapper.js file --- worker-wrapper.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 worker-wrapper.js diff --git a/worker-wrapper.js b/worker-wrapper.js new file mode 100644 index 0000000..36ca494 --- /dev/null +++ b/worker-wrapper.js @@ -0,0 +1,5 @@ +try { + importScripts("browser-polyfill.js", "background.js"); +} catch (e) { + console.log(e); +} \ No newline at end of file