Skip to content

Commit 83b76fe

Browse files
777geniusKocal
authored andcommitted
feat: browser object is now accessible in Vue templates by using $browser (Kocal#357)
This will help to have easy access from the template. ```vue <button> {{ $browser.i18n.getMessage('findPlayer') }} </button> ```
1 parent 8137ee0 commit 83b76fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

template/src/popup/popup.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
{{#if mozillaPolyfill}}global.browser = require('webextension-polyfill'){{/if}}
2-
31
import Vue from 'vue'
42
import App from './App'
53
{{#if store}}import store from '../store'{{/if}}
64
{{#if router}}import router from './router'{{/if}}
75

6+
{{#if mozillaPolyfill}}global.browser = require('webextension-polyfill')
7+
Vue.prototype.$browser = global.browser{{/if}}
8+
89
/* eslint-disable no-new */
910
new Vue({
1011
el: '#app',

0 commit comments

Comments
 (0)