增加 simple-chrome-plugin-demo,修改原代码目录名称,修改自述文件。

This commit is contained in:
sxei 2019-01-14 11:32:47 +08:00 committed by xianan.lxa
parent 93fc19f93d
commit 93949165f8
28 changed files with 49 additions and 0 deletions

View File

@ -12,6 +12,12 @@ demo部分截图
![](http://image.liuxianan.com/201707/20170710_223150_516_6129.png) ![](http://image.liuxianan.com/201707/20170710_223150_516_6129.png)
## 仓库说明
* `full-chrome-plugin-demo`大部分demo代码都在这个仓库
* `simple-chrome-plugin-demo`最精简的Chrome仓库模板当需要快速写一个简单仓库时可以基于这个模板
* `page-action-demo`:关于`page-action`部分的demo代码由于这部分代码和`full-chrome-plugin-demo`冲突,所以单独拿出来;
# 前言 # 前言
## 什么是Chrome插件 ## 什么是Chrome插件

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -0,0 +1,3 @@
(function() {
console.log('这是 simple-chrome-plugin-demo 的content-script');
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View 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"
]
}

View 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>

View File

@ -0,0 +1 @@
console.log('你好我是popup');