Skip to content

Commit

Permalink
gh-6 added webextension-polyfill for experimental chrome support
Browse files Browse the repository at this point in the history
  • Loading branch information
craftamap committed Jan 16, 2021
1 parent 0421505 commit bf6450b
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 2 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"mini-css-extract-plugin": "^1.3.3",
"sass": "^1.32.2",
"web-ext": "^5.4.1",
"webextension-polyfill-ts": "^0.22.0",
"webpack": "^5.12.3",
"webpack-cli": "^4.3.1"
},
Expand All @@ -35,7 +36,8 @@
"vue": "^2.6.12",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.12",
"vuex": "^3.6.0"
"vuex": "^3.6.0",
"webextension-polyfill": "^0.7.0"
},
"webExt": {
"sourceDir": "addon",
Expand All @@ -49,6 +51,9 @@
"es6": true,
"webextensions": true
},
"globals": {
"browser": "off"
},
"extends": [
"eslint:recommended",
"plugin:vue/vue3-recommended"
Expand Down
2 changes: 2 additions & 0 deletions src/Options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
</template>

<script>
import browser from 'webextension-polyfill';
export default {
name:'Options',
computed: {
Expand Down
2 changes: 2 additions & 0 deletions src/add-follow-button.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import browser from 'webextension-polyfill';

function htmlToElement(html) {
const template = document.createElement('template');
html = html.trim(); // Never return a text node of whitespace as the result
Expand Down
1 change: 1 addition & 0 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import browser from 'webextension-polyfill';
import api from './api/owncast';
import Storage from './util/storage';
import urlcat from 'urlcat';
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//import Instances from './templates/Instances.hbs';
import browser from 'webextension-polyfill';
import Vue from 'vue';
import App from './App.vue';
import Vuex from 'vuex'
Expand Down
1 change: 1 addition & 0 deletions src/options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import browser from 'webextension-polyfill';
import Vue from 'vue';
import Vuex from 'vuex'
import Options from './Options.vue';
Expand Down
2 changes: 2 additions & 0 deletions src/util/storage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import browser from 'webextension-polyfill';

function setOptionsInStorage(options) {
return browser.storage.local.set({options: options});
}
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5884,6 +5884,18 @@ web-ext@^5.4.1:
yargs "15.4.1"
zip-dir "1.0.2"

webextension-polyfill-ts@^0.22.0:
version "0.22.0"
resolved "https://registry.yarnpkg.com/webextension-polyfill-ts/-/webextension-polyfill-ts-0.22.0.tgz#86cfd7bab4d9d779d98c8340983f4b691b2343f3"
integrity sha512-3P33ClMwZ/qiAT7UH1ROrkRC1KM78umlnPpRhdC/292UyoTTW9NcjJEqDsv83HbibcTB6qCtpVeuB2q2/oniHQ==
dependencies:
webextension-polyfill "^0.7.0"

webextension-polyfill@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.7.0.tgz#0df1120ff0266056319ce1a622b09ad8d4a56505"
integrity sha512-su48BkMLxqzTTvPSE1eWxKToPS2Tv5DLGxKexLEVpwFd6Po6N8hhSLIvG6acPAg7qERoEaDL+Y5HQJeJeml5Aw==

webidl-conversions@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514"
Expand Down

0 comments on commit bf6450b

Please sign in to comment.