mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-10-22 19:15:25 +00:00
init
This commit is contained in:
1
template/src/backend/index.js
Normal file
1
template/src/backend/index.js
Normal file
@@ -0,0 +1 @@
|
||||
console.log('background !')
|
1
template/src/content/index.js
Normal file
1
template/src/content/index.js
Normal file
@@ -0,0 +1 @@
|
||||
console.log('content-script!')
|
5
template/src/content/inject.js
Normal file
5
template/src/content/inject.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var content = chrome.extension.getURL('js/content.js')
|
||||
var script = document.createElement('script')
|
||||
script.setAttribute('type', 'text/javascript')
|
||||
script.setAttribute('src', content)
|
||||
document.body.appendChild(script)
|
3
template/src/devtools/index.js
Normal file
3
template/src/devtools/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
chrome.devtools.panels.create('panel', 'img/logo.png', 'pages/panel.html', function (panel) {
|
||||
console.log('hello from callback')
|
||||
})
|
8
template/src/devtools/panel.js
Normal file
8
template/src/devtools/panel.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import Vue from 'vue'
|
||||
import root from './root.vue'
|
||||
Vue.config.productionTip = false
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#root',
|
||||
render: h => h(root)
|
||||
})
|
18
template/src/devtools/root.vue
Normal file
18
template/src/devtools/root.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template lang="pug">
|
||||
div devtools
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
}),
|
||||
computed: { },
|
||||
created () { },
|
||||
mounted () { },
|
||||
methods: { }
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
div {
|
||||
color: blue
|
||||
}
|
||||
</style>
|
22
template/src/ext/storage.js
Normal file
22
template/src/ext/storage.js
Normal file
@@ -0,0 +1,22 @@
|
||||
export default {
|
||||
get (key) {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(key))
|
||||
} catch (e) {}
|
||||
},
|
||||
set (key, val) {
|
||||
try {
|
||||
localStorage.setItem(key, JSON.stringify(val))
|
||||
} catch (e) {}
|
||||
},
|
||||
remove (key) {
|
||||
try {
|
||||
localStorage.removeItem(key)
|
||||
} catch (e) {}
|
||||
},
|
||||
clear () {
|
||||
try {
|
||||
localStorage.clear()
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
41
template/src/manifest.js
Normal file
41
template/src/manifest.js
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
module.exports = {
|
||||
name: 'Vue Extension',
|
||||
version: '1.0.0',
|
||||
description: 'Vue.js Chrome Extension Template (wcer)',
|
||||
author: 'yura',
|
||||
manifest_version: 2,
|
||||
icons: { '16': 'icons/16.png', '128': 'icons/128.png' },
|
||||
permissions: [
|
||||
'<all_urls>',
|
||||
'*://*/*',
|
||||
'activeTab',
|
||||
'tabs',
|
||||
'cookies',
|
||||
'background',
|
||||
'contextMenus',
|
||||
'unlimitedStorage',
|
||||
'storage',
|
||||
'notifications',
|
||||
'identity',
|
||||
'identity.email'
|
||||
],
|
||||
browser_action: {
|
||||
default_title: 'title',
|
||||
default_popup: 'pages/popup.html'
|
||||
},
|
||||
background: {
|
||||
persistent: false,
|
||||
page: 'pages/background.html'
|
||||
},
|
||||
devtools_page: 'pages/devtools.html',
|
||||
options_page: 'pages/options.html',
|
||||
content_scripts: [{
|
||||
js: [ 'js/inject.js' ],
|
||||
run_at: 'document_end',
|
||||
matches: ['<all_urls>'],
|
||||
all_frames: true
|
||||
}],
|
||||
content_security_policy: "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
||||
web_accessible_resources: [ 'panel.html', 'js/content.js' ]
|
||||
}
|
8
template/src/options/index.js
Normal file
8
template/src/options/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import Vue from 'vue'
|
||||
import root from './root.vue'
|
||||
Vue.config.productionTip = false
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#root',
|
||||
render: h => h(root)
|
||||
})
|
18
template/src/options/root.vue
Normal file
18
template/src/options/root.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template lang="pug">
|
||||
div options
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
}),
|
||||
computed: { },
|
||||
created () { },
|
||||
mounted () { },
|
||||
methods: { }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
div {
|
||||
color: blue
|
||||
}
|
||||
</style>
|
12
template/src/popup/index.js
Normal file
12
template/src/popup/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Vue from 'vue'
|
||||
import root from './root.vue'
|
||||
import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-chalk/index.css'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(ElementUI)
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#root',
|
||||
render: h => h(root)
|
||||
})
|
23
template/src/popup/root.vue
Normal file
23
template/src/popup/root.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template lang="pug">
|
||||
div
|
||||
el-button(type="primary" @click="tab") New tab
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
}),
|
||||
computed: { },
|
||||
created () { },
|
||||
mounted () { },
|
||||
methods: {
|
||||
tab () {
|
||||
chrome.tabs.create({ url: 'pages/app.html' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
div {
|
||||
color: blue
|
||||
}
|
||||
</style>
|
8
template/src/tab/index.js
Normal file
8
template/src/tab/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import Vue from 'vue'
|
||||
import root from './root.vue'
|
||||
Vue.config.productionTip = false
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#root',
|
||||
render: h => h(root)
|
||||
})
|
18
template/src/tab/root.vue
Normal file
18
template/src/tab/root.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template lang="pug">
|
||||
div tab
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
}),
|
||||
computed: { },
|
||||
created () { },
|
||||
mounted () { },
|
||||
methods: { }
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
div {
|
||||
color: blue
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user