forked from w3c/webextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.bs
142 lines (85 loc) · 4.14 KB
/
index.bs
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<pre class='metadata'>
Title: Web Extensions
Shortname: webextensions
Level: 1
Status: w3c/CG-DRAFT
Group: WECG
URL: https://w3c.github.io/webextensions
Editor: Mukul Purohit, Microsoft Corporation https://www.microsoft.com, [email protected]
Editor: Tomislav Jovanovic, Mozilla https://www.mozilla.org/, [email protected]
Abstract: [Placeholder] Abstract.
Markup Shorthands: markdown yes
</pre>
# File structure
Once unpacked from the distribution format, a WebExtension is a directory containing a number of files.
Note: In some operating systems, filenames are case insensitive. This can lead to naming collisions.
## manifest.json
A <a href="#manifest">Manifest</a> file.
## _locales subdirectory
An optional directory containing strings as defined in <a href="#localization">localization</a>.
## Other files
An extension may also contain other files, such as those referenced in the <a href="#key-content_scripts">content_scripts</a> and <a href="#key-background">background</a> part of the <a href="#manifest">Manifest</a>.
# Manifest
A WebExtension must have a manifest file at its root directory.
## Manifest file
A manifest file is a [[!JSON]] document named `manifest.json`. Malformed JSON files are not supported.
## Manifest keys
If manifest keys that are not defined in this specification are specified, implementors must ignore those keys.
If manifest keys that are defined in this specification are specified with a different JSON type than defined in this specification, implementors must ignore those keys.
The following keys must be considered valid:
* <a href="#key-manifest_version">`manifest_version`</a>: required.
* <a href="#key-name">`name`</a>: required.
* <a href="#key-version">`version`</a>: required.
* <a href="#key-default_locale">`default_locale`</a>: required under some conditions.
* <a href="#key-background">`background`</a>: optional
* <a href="#key-commands">`commands`</a>: optional
* <a href="#key-content_scripts">`content_scripts`</a>: optional
* <a href="#key-content_security_policy">`content_security_policy`</a>: optional
* <a href="#key-description">`description`</a>: optional
* <a href="#key-icons">`icons`</a>: optional
* <a href="#key-optional_permissions">`optional_permissions`</a>: optional
* <a href="#key-options_ui">`options_ui`</a>: optional
* <a href="#key-permissions">`permissions`</a>: optional
* <a href="#key-short_name">`short_name`</a>: optional
* <a href="#key-web_accessible_resources">`web_accessible_resources`</a>: optional
* <a href="#key-devtools_page">`devtools_page`</a>: optional
* <a href="#key-externally_connectable">`externally_connectable`</a>: optional
### Key `manifest_version`
This key must be present.
### Key `name`
Name of the extension used in the browser’s user interface. This should be the full name used to identify the extension. See also <a href="#key-short_name">`short_name`</a>.
This key must be present. This property can be localized.
### Key `version`
This key must be present.
### Key `default_locale`
This key must be present if the `_locales` subdirectory is present, must be absent otherwise.
### Key `background`
This key may be present.
### Key `commands`
This key may be present.
### Key `content_scripts`
This key may be present.
### Key `content_security_policy`
This key may be present.
### Key `description`
This key may be present.
### Key `icons`
This key may be present.
### Key `optional_permissions`
This key may be present.
### Key `options_ui`
This key may be present.
### Key `permissions`
This key may be present.
### Key `short_name`
The short name of the extension. This value should be used in contexts where <a href="#key-name">`name`</a> is too long to use in full. If `short_name` is not provided, manifest consumers should use a truncated version of `name`.
This key may be present. This property can be localized.
### Key `web_accessible_resources`
This key may be present.
### Key `externally_connectable`
This key may be present.
### Key `devtools_page`
This key may be present.
# Localization
The _locales subdirectory of a WebExtension can contain strings for internationalization purposes.
Issue(62): Specify localization handling.