mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-13 21:51:03 +00:00
no message
This commit is contained in:
parent
9579ed24d2
commit
796d7071ce
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.idea
|
.idea
|
||||||
|
CocosCreatorInspector/src/build
|
||||||
|
5
CocosCreatorInspector/package-lock.json
generated
5
CocosCreatorInspector/package-lock.json
generated
@ -5203,6 +5203,11 @@
|
|||||||
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
|
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"json-beautifully": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/json-beautifully/-/json-beautifully-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-aD3uL3qr5y29B8w6cdmsoXaX3zp53ulWjgVQUgGwLmpAoXaB9jIeHYmpOLA9vRMvrIlfG6MQ7OArYKPS0SwMmw=="
|
||||||
|
},
|
||||||
"json-loader": {
|
"json-loader": {
|
||||||
"version": "0.5.7",
|
"version": "0.5.7",
|
||||||
"resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz",
|
"resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz",
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
"dev-popup": "cross-env NODE_ENV=development webpack-dev-server --open http://localhost:8083/popup.html --inline --progress --hot --port 8083",
|
"dev-popup": "cross-env NODE_ENV=development webpack-dev-server --open http://localhost:8083/popup.html --inline --progress --hot --port 8083",
|
||||||
"dev-inspector": "cross-env NODE_ENV=development webpack-dev-server --open http://localhost:8084/devInspector.html --inline --progress --hot --port 8084",
|
"dev-inspector": "cross-env NODE_ENV=development webpack-dev-server --open http://localhost:8084/devInspector.html --inline --progress --hot --port 8084",
|
||||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
||||||
|
"build-new": "webpack --config ./src/webpack.config.js --hide-modules --progress"
|
||||||
"build2": "webpack --config ./src/webpack.config.js --progress"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"fs-extra": "^5.0.0",
|
"fs-extra": "^5.0.0",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-shell": "^0.6.5",
|
"gulp-shell": "^0.6.5",
|
||||||
|
"json-beautifully": "^1.0.3",
|
||||||
"node-sass": "^4.7.2",
|
"node-sass": "^4.7.2",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"sass-loader": "^6.0.6",
|
"sass-loader": "^6.0.6",
|
||||||
|
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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<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>
|
</html>
|
||||||
|
0
CocosCreatorInspector/src/content/index.js
Normal file
0
CocosCreatorInspector/src/content/index.js
Normal file
27
CocosCreatorInspector/src/core/chrome-manifest.js
Normal file
27
CocosCreatorInspector/src/core/chrome-manifest.js
Normal file
@ -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
|
0
CocosCreatorInspector/src/devtools/index.js
Normal file
0
CocosCreatorInspector/src/devtools/index.js
Normal file
@ -1,47 +1,44 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
"name": "Cocos Creator Inspector",
|
name: "Cocos Creator Inspector",
|
||||||
"version": "1.0.1",
|
version: "1.0.1",
|
||||||
"description": "Cocos Creator Inspector",
|
description: "Cocos Creator Inspector",
|
||||||
"browser_action": {
|
browser_action: {
|
||||||
"default_title": "Cocos Creator Inspector",
|
default_title: "CC-Inspector",
|
||||||
"default_icon": "static/images/icon48.png",
|
default_icon: "static/images/icon48.png",
|
||||||
"default_popup": "popup.html"
|
default_popup: "pages/popup.html"
|
||||||
},
|
},
|
||||||
"icons": {
|
icons: {
|
||||||
"48": "static/images/icon48.png"
|
48: "static/images/icon48.png"
|
||||||
},
|
},
|
||||||
"devtools_page": "dev.html",
|
devtools_page: "pages/devtools.html",
|
||||||
"content_scripts": [
|
content_scripts: [
|
||||||
{
|
{
|
||||||
"matches": [
|
matches: [
|
||||||
"<all_urls>"
|
"<all_urls>"
|
||||||
],
|
],
|
||||||
"js": [
|
js: [
|
||||||
"contentScripts.main.js"
|
"js/content.js"
|
||||||
],
|
],
|
||||||
"run_at": "document_end"
|
run_at: "document_end"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"background": {
|
background: {
|
||||||
"scripts": [
|
scripts: [
|
||||||
"backgroundScripts.main.js"
|
"js/background.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"options_page": "index.html",
|
options_page: "pages/options.html",
|
||||||
"manifest_version": 2,
|
manifest_version: 2,
|
||||||
"permissions": [
|
permissions: [
|
||||||
"tabs",
|
"tabs",
|
||||||
"http://*/*",
|
"http://*/*",
|
||||||
"https://*/*",
|
"https://*/*",
|
||||||
"*://*/*",
|
"*://*/*",
|
||||||
"system.cpu",
|
"system.cpu",
|
||||||
"tabs",
|
"tabs",
|
||||||
"storage",
|
"storage",
|
||||||
"nativeMessaging"
|
"nativeMessaging"
|
||||||
],
|
],
|
||||||
"web_accessible_resources": [
|
web_accessible_resources: ["*/*", "*"],
|
||||||
"*/*",
|
content_security_policy: "script-src 'self' 'unsafe-eval'; object-src 'self'"
|
||||||
"*"
|
}
|
||||||
],
|
|
||||||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
|
|
||||||
}
|
|
||||||
|
@ -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>
|
|
@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import App from './App.vue';
|
import index from './index.vue';
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
render: h => h(App)
|
render: h => h(index)
|
||||||
});
|
});
|
||||||
|
13
CocosCreatorInspector/src/options/index.vue
Normal file
13
CocosCreatorInspector/src/options/index.vue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "index"
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -3,6 +3,9 @@ let webpack = require('webpack');
|
|||||||
let HtmlWebpackPlugin = require('html-webpack-plugin');
|
let HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
let CleanWebpackPlugin = require('clean-webpack-plugin');
|
let CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||||
let CopyWebpackPlugin = require('copy-webpack-plugin');
|
let CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
|
|
||||||
|
let ChromeManifest = require("./core/chrome-manifest");
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -27,7 +30,12 @@ let htmlPage = function (title, filename, chunks, template) {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
popup: resolve("popup"),
|
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'),
|
// devInspector: path.resolve(__dirname, './src/dev/devInspector/main.js'),
|
||||||
// dev: path.resolve(__dirname, './src/dev/dev.js'),
|
// dev: path.resolve(__dirname, './src/dev/dev.js'),
|
||||||
// index: path.resolve(__dirname, './src/index/main.js'),
|
// index: path.resolve(__dirname, './src/index/main.js'),
|
||||||
@ -52,7 +60,12 @@ module.exports = {
|
|||||||
|
|
||||||
htmlPage("popup", 'popup', ['popup']),
|
htmlPage("popup", 'popup', ['popup']),
|
||||||
htmlPage("devtools", 'devtools', ['devtools']),
|
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
|
//index.html
|
||||||
// new HtmlWebpackPlugin({
|
// new HtmlWebpackPlugin({
|
||||||
// template: __dirname + "/src/index/index.html",
|
// template: __dirname + "/src/index/index.html",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user