增加 simple-chrome-plugin-demo,修改原代码目录名称,修改自述文件。
This commit is contained in:
parent
93fc19f93d
commit
93949165f8
@ -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插件
|
## 什么是Chrome插件
|
||||||
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
3
simple-chrome-plugin-demo/content-script.js
Executable file
3
simple-chrome-plugin-demo/content-script.js
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
(function() {
|
||||||
|
console.log('这是 simple-chrome-plugin-demo 的content-script!');
|
||||||
|
})();
|
BIN
simple-chrome-plugin-demo/icon.png
Executable file
BIN
simple-chrome-plugin-demo/icon.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
28
simple-chrome-plugin-demo/manifest.json
Executable file
28
simple-chrome-plugin-demo/manifest.json
Executable file
@ -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"
|
||||||
|
]
|
||||||
|
}
|
11
simple-chrome-plugin-demo/popup.html
Executable file
11
simple-chrome-plugin-demo/popup.html
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<title>popup</title>
|
||||||
|
</head>
|
||||||
|
<body style="width:500px;min-height:100px;">
|
||||||
|
这里是popup。
|
||||||
|
<script type="text/javascript" src="js/popup.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
1
simple-chrome-plugin-demo/popup.js
Executable file
1
simple-chrome-plugin-demo/popup.js
Executable file
@ -0,0 +1 @@
|
|||||||
|
console.log('你好,我是popup!');
|
Loading…
Reference in New Issue
Block a user