diff --git a/README.md b/README.md index 4f37cee..44598a8 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ demo部分截图:  +## 仓库说明 + +* `full-chrome-plugin-demo`:大部分demo代码都在这个仓库; +* `simple-chrome-plugin-demo`:最精简的Chrome仓库模板,当需要快速写一个简单仓库时可以基于这个模板; +* `page-action-demo`:关于`page-action`部分的demo代码,由于这部分代码和`full-chrome-plugin-demo`冲突,所以单独拿出来; + # 前言 ## 什么是Chrome插件 diff --git a/demo/_locales/en/messages.json b/full-chrome-plugin-demo/_locales/en/messages.json similarity index 100% rename from demo/_locales/en/messages.json rename to full-chrome-plugin-demo/_locales/en/messages.json diff --git a/demo/_locales/zh_CN/messages.json b/full-chrome-plugin-demo/_locales/zh_CN/messages.json similarity index 100% rename from demo/_locales/zh_CN/messages.json rename to full-chrome-plugin-demo/_locales/zh_CN/messages.json diff --git a/demo/background.html b/full-chrome-plugin-demo/background.html similarity index 100% rename from demo/background.html rename to full-chrome-plugin-demo/background.html diff --git a/demo/css/custom.css b/full-chrome-plugin-demo/css/custom.css similarity index 100% rename from demo/css/custom.css rename to full-chrome-plugin-demo/css/custom.css diff --git a/demo/devtools.html b/full-chrome-plugin-demo/devtools.html similarity index 100% rename from demo/devtools.html rename to full-chrome-plugin-demo/devtools.html diff --git a/demo/img/icon.png b/full-chrome-plugin-demo/img/icon.png similarity index 100% rename from demo/img/icon.png rename to full-chrome-plugin-demo/img/icon.png diff --git a/demo/img/sds.png b/full-chrome-plugin-demo/img/sds.png similarity index 100% rename from demo/img/sds.png rename to full-chrome-plugin-demo/img/sds.png diff --git a/demo/js/background.js b/full-chrome-plugin-demo/js/background.js similarity index 100% rename from demo/js/background.js rename to full-chrome-plugin-demo/js/background.js diff --git a/demo/js/content-script.js b/full-chrome-plugin-demo/js/content-script.js similarity index 100% rename from demo/js/content-script.js rename to full-chrome-plugin-demo/js/content-script.js diff --git a/demo/js/devtools.js b/full-chrome-plugin-demo/js/devtools.js similarity index 100% rename from demo/js/devtools.js rename to full-chrome-plugin-demo/js/devtools.js diff --git a/demo/js/inject.js b/full-chrome-plugin-demo/js/inject.js similarity index 100% rename from demo/js/inject.js rename to full-chrome-plugin-demo/js/inject.js diff --git a/demo/js/jquery-1.8.3.js b/full-chrome-plugin-demo/js/jquery-1.8.3.js similarity index 100% rename from demo/js/jquery-1.8.3.js rename to full-chrome-plugin-demo/js/jquery-1.8.3.js diff --git a/demo/js/mypanel.js b/full-chrome-plugin-demo/js/mypanel.js similarity index 100% rename from demo/js/mypanel.js rename to full-chrome-plugin-demo/js/mypanel.js diff --git a/demo/js/options.js b/full-chrome-plugin-demo/js/options.js similarity index 100% rename from demo/js/options.js rename to full-chrome-plugin-demo/js/options.js diff --git a/demo/js/popup.js b/full-chrome-plugin-demo/js/popup.js similarity index 100% rename from demo/js/popup.js rename to full-chrome-plugin-demo/js/popup.js diff --git a/demo/js/show-image-content-size.js b/full-chrome-plugin-demo/js/show-image-content-size.js similarity index 100% rename from demo/js/show-image-content-size.js rename to full-chrome-plugin-demo/js/show-image-content-size.js diff --git a/demo/manifest.json b/full-chrome-plugin-demo/manifest.json similarity index 100% rename from demo/manifest.json rename to full-chrome-plugin-demo/manifest.json diff --git a/demo/mypanel.html b/full-chrome-plugin-demo/mypanel.html similarity index 100% rename from demo/mypanel.html rename to full-chrome-plugin-demo/mypanel.html diff --git a/demo/newtab.html b/full-chrome-plugin-demo/newtab.html similarity index 100% rename from demo/newtab.html rename to full-chrome-plugin-demo/newtab.html diff --git a/demo/options.html b/full-chrome-plugin-demo/options.html similarity index 100% rename from demo/options.html rename to full-chrome-plugin-demo/options.html diff --git a/demo/popup.html b/full-chrome-plugin-demo/popup.html similarity index 100% rename from demo/popup.html rename to full-chrome-plugin-demo/popup.html diff --git a/demo/sidebar.html b/full-chrome-plugin-demo/sidebar.html similarity index 100% rename from demo/sidebar.html rename to full-chrome-plugin-demo/sidebar.html diff --git a/simple-chrome-plugin-demo/content-script.js b/simple-chrome-plugin-demo/content-script.js new file mode 100755 index 0000000..8521d7c --- /dev/null +++ b/simple-chrome-plugin-demo/content-script.js @@ -0,0 +1,3 @@ +(function() { + console.log('这是 simple-chrome-plugin-demo 的content-script!'); +})(); \ No newline at end of file diff --git a/simple-chrome-plugin-demo/icon.png b/simple-chrome-plugin-demo/icon.png new file mode 100755 index 0000000..c41ae2f Binary files /dev/null and b/simple-chrome-plugin-demo/icon.png differ diff --git a/simple-chrome-plugin-demo/manifest.json b/simple-chrome-plugin-demo/manifest.json new file mode 100755 index 0000000..589305c --- /dev/null +++ b/simple-chrome-plugin-demo/manifest.json @@ -0,0 +1,28 @@ +{ + "manifest_version": 2, + "name": "Chrome插件demo", + "version": "1.0", + "description": "最简单的Chrome插件demo,需要快速做一个简单的插件时可以基于这个仓库开发", + "author": "sxei", + "icons": + { + "48": "icon.png", + "128": "icon.png" + }, + "browser_action": + { + "default_icon": "icon.png", + "default_popup": "popup.html" + }, + "content_scripts": + [ + { + "matches": ["https://www.baidu.com/*"], + "js": ["content-script.js"] + } + ], + "web_accessible_resources": + [ + "inject.js" + ] +} \ No newline at end of file diff --git a/simple-chrome-plugin-demo/popup.html b/simple-chrome-plugin-demo/popup.html new file mode 100755 index 0000000..f0628ca --- /dev/null +++ b/simple-chrome-plugin-demo/popup.html @@ -0,0 +1,11 @@ + + +
+ +