diff --git a/package-lock.json b/package-lock.json index 866666a..888abbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "iitc-button", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "iitc-button", - "version": "2.0.1", + "version": "2.0.2", "license": "GPLv3", "dependencies": { "@highlightjs/vue-plugin": "^1.0.2", "core-js": "^3.6.5", "highlight.js": "^10.7.3", - "lib-iitc-manager": "^1.4.3", + "lib-iitc-manager": "^1.4.4", "scored-fuzzysearch": "^1.0.5", "vue": "^2.6.11" }, @@ -9485,9 +9485,9 @@ } }, "node_modules/lib-iitc-manager": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/lib-iitc-manager/-/lib-iitc-manager-1.4.3.tgz", - "integrity": "sha512-c658bdGy6LZ7n/r+eQCc8kuDcEz0bnFX4hjsJ9VRYDw5JMr0zJXNUbr2FoOmrbddAg7WAR7Rsd7xFIwvgky8og==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lib-iitc-manager/-/lib-iitc-manager-1.4.4.tgz", + "integrity": "sha512-NuGG7gW+8IiCd8zFzagZgcAnVDC7JZWy6YnSDoJsfkZf0UaFRdzvr5mbKDjggmdjIN3RaKoTu/LzikbTj2x6ew==", "dependencies": { "eslint": "^8.13.0", "xhr2": "^0.2.1" @@ -24468,9 +24468,9 @@ } }, "lib-iitc-manager": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/lib-iitc-manager/-/lib-iitc-manager-1.4.3.tgz", - "integrity": "sha512-c658bdGy6LZ7n/r+eQCc8kuDcEz0bnFX4hjsJ9VRYDw5JMr0zJXNUbr2FoOmrbddAg7WAR7Rsd7xFIwvgky8og==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lib-iitc-manager/-/lib-iitc-manager-1.4.4.tgz", + "integrity": "sha512-NuGG7gW+8IiCd8zFzagZgcAnVDC7JZWy6YnSDoJsfkZf0UaFRdzvr5mbKDjggmdjIN3RaKoTu/LzikbTj2x6ew==", "requires": { "eslint": "^8.13.0", "xhr2": "^0.2.1" diff --git a/package.json b/package.json index aa1f027..fad86d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iitc-button", - "version": "2.0.1", + "version": "2.0.2", "repository": "https://github.com/IITC-CE/IITC-Button.git", "license": "GPLv3", "private": true, @@ -13,7 +13,7 @@ "@highlightjs/vue-plugin": "^1.0.2", "core-js": "^3.6.5", "highlight.js": "^10.7.3", - "lib-iitc-manager": "^1.4.3", + "lib-iitc-manager": "^1.4.4", "scored-fuzzysearch": "^1.0.5", "vue": "^2.6.11" }, diff --git a/src/background/requests.js b/src/background/requests.js index 7ec137f..6a18740 100644 --- a/src/background/requests.js +++ b/src/background/requests.js @@ -69,6 +69,14 @@ async function bypass(tabId, url) { * @return {Promise} */ async function maybeInstallUserJs(tabId, url) { + const IITC_is_enabled = await browser.storage.local + .get(["IITC_is_enabled"]) + .then(data => data.IITC_is_enabled); + if (IITC_is_enabled === false) { + await bypass(tabId, url); + return; + } + let code = undefined; try { code = await ajaxGet(url); diff --git a/src/popup/components/ElementPlugin.vue b/src/popup/components/ElementPlugin.vue index 9bd365c..062941d 100644 --- a/src/popup/components/ElementPlugin.vue +++ b/src/popup/components/ElementPlugin.vue @@ -2,7 +2,7 @@