File tree Expand file tree Collapse file tree 5 files changed +22
-6
lines changed
standalone/src/standalone/router/pages Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 11import store from './store'
22
33< % _ if ( options . popupPage ) { - % >
4- chrome . runtime . onMessage . addListener ( function ( request , sender , sendResponse ) { < % _ } else { - % >
5- chrome .browserAction.onClicked.addListener(function (tab) { < % _ } -%>
4+ < % - options . api % > . runtime . onMessage . addListener ( function ( request , sender , sendResponse ) { < % _ } else { - % >
5+ < % - options . api % > . browserAction . onClicked . addListener ( function ( tab ) { < % _ } - % >
66 console.log(`Hello ${ store . getters . foo } !`)
77
88 < % _ if ( options . contentScript ) { - % >
9- chrome . tabs . executeScript ( {
9+ < % - options . api % > .tabs.executeScript({
1010 file : 'content-script.js' ,
1111 } );
1212 < % _ } - % >
Original file line number Diff line number Diff line change 3232 },
3333 "options_ui" : {
3434 "page" : " options/options.html" ,
35- "chrome_style " : true
35+ "<%- options.api %>_style " : true
3636 <%_ } -%>
3737 }
3838}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default {
88 return {}
99 },
1010 mounted () {
11- chrome . runtime .sendMessage ({});
11+ < %- options . api % > . runtime .sendMessage ({})
1212 }
1313}
1414 </script >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default {
88 return {}
99 },
1010 mounted () {
11- chrome .runtime .sendMessage ({});
11+ < %- options . api % > .runtime .sendMessage ({});
1212 }
1313}
1414 </script >
Original file line number Diff line number Diff line change @@ -41,5 +41,21 @@ module.exports = [
4141
4242 return componentMap
4343 }
44+ } ,
45+ {
46+ name : 'api' ,
47+ type : 'list' ,
48+ default : 'browser' ,
49+ message : 'Which extension API do you wish to use?' ,
50+ choices : [
51+ {
52+ name : 'browser (WebExtension)' ,
53+ value : 'browser'
54+ } ,
55+ {
56+ name : 'chrome' ,
57+ value : 'chrome'
58+ }
59+ ]
4460 }
4561]
You can’t perform that action at this time.
0 commit comments