67 lines
1.9 KiB
JSON
67 lines
1.9 KiB
JSON
{
|
||
// 清单文件的版本,这个必须写,而且必须是2
|
||
"manifest_version": 2,
|
||
// 插件的名称
|
||
"name": "demo",
|
||
// 插件的版本
|
||
"version": "1.0.0",
|
||
// 插件描述
|
||
"description": "简单的Chrome扩展demo",
|
||
// 图标,一般偷懒全部用一个尺寸的也没问题
|
||
"icons":
|
||
{
|
||
"16": "img/icon.png",
|
||
"48": "img/icon.png",
|
||
"128": "img/icon.png"
|
||
},
|
||
// 后台JS
|
||
"background":
|
||
{
|
||
"scripts": ["js/background.js"]
|
||
},
|
||
// 浏览器右上角图标设置,browser_action、page_action、app必须三选一
|
||
"browser_action":
|
||
{
|
||
"default_icon": "img/icon.png",
|
||
// 图标悬停时的标题,可选
|
||
"default_title": "这是一个示例Chrome插件",
|
||
"default_popup": "popup.html"
|
||
},
|
||
// 当某些特定页面打开才显示的图标
|
||
/*"page_action":
|
||
{
|
||
"default_icon": "img/icon.png",
|
||
"default_title": "我是pageAction",
|
||
"default_popup": "popup.html"
|
||
},*/
|
||
// 需要直接注入页面的JS
|
||
"content_scripts":
|
||
[
|
||
{
|
||
"matches": ["http://*/*", "https://*/*"],
|
||
"js": ["js/jquery-1.8.3.js", "js/content-script.js"],
|
||
"css": [],
|
||
// 代码注入的时间,可选值: "document_start", "document_end", or "document_idle",最后一个表示页面空闲时,默认document_idle
|
||
"run_at": "document_start"
|
||
}
|
||
],
|
||
// 权限申请
|
||
"permissions":
|
||
[
|
||
"contextMenus", // 右键菜单
|
||
"tabs", // 标签
|
||
"notifications", // 通知
|
||
"http://*/*", // 可以通过executeScript或者insertCSS访问的网站
|
||
"https://*/*" // 可以通过executeScript或者insertCSS访问的网站
|
||
],
|
||
// 插件主页,这个很重要,不要浪费了这个免费广告位
|
||
"homepage_url": "https://www.baidu.com",
|
||
// 覆盖浏览器默认页面
|
||
"chrome_url_overrides":
|
||
{
|
||
// 覆盖浏览器默认的新标签页
|
||
"newtab": "newtab.html"
|
||
},
|
||
// devtools页面入口,注意只能指向一个HTML文件,不能是JS文件
|
||
"devtools_page": "devtools.html"
|
||
} |