-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmanifest.libsonnet
50 lines (48 loc) · 1.3 KB
/
manifest.libsonnet
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
local manifest_common = import 'manifest_common.libsonnet';
{
new(
name,
keyword,
description,
version
):: (
manifest_common.new(name, keyword, description, version)
) {
local it = self,
_background_scripts:: [
'core/compat.js',
'core/omnibox.js',
'core/query-event.js',
'core/storage.js',
'core/command/base.js',
'core/command/simple.js',
'core/command/open.js',
'core/command/history.js',
'core/command/manager.js',
],
_browser_action:: {},
manifest_version: 2,
browser_action: it._browser_action,
content_security_policy: "script-src 'self'; object-src 'self';",
background: {
scripts: it._background_scripts,
},
web_accessible_resources: [],
appendContentSecurityPolicy(policy):: self + {
content_security_policy+: policy,
},
addWebAccessibleResources(resource):: self + {
web_accessible_resources+: if std.isArray(resource) then resource else [resource],
},
addBackgroundScripts(script):: self + {
_background_scripts+: if std.isArray(script) then script else [script],
},
addBrowserAction(popup, title):: self + {
_browser_action+: {
default_icon: it._icons,
default_popup: popup,
default_title: title,
},
},
},
}