From eb0286513104ff016dedc06e5fbfbbe720a53032 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 5 Dec 2020 04:12:37 +0100 Subject: [PATCH] Sorta include browser-polyfill but not really I'm still not rewriting legacy code, but the bRoWsEr iS uNdEfInEd bullshit in (browser || chrome).runtime call there in the notifications pushed some buttons. cc #114 --- package-lock.json | 3 ++- package.json | 4 ++-- src/manifest.json | 5 +++-- webpack.config.js | 3 +++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5696bb0..3688874 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15625,7 +15625,8 @@ "webextension-polyfill": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.6.0.tgz", - "integrity": "sha512-PlYwiX8e4bNZrEeBFxbFFsLtm0SMPxJliLTGdNCA0Bq2XkWrAn2ejUd+89vZm+8BnfFB1BclJyCz3iKsm2atNg==" + "integrity": "sha512-PlYwiX8e4bNZrEeBFxbFFsLtm0SMPxJliLTGdNCA0Bq2XkWrAn2ejUd+89vZm+8BnfFB1BclJyCz3iKsm2atNg==", + "dev": true }, "webpack": { "version": "4.44.0", diff --git a/package.json b/package.json index c336aa0..41cd381 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,7 @@ "json-cyclic": "0.0.3", "vue": "^3.0.0-beta.1", "vuex": "^4.0.0-alpha.1", - "vuex-webextensions": "^1.3.0", - "webextension-polyfill": "^0.6.0" + "vuex-webextensions": "^1.3.0" }, "devDependencies": { "@babel/core": "^7.10.5", @@ -53,6 +52,7 @@ "vue-cli-plugin-vue-next": "~0.1.4", "vue-loader": "^16.0.0", "web-ext-types": "^2.1.0", + "webextension-polyfill": "^0.6.0", "webpack": "^4.44.0", "webpack-chrome-extension-reloader": "^0.8.3", "webpack-cli": "^3.3.12", diff --git a/src/manifest.json b/src/manifest.json index a078c14..32d9b0f 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -19,8 +19,9 @@ "content_scripts": [{ "matches": ["*://*/*"], - "js": [ - "ext/uw.js" + "js": [ + "common/lib/browser-polyfill.js", + "ext/uw.js" ], "css": [ "ext/uw-ui.css", diff --git a/webpack.config.js b/webpack.config.js index dfc7d6b..8cb6897 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -86,6 +86,9 @@ const config = { { from: 'res', to: 'res', ignore: ['css', 'css/**']}, { from: 'ext', to: 'ext', ignore: ['conf/*', 'lib/**']}, + // we need to get webextension-polyfill and put it in common/lib + { from: '../node_modules/webextension-polyfill/dist/browser-polyfill.js', to: 'common/lib/browser-polyfill.js'}, + // This is a hack to get bootstrap icons svg file in /res/icons { from: '../node_modules/bootstrap-icons/bootstrap-icons.svg', to: 'res/icons/bootstrap-icons.svg'},