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
This commit is contained in:
Tamius Han 2020-12-05 04:12:37 +01:00
parent 0310e1e2de
commit eb02865131
4 changed files with 10 additions and 5 deletions

3
package-lock.json generated
View File

@ -15625,7 +15625,8 @@
"webextension-polyfill": { "webextension-polyfill": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.6.0.tgz", "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": { "webpack": {
"version": "4.44.0", "version": "4.44.0",

View File

@ -32,8 +32,7 @@
"json-cyclic": "0.0.3", "json-cyclic": "0.0.3",
"vue": "^3.0.0-beta.1", "vue": "^3.0.0-beta.1",
"vuex": "^4.0.0-alpha.1", "vuex": "^4.0.0-alpha.1",
"vuex-webextensions": "^1.3.0", "vuex-webextensions": "^1.3.0"
"webextension-polyfill": "^0.6.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.10.5", "@babel/core": "^7.10.5",
@ -53,6 +52,7 @@
"vue-cli-plugin-vue-next": "~0.1.4", "vue-cli-plugin-vue-next": "~0.1.4",
"vue-loader": "^16.0.0", "vue-loader": "^16.0.0",
"web-ext-types": "^2.1.0", "web-ext-types": "^2.1.0",
"webextension-polyfill": "^0.6.0",
"webpack": "^4.44.0", "webpack": "^4.44.0",
"webpack-chrome-extension-reloader": "^0.8.3", "webpack-chrome-extension-reloader": "^0.8.3",
"webpack-cli": "^3.3.12", "webpack-cli": "^3.3.12",

View File

@ -19,8 +19,9 @@
"content_scripts": [{ "content_scripts": [{
"matches": ["*://*/*"], "matches": ["*://*/*"],
"js": [ "js": [
"ext/uw.js" "common/lib/browser-polyfill.js",
"ext/uw.js"
], ],
"css": [ "css": [
"ext/uw-ui.css", "ext/uw-ui.css",

View File

@ -86,6 +86,9 @@ const config = {
{ from: 'res', to: 'res', ignore: ['css', 'css/**']}, { from: 'res', to: 'res', ignore: ['css', 'css/**']},
{ from: 'ext', to: 'ext', ignore: ['conf/*', 'lib/**']}, { 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 // 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'}, { from: '../node_modules/bootstrap-icons/bootstrap-icons.svg', to: 'res/icons/bootstrap-icons.svg'},