no message

This commit is contained in:
许彦峰
2019-03-16 11:10:49 +08:00
parent 9579ed24d2
commit 796d7071ce
16 changed files with 1526 additions and 1529 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -6,5 +6,5 @@
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="/js/popup.js?bda05936787919286d9e"></script></body>
<script type="text/javascript" src="/js/popup.js?2bd6ee2cf39f248d5168"></script></body>
</html>
@@ -0,0 +1,27 @@
const Fs = require("fs");
const Path = require("path");
const JsonBeautifully = require('json-beautifully');
class ChromeManifest {
constructor(options) {
this.options = options;
}
apply(compiler) {
compiler.plugin('done', function (compilation, callback) {
let manifest = this.options.manifest;
let outFile = this.options.outFile;
if (manifest && outFile) {
// JSON.stringify(require(manifest))
Fs.writeFileSync(outFile, JsonBeautifully(require(manifest)));
console.log(`\n生成manifest文件: ${outFile}`);
}
}.bind(this))
}
}
module.exports = ChromeManifest
+43 -46
View File
@@ -1,47 +1,44 @@
module.exports = {
"name": "Cocos Creator Inspector",
"version": "1.0.1",
"description": "Cocos Creator Inspector",
"browser_action": {
"default_title": "Cocos Creator Inspector",
"default_icon": "static/images/icon48.png",
"default_popup": "popup.html"
},
"icons": {
"48": "static/images/icon48.png"
},
"devtools_page": "dev.html",
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"contentScripts.main.js"
],
"run_at": "document_end"
}
],
"background": {
"scripts": [
"backgroundScripts.main.js"
]
},
"options_page": "index.html",
"manifest_version": 2,
"permissions": [
"tabs",
"http://*/*",
"https://*/*",
"*://*/*",
"system.cpu",
"tabs",
"storage",
"nativeMessaging"
],
"web_accessible_resources": [
"*/*",
"*"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
}
name: "Cocos Creator Inspector",
version: "1.0.1",
description: "Cocos Creator Inspector",
browser_action: {
default_title: "CC-Inspector",
default_icon: "static/images/icon48.png",
default_popup: "pages/popup.html"
},
icons: {
48: "static/images/icon48.png"
},
devtools_page: "pages/devtools.html",
content_scripts: [
{
matches: [
"<all_urls>"
],
js: [
"js/content.js"
],
run_at: "document_end"
}
],
background: {
scripts: [
"js/background.js"
]
},
options_page: "pages/options.html",
manifest_version: 2,
permissions: [
"tabs",
"http://*/*",
"https://*/*",
"*://*/*",
"system.cpu",
"tabs",
"storage",
"nativeMessaging"
],
web_accessible_resources: ["*/*", "*"],
content_security_policy: "script-src 'self' 'unsafe-eval'; object-src 'self'"
}
-48
View File
@@ -1,48 +0,0 @@
{
"name": "Cocos Creator Inspector",
"version": "1.0.1",
"description": "Cocos Creator Inspector",
"browser_action": {
"default_title": "Cocos Creator Inspector",
"default_icon": "static/images/icon48.png",
"default_popup": "popup.html"
},
"icons": {
"48": "static/images/icon48.png"
},
"devtools_page": "dev.html",
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"contentScripts.main.js"
],
"run_at": "document_end"
}
],
"background": {
"scripts": [
"backgroundScripts.main.js"
]
},
"options_page": "index.html",
"manifest_version": 2,
"permissions": [
"tabs",
"http://*/*",
"https://*/*",
"*://*/*",
"system.cpu",
"tabs",
"storage",
"nativeMessaging"
],
"web_accessible_resources": [
"*/*",
"*"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
}
@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>vue</title>
</head>
<body>
<div id="app">
</div>
</body>
</html>
+2 -2
View File
@@ -1,7 +1,7 @@
import Vue from 'vue';
import App from './App.vue';
import index from './index.vue';
new Vue({
el: '#app',
render: h => h(App)
render: h => h(index)
});
@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>
+15 -2
View File
@@ -3,6 +3,9 @@ let webpack = require('webpack');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let CleanWebpackPlugin = require('clean-webpack-plugin');
let CopyWebpackPlugin = require('copy-webpack-plugin');
let ChromeManifest = require("./core/chrome-manifest");
if (process.env.NODE_ENV === 'production') {
}
@@ -27,7 +30,12 @@ let htmlPage = function (title, filename, chunks, template) {
module.exports = {
entry: {
popup: resolve("popup"),
devtools:resolve("devtools"),
devtools: resolve("devtools"),
background: resolve("background"),
options: resolve('options'),
content:resolve("content"),
inject:resolve('content/inject')
// devInspector: path.resolve(__dirname, './src/dev/devInspector/main.js'),
// dev: path.resolve(__dirname, './src/dev/dev.js'),
// index: path.resolve(__dirname, './src/index/main.js'),
@@ -52,7 +60,12 @@ module.exports = {
htmlPage("popup", 'popup', ['popup']),
htmlPage("devtools", 'devtools', ['devtools']),
htmlPage("options", 'options', ['options']),
htmlPage('background', 'background', ['background']),
new ChromeManifest({
outFile: path.join(__dirname, "build/manifest.json"),
manifest: path.join(__dirname, "manifest.js")
}),
//index.html
// new HtmlWebpackPlugin({
// template: __dirname + "/src/index/index.html",