-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanifest.json
56 lines (55 loc) · 1.66 KB
/
manifest.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
"manifest_version": 3,
// 插件的名称
"name": "DLSiteHelper",
// 插件的版本
"version": "1.0.1",
// 插件描述
"description": "DLSiteHelper",
// 图标,一般偷懒全部用一个尺寸的也没问题
"icons": {
"16": "asset/icon.png",
"48": "asset/icon.png",
"128": "asset/icon.png"
},
// 会一直常驻的后台JS或后台页面
"background": {
"service_worker": "background.js",
"type": "module"
},
// 需要直接注入页面的JS
"content_scripts": [
{
//"matches": ["http://*/*", "https://*/*"],
// "<all_urls>" 表示匹配所有地址
"matches": [ "http://*.dlsite.com/*", "https://*.dlsite.com/*" ],
// 多个JS按顺序注入
"js": [ "js/jquery-1.8.3.js", "js/content-script.js" ],
"css": [ "css/custom.css" ],
// 代码注入的时间,可选值: "document_start", "document_end", or "document_idle",最后一个表示页面空闲时,默认document_idle
"run_at": "document_start"
}
],
// 权限申请
"permissions": [
"cookies",
"contextMenus", // 右键菜单
"tabs", // 标签
"webRequest", // web请求
"storage",// 插件本地存储
"scripting", //keepalive
"declarativeNetRequest"//webblockrequest
],
"host_permissions": [
"<all_urls>"
],
// 普通页面能够直接访问的插件资源列表,如果不设置是无法直接访问的
"web_accessible_resources": [
{
"resources": [ "js/inject.js","js/content-script.js" ],
"matches": [ "<all_urls>" ]
}
],
// 向地址栏注册一个关键字以提供搜索建议,只能设置一个关键字
"omnibox": { "keyword": "go" }
}