mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-12 21:21:02 +00:00
no message
This commit is contained in:
parent
9579ed24d2
commit
796d7071ce
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.idea
|
||||
CocosCreatorInspector/src/build
|
||||
|
5
CocosCreatorInspector/package-lock.json
generated
5
CocosCreatorInspector/package-lock.json
generated
@ -5203,6 +5203,11 @@
|
||||
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
|
||||
"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": {
|
||||
"version": "0.5.7",
|
||||
"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-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",
|
||||
|
||||
"build2": "webpack --config ./src/webpack.config.js --progress"
|
||||
"build-new": "webpack --config ./src/webpack.config.js --hide-modules --progress"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs": "0.0.1-security",
|
||||
"fs-extra": "^5.0.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-shell": "^0.6.5",
|
||||
"json-beautifully": "^1.0.3",
|
||||
"node-sass": "^4.7.2",
|
||||
"path": "^0.12.7",
|
||||
"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>
|
||||
<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
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 = {
|
||||
"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'"
|
||||
}
|
||||
|
@ -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 App from './App.vue';
|
||||
import index from './index.vue';
|
||||
|
||||
new Vue({
|
||||
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 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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user