@schemastore/webextension 0.0.5 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +3 -1
  3. package/index.d.ts +1083 -365
  4. package/package.json +5 -9
package/index.d.ts CHANGED
@@ -1,234 +1,110 @@
1
- /* tslint:disable */
1
+ /* eslint-disable */
2
+
2
3
  /**
3
- * This file was automatically generated by json-schema-to-typescript.
4
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
- * and run json-schema-to-typescript to regenerate this file.
4
+ * There are two valid formats for shortcut keys: as a key combination or as a media key.
5
+ *
6
+ * Key combinations must consist of 2 or 3 keys (<modifier>+[<secondary_modifier>]+<key>), e.g.: "Ctrl+Shift+Z"
7
+ *
8
+ * If a key combination is already used by the browser (like "Ctrl+P") or by an existing add-on, then you can't override it. You can define it, but your event handler will not be called when the user presses the key combination.
9
+ *
10
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values
6
11
  */
7
-
8
- export type Icon =
9
- | string
10
- | {
11
- [k: string]: any;
12
- };
12
+ export type CommandShortcut = string;
13
13
  export type MatchPattern = string;
14
- export type GlobPattern = string;
15
14
  /**
16
- * This introduces some fairly strict policies that will make extensions more secure by default, and provides you with the ability to create and enforce rules governing the types of content that can be loaded and executed by your extensions and applications.
15
+ * An array of paths, relative to manifest.json, referencing JavaScript files that will be injected into matching pages.<br>Files are injected in the order given. This means that, injected scripts cab utilize scripts included prior to them.<br>The files are injected after any files in `css`, and at the time specified by `run_at`.
17
16
  */
18
- export type ContentSecurityPolicy = string;
19
-
20
- export interface JSONSchemaForWebExtensionsManifestFiles {
17
+ export type Scripts = string[];
18
+ export type GlobPattern = string;
19
+ export type MatchPatternStrict = string;
20
+ export type Icon = {
21
21
  /**
22
- * The applications key contains keys that are specific to a particular host application.
22
+ * This interface was referenced by `undefined`'s JSON-Schema definition
23
+ * via the `patternProperty` "^[1-9]\d+$".
24
+ *
25
+ * This interface was referenced by `undefined`'s JSON-Schema definition
26
+ * via the `patternProperty` "^[1-9]\d+$".
23
27
  */
24
- applications?: {
25
- gecko?: {
26
- /**
27
- * id is the extension ID
28
- */
29
- id?: string;
30
- /**
31
- * Minimum version of Gecko to support. Defaults to '42a1'. (Requires Gecko 45)
32
- */
33
- strict_min_version?: string;
34
- /**
35
- * Maximum version of Gecko to support. Defaults to '*'. (Requires Gecko 45)
36
- */
37
- strict_max_version?: string;
28
+ [k: string]: string;
29
+ } & Icon1;
30
+ export type Icon1 =
31
+ | string
32
+ | {
38
33
  /**
39
- * Link to an add-on update manifest. (Requires Gecko 45)
34
+ * This interface was referenced by `undefined`'s JSON-Schema definition
35
+ * via the `patternProperty` "^[1-9]\d+$".
36
+ *
37
+ * This interface was referenced by `undefined`'s JSON-Schema definition
38
+ * via the `patternProperty` "^[1-9]\d+$".
40
39
  */
41
- update_url?: string;
42
- [k: string]: any;
40
+ [k: string]: string;
43
41
  };
44
- [k: string]: any;
45
- };
42
+ /**
43
+ * Sometimes you want to package resources—for example, images, HTML, CSS, or JavaScript—with your extension and make them available to web pages and other extensions.
44
+ *
45
+ * With the web_accessible_resources key, you list all the packaged resources that you want to make available to web pages. You specify them as paths relative to the manifest.json file.
46
+ *
47
+ * Note that content scripts don't need to be listed as web accessible resources.
48
+ *
49
+ * If an extension wants to use webRequest or declarativeNetRequest to redirect a public URL (e.g., HTTPS) to a page that's packaged in the extension, then the extension must list the page in the web_accessible_resources key.
50
+ *
51
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/web_accessible_resources
52
+ */
53
+ export type Scripts1 = string[];
54
+
55
+ /**
56
+ * The manifest.json file is the only file that every extension using WebExtension APIs must contain.
57
+ *
58
+ * Using manifest.json, you specify basic metadata about your extension such as the name and version, and can also specify aspects of your extension's functionality (such as background scripts, content scripts, and browser actions).
59
+ *
60
+ * It is a JSON-formatted file, with one exception: it is allowed to contain "//"-style comments.
61
+ *
62
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json
63
+ */
64
+ export interface JSONSchemaForWebExtensionsManifestFiles {
46
65
  /**
47
- * "The extension's author, intended for display in the browser's user interface. If the developer key is supplied and it contains the "name" property, it will override the author key. There's no way to specify multiple authors."
66
+ * The extension's author, intended for display in the browser's user interface. If the developer key is supplied and it contains the "name`" property, it will override the author key. There's no way to specify multiple authors.
67
+ *
68
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/author
48
69
  */
49
70
  author?: string;
71
+ background?: BackgroundScriptInclusions;
72
+ browser_specific_settings?: BrowserSpecificSettings;
73
+ chrome_settings_overrides?: BrowserHomePage;
74
+ chrome_url_overrides?: CustomSpecialPages;
75
+ commands?: KeyboardShortcuts;
50
76
  /**
51
- * The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.
77
+ * Instructs the browser to load content scripts into web pages whose URL matches a given pattern.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts
78
+ *
79
+ * @minItems 1
52
80
  */
53
- background?: {
54
- /**
55
- * When false, makes the background page an event page (loaded only when needed).
56
- */
57
- persistent?: boolean;
58
- /**
59
- * Specify the HTML of the background page.
60
- */
61
- page?: string;
62
- /**
63
- * A background page will be generated by the extension system that includes each of the files listed in the scripts property.
64
- */
65
- scripts?: string[];
66
- [k: string]: any;
67
- };
68
- /**
69
- * browser action is a button that your extension adds to the browser's toolbar. The button has an icon, and may optionally have a popup whose content is specified using HTML, CSS, and JavaScript.
70
- */
71
- browser_action?: {
72
- /**
73
- * Use this to include a stylesheet in your popup that will make it look consistent with the browser's UI and with other add-ons that use the browser_style property. Although this key defaults to false, it's recommended that you include it and set it to true.
74
- */
75
- browser_style?: boolean;
76
- default_icon?: Icon;
77
- /**
78
- * The popup appears when the user clicks the icon.
79
- */
80
- default_popup?: string;
81
- /**
82
- * Tooltip for the main toolbar icon.
83
- */
84
- default_title?: string;
85
- [k: string]: any;
86
- };
87
- /**
88
- * Use the chrome_settings_overrides key to override certain browser settings
89
- */
90
- chrome_settings_overrides?: {
91
- /**
92
- * Defines the page to be used as the browser's homepage.
93
- */
94
- homepage?: string;
95
- [k: string]: any;
96
- };
97
- /**
98
- * Use the chrome_url_overrides key to provide a custom replacement for the documents loaded into various special pages usually provided by the browser itself.
99
- */
100
- chrome_url_overrides?: {
101
- /**
102
- * Provide a replacement for the page that shows the bookmarks.
103
- */
104
- bookmarks?: string;
105
- /**
106
- * Provide a replacement for the page that shows the browsing history.
107
- */
108
- history?: string;
109
- /**
110
- * Provide a replacement for the document that's shown in the "new tab" page
111
- */
112
- newtab?: string;
113
- [k: string]: any;
114
- };
115
- /**
116
- * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.
117
- */
118
- commands?: {
119
- _execute_browser_action?: Command;
120
- _execute_page_action?: Command;
121
- _execute_sidebar_action?: Command;
122
- [k: string]: Command;
123
- };
81
+ content_scripts?: [ContentScript, ...ContentScript[]];
124
82
  /**
125
- * Content scripts are JavaScript files that run in the context of web pages.
83
+ * Extensions have a content security policy (CSP) applied to them by default. The default policy restricts the sources from which extensions can load code (such as <script> resources) and disallows potentially unsafe practices such as the use of eval().<br>You can use this key to loosen or tighten the default policy. This key is specified in the same way as the Content-Security-Policy HTTP header.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_security_policy
126
84
  */
127
- content_scripts?: [
128
- {
129
- /**
130
- * Specifies which pages this content script will be injected into.
131
- */
132
- matches: [MatchPattern, ...(MatchPattern)[]];
133
- /**
134
- * Excludes pages that this content script would otherwise be injected into.
135
- */
136
- exclude_matches?: MatchPattern[];
137
- /**
138
- * The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.
139
- */
140
- css?: string[];
141
- /**
142
- * The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.
143
- */
144
- js?: string[];
145
- /**
146
- * Controls when the files in js are injected.
147
- */
148
- run_at?: "document_start" | "document_end" | "document_idle";
149
- /**
150
- * Controls whether the content script runs in all frames of the matching page, or only the top frame.
151
- */
152
- all_frames?: boolean;
153
- /**
154
- * Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword.
155
- */
156
- include_globs?: GlobPattern[];
157
- /**
158
- * Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword.
159
- */
160
- exclude_globs?: GlobPattern[];
161
- /**
162
- * Whether to insert the content script on about:blank and about:srcdoc.
163
- */
164
- match_about_blank?: boolean;
165
- },
166
- ...({
167
- /**
168
- * Specifies which pages this content script will be injected into.
169
- */
170
- matches: [MatchPattern, ...(MatchPattern)[]];
171
- /**
172
- * Excludes pages that this content script would otherwise be injected into.
173
- */
174
- exclude_matches?: MatchPattern[];
175
- /**
176
- * The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.
177
- */
178
- css?: string[];
179
- /**
180
- * The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.
181
- */
182
- js?: string[];
183
- /**
184
- * Controls when the files in js are injected.
185
- */
186
- run_at?: "document_start" | "document_end" | "document_idle";
187
- /**
188
- * Controls whether the content script runs in all frames of the matching page, or only the top frame.
189
- */
190
- all_frames?: boolean;
191
- /**
192
- * Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword.
193
- */
194
- include_globs?: GlobPattern[];
195
- /**
196
- * Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword.
197
- */
198
- exclude_globs?: GlobPattern[];
199
- /**
200
- * Whether to insert the content script on about:blank and about:srcdoc.
201
- */
202
- match_about_blank?: boolean;
203
- })[]
204
- ];
205
- content_security_policy?: ContentSecurityPolicy;
85
+ content_security_policy?: string;
86
+ declarative_net_request?: DeclarativeNetRequestRulesets;
206
87
  /**
207
- * Specifies the subdirectory of _locales that contains the default strings for this extension.
88
+ * This key must be present if the extension contains the _locales directory, and must be absent otherwise. It identifies a subdirectory of _locales, and this subdirectory will be used to find the default strings for your extension.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/default_locale
208
89
  */
209
90
  default_locale?: string;
210
91
  /**
211
- * A plain text description of the extension
92
+ * A short description of the extension, intended for display in the browser's user interface. In Firefox and Chrome this value can be up to 132 characters. The limit in other browsers may differ.<br>This is a localizable property.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/description
212
93
  */
213
94
  description?: string;
95
+ developer?: DeveloperInformation;
214
96
  /**
215
- * The name of the extension's developer and their homepage URL, intended for display in the browser's user interface.
216
- */
217
- developer?: {
218
- name?: string;
219
- url?: string;
220
- [k: string]: any;
221
- };
222
- /**
223
- * A DevTools extension adds functionality to the Chrome DevTools. It can add new UI panels and sidebars, interact with the inspected page, get information about network requests, and more.
97
+ * Use this key to enable your extension to extend the browser's built-in devtools.<br>This key is defined as a URL to an HTML file. The HTML file must be bundled with the extension, and the URL is relative to the extension's root.<br>The use of this manifest key triggers an install-time permission warning about devtools. To avoid an install-time permission warning, mark the feature as optional by listing the "devtools" permission in the optional_permissions manifest key.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page
224
98
  */
225
99
  devtools_page?: string;
100
+ dictionaries?: Localization;
101
+ externally_connectable?: ExternalExtensionAPI;
226
102
  /**
227
- * The URL of the homepage for this add-on. The add-on management page will contain a link to this URL.
103
+ * URL for the extension's home page.<br>If a developer key containing the "url" property and "homepage_url" are defined, Firefox uses "developer.url" while Opera uses "homepage_url". Chrome and Safari do not support the "developer" key.<br>This is a localizable property.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/homepage_url
228
104
  */
229
105
  homepage_url?: string;
230
106
  /**
231
- * One or more icons that represent the extension, app, or theme. Recommended format: PNG; also BMP, GIF, ICO, JPEG.
107
+ * The icons key specifies icons for your extension. Those icons will be used to represent the extension in components such as the Add-ons Manager.<br>It consists of key-value pairs of image size in px and image path relative to the root directory of the extension.<br>If icons is not supplied, a standard extension icon will be used by default.<br>You should supply at least a main extension icon, ideally 48x48 px in size. This is the default icon that will be used in the Add-ons Manager.<br>You can use SVG and the browser will scale your icon appropriately. There are currently two caveats though.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/icons
232
108
  */
233
109
  icons?: {
234
110
  /**
@@ -238,204 +114,1046 @@ export interface JSONSchemaForWebExtensionsManifestFiles {
238
114
  [k: string]: string;
239
115
  };
240
116
  /**
241
- * Specify how this extension will behave if allowed to run in incognito mode.
117
+ * Use the incognito key to control how the extension works with private browsing windows.<br><br>Note: By default, extensions do not run in private browsing windows. Whether an extension can access private browsing windows is under user control. For details, see Extensions in Private Browsing. Your extension can check whether it can access private browsing windows using extension.isAllowedIncognitoAccess.<br><br>This is a string that can take any of these values:<br>"spanning" (the default): the extension will see events from private and non-private windows and tabs. Windows and tabs will get an incognito property in the `Window` or `Tab` that represents them. This property indicates whether or not the object is private<br>"split": the extension will be split between private and non-private windows. There are effectively two copies of the extension running: one sees only non-private windows, the other sees only private windows. Each copy has isolated access to Web APIs (so, for example, localStorage is not shared). However, the WebExtension API storage.local is shared. (Note: this setting is not supported by Firefox.)<br>"not_allowed": private tabs and windows are invisible to the extension.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/incognito
242
118
  */
243
- incognito?: "spanning" | "split" | "not_allowed";
119
+ incognito?: 'spanning' | 'split' | 'not_allowed';
244
120
  /**
245
- * One integer specifying the version of the manifest file format your package requires.
121
+ * This key specifies the version of manifest.json used by this extension.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/manifest_version
246
122
  */
247
- manifest_version: 2;
123
+ manifest_version: 2 | 3;
248
124
  /**
249
- * The name of the extension
125
+ * Name of the extension. This is used to identify the extension in the browser's user interface and on sites like addons.mozilla.org.<br>It's good practice to keep the name short enough to display in the UI. Also, the length of the name of a published extension may be limited.<br>These restrictions do not apply to self-hosted extensions or extensions distributed outside the stores.<br>This is a localizable property.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/name
250
126
  */
251
127
  name: string;
252
128
  /**
253
- * The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.
129
+ * Whether the app or extension is expected to work offline. When Chrome detects that it is offline, apps with this field set to true will be highlighted on the New Tab page.
130
+ *
131
+ * As of Chrome 35, apps (ChromeOS only from 2018) are assumed to be offline enabled and the default value of "offline_enabled" is true unless "webview" permission is requested. In this case, network connectivity is assumed to be required and "offline_enabled" defaults to false.
132
+ *
133
+ * The "offline_enabled" value is also used to determine whether a network connectivity check will be performed when launching an app in ChromeOS kiosk mode. A network connectivity check will be performed when apps are not offline enabled, and app launching put on hold until the device obtains connectivity to the Internet. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/offline_enabled
254
134
  */
255
- omnibox?: {
256
- /**
257
- * The keyward that will trigger your extension.
258
- */
259
- keyword: string;
260
- [k: string]: any;
261
- };
135
+ offline_enabled?: boolean;
136
+ omnibox?: Keywords;
262
137
  /**
263
138
  * Use the optional_permissions key to list permissions which you want to ask for at runtime, after your add-on has been installed.
139
+ * The key can contain two kinds of permissions: host permissions and API permissions.
140
+ * Not all permissions are compatible with all browsers
141
+ * Some are granted silently, without user prompt
142
+ *
143
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions
264
144
  */
265
145
  optional_permissions?: (
266
146
  | string
267
147
  | (
268
- | "activeTab"
269
- | "background"
270
- | "bookmarks"
271
- | "clipboardRead"
272
- | "clipboardWrite"
273
- | "contentSettings"
274
- | "contextMenus"
275
- | "cookies"
276
- | "debugger"
277
- | "geolocation"
278
- | "history"
279
- | "idle"
280
- | "management"
281
- | "notifications"
282
- | "pageCapture"
283
- | "tabs"
284
- | "topSites"
285
- | "webNavigation"
286
- | "webRequest"
287
- | "webRequestBlocking"))[];
288
- /**
289
- * Use the options_ui key to define an options page for your add-on.
290
- */
291
- options_ui?: {
292
- /**
293
- * The path to an HTML file containing the specification of your options page.
294
- */
295
- page: string;
296
- /**
297
- * Use this to include a stylesheet in your page that will make it look consistent with the browser's UI and with other add-ons that use the browser_style property.
298
- */
299
- browser_style?: boolean;
300
- /**
301
- * If true, the options page will open in a normal browser tab, rather than being integrated into the browser's add-ons manager.
302
- */
303
- open_in_tab?: boolean;
304
- [k: string]: any;
305
- };
148
+ | 'activeTab'
149
+ | 'background'
150
+ | 'bookmarks'
151
+ | 'browserSettings'
152
+ | 'browsingData'
153
+ | 'clipboardRead'
154
+ | 'clipboardWrite'
155
+ | 'contentSettings'
156
+ | 'contextMenus'
157
+ | 'cookies'
158
+ | 'debugger'
159
+ | 'declarativeNetRequest'
160
+ | 'declarativeNetRequestFeedback'
161
+ | 'declarativeNetRequestWithHostAccess'
162
+ | 'devtools'
163
+ | 'downloads'
164
+ | 'downloads.open'
165
+ | 'find'
166
+ | 'geolocation'
167
+ | 'history'
168
+ | 'idle'
169
+ | 'management'
170
+ | 'nativeMessaging'
171
+ | 'notifications'
172
+ | 'pageCapture'
173
+ | 'pkcs11'
174
+ | 'privacy'
175
+ | 'proxy'
176
+ | 'scripting'
177
+ | 'search'
178
+ | 'sessions'
179
+ | 'tabHide'
180
+ | 'tabs'
181
+ | 'topSites'
182
+ | 'webNavigation'
183
+ | 'webRequest'
184
+ | 'webRequestBlocking'
185
+ | 'webRequestFilterResponse'
186
+ | 'webRequestFilterResponse.serviceWorkerScript'
187
+ )
188
+ )[];
306
189
  /**
307
- * Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.
190
+ * Use the options_page key to define an options page for your extension.
191
+ *
192
+ * The options page contains settings for the extension. The user can access it from the browser's add-ons manager, and you can open it from within your extension using runtime.openOptionsPage().
193
+ *
194
+ * Unlike options pages specified using the newer options_ui key, options pages specified using the deprecated options_page key don't receive browser styles and always open in a normal browser tab.
195
+ *
196
+ * WARNING: This manifest key has been deprecated. Use `options_ui` instead.
197
+ *
198
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/options_page#browser_compatibility
308
199
  */
309
- page_action?: {
310
- /**
311
- * Use this to include a stylesheet in your popup that will make it look consistent with the browser's UI and with other add-ons that use the browser_style property. Although this key defaults to false, it's recommended that you include it and set it to true.
312
- */
313
- browser_style?: boolean;
314
- default_icon?: Icon;
315
- /**
316
- * The popup appears when the user clicks the icon.
317
- */
318
- default_popup?: string;
319
- /**
320
- * Tooltip for the main toolbar icon.
321
- */
322
- default_title?: string;
323
- [k: string]: any;
324
- };
200
+ options_page?: string;
201
+ options_ui?: OptionsPage;
202
+ page_action?: PagePopup;
325
203
  /**
326
- * Permissions help to limit damage if your extension or app is compromised by malware. Some permissions are also displayed to users before installation, as detailed in Permission Warnings.
204
+ * Use the permissions key to request special powers for your extension. This key is an array of strings, and each string is a request for a permission.
205
+ *
206
+ * If you request permissions using this key, then the browser may inform the user at install time that the extension is requesting certain privileges, and ask them to confirm that they are happy to grant these privileges.
207
+ *
208
+ * The key can contain three kinds of permissions:
209
+ * - host permissions: Specified as match patterns, and each pattern identifies a group of URLs for which the extension is requesting extra privileges. For example, a host permission could be "*://developer.mozilla.org/*".
210
+ * - API permissions: Specified as keywords, and each keyword names a WebExtension API that the extension would like to use.
211
+ * - activeTab: This permission is specified as "activeTab". If an extension has the activeTab permission, then when the user interacts with the extension, the extension is granted extra privileges for the active tab only.
212
+ *
213
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions
327
214
  */
328
215
  permissions?: (
329
216
  | string
330
217
  | (
331
- | "<all_urls>"
332
- | "activeTab"
333
- | "alarms"
334
- | "bookmarks"
335
- | "browsingData"
336
- | "contextMenus"
337
- | "contextualIdentities"
338
- | "cookies"
339
- | "downloads"
340
- | "downloads.open"
341
- | "geolocation"
342
- | "history"
343
- | "identity"
344
- | "idle"
345
- | "management"
346
- | "nativeMessaging"
347
- | "notifications"
348
- | "proxy"
349
- | "sessions"
350
- | "storage"
351
- | "tabs"
352
- | "topSites"
353
- | "webNavigation"
354
- | "webRequest"
355
- | "webRequestBlocking"))[];
356
- /**
357
- * Use this key to register one of more web-based protocol handlers.
358
- */
359
- protocol_handlers?: {
360
- /**
361
- * A string defining the protocol.
362
- */
363
- protocol?:
364
- | (
365
- | "bitcoin"
366
- | "geo"
367
- | "im"
368
- | "irc"
369
- | "ircs"
370
- | "magnet"
371
- | "mailto"
372
- | "mms"
373
- | "news"
374
- | "nntp"
375
- | "sip"
376
- | "sms"
377
- | "smsto"
378
- | "ssh"
379
- | "tel"
380
- | "urn"
381
- | "webcal"
382
- | "wtai"
383
- | "xmpp")
384
- | string;
385
- /**
386
- * A string representing the name of the protocol handler. This will be displayed to the user when they are being asked if they want this handler to open the link.
387
- */
388
- name?: string;
389
- /**
390
- * A string representing the URL of the handler. This string must include "%s" as a placeholder: this will be replaced with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone number, email address, or so forth.
391
- */
392
- uriTemplate?: {
393
- [k: string]: any;
394
- };
395
- [k: string]: any;
396
- };
218
+ | '<all_urls>'
219
+ | 'activeTab'
220
+ | 'alarms'
221
+ | 'background'
222
+ | 'bookmarks'
223
+ | 'browserSettings'
224
+ | 'browsingData'
225
+ | 'captivePortal'
226
+ | 'clipboardRead'
227
+ | 'clipboardWrite'
228
+ | 'contentSettings'
229
+ | 'contextMenus'
230
+ | 'contextualIdentities'
231
+ | 'cookies'
232
+ | 'debugger'
233
+ | 'declarativeNetRequest'
234
+ | 'declarativeNetRequestFeedback'
235
+ | 'declarativeNetRequestWithHostAccess'
236
+ | 'devtools '
237
+ | 'dns'
238
+ | 'downloads'
239
+ | 'downloads.open'
240
+ | 'find'
241
+ | 'geolocation'
242
+ | 'history'
243
+ | 'identity'
244
+ | 'idle'
245
+ | 'management'
246
+ | 'menus'
247
+ | 'menus.overrideContext'
248
+ | 'nativeMessaging'
249
+ | 'notifications'
250
+ | 'pageCapture'
251
+ | 'pkcs11'
252
+ | 'privacy'
253
+ | 'proxy'
254
+ | 'scripting'
255
+ | 'search'
256
+ | 'sessions'
257
+ | 'storage'
258
+ | 'tabHide'
259
+ | 'tabs'
260
+ | 'theme'
261
+ | 'topSites'
262
+ | 'unlimitedStorage'
263
+ | 'webNavigation'
264
+ | 'webRequest'
265
+ | 'webRequestBlocking'
266
+ | 'webRequestFilterResponse'
267
+ | 'webRequestFilterResponse.serviceWorkerScript'
268
+ )
269
+ )[];
397
270
  /**
398
- * The short name is typically used where there is insufficient space to display the full name.
271
+ * Use this key to register one or more web-based protocol handlers.
272
+ *
273
+ * A protocol handler is an application that knows how to handle particular types of links: for example, a mail client is a protocol handler for "mailto:" links. When the user clicks a "mailto:" link, the browser opens the application selected as the handler for the "mailto:" protocol (or offers them a choice of handlers, depending on their settings).
274
+ *
275
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/protocol_handlers
276
+ */
277
+ protocol_handlers?: ProtocolHandler[];
278
+ /**
279
+ * Short name for the extension. If given, this will be used in contexts where the name field is too long. It's recommended that the short name should not exceed 12 characters. If the short name field is not included in manifest.json, then name will be used instead and may be truncated.
280
+ *
281
+ * This is a localizable property.
282
+ *
283
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/short_name
399
284
  */
400
285
  short_name?: string;
286
+ sidebar_action?: SidebarPage;
287
+ storage?: StoragePolicies;
288
+ theme?: Theme;
289
+ user_scripts?: UserScripts;
401
290
  /**
402
- * A sidebar is a pane that is displayed at the left-hand side of the browser window, next to the web page. The browser provides a UI that enables the user to see the currently available sidebars and to select a sidebar to display.
291
+ * The version string for the extension.
292
+ *
293
+ * The version string consists of 1 to 4 numbers separated by dots, for example, 1.2.3.4. Non-zero numbers must not include a leading zero.
294
+ *
295
+ * Extension stores and browsers may enforce or warn if the version string doesn't comply with this format. They may also apply restrictions to the range of numbers available.
296
+ *
297
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/version
403
298
  */
404
- sidebar_action?: {
405
- default_icon?: Icon;
406
- /**
407
- * The path to an HTML file that specifies the sidebar's contents.
408
- */
409
- default_panel?: string;
410
- /**
411
- * Title for the sidebar. This is used in the browser UI for listing and opening sidebars, and is displayed at the top of the sidebar when it is open.
412
- */
413
- default_title?: string;
414
- [k: string]: any;
299
+ version: string;
300
+ /**
301
+ * In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version string and will be used for display purposes if present.
302
+ *
303
+ * If no version_name is present, the version field will be used for display purposes as well.https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/version_name
304
+ */
305
+ version_name?: string;
306
+ web_accessible_resources?: Scripts1;
307
+ [k: string]: unknown | undefined;
308
+ }
309
+ /**
310
+ * Use the background key to include one or more background scripts, a background page, or a Service worker in your extension.
311
+ *
312
+ * Background scripts are the place to put code that needs to maintain a long-term state or perform long-term operations independently of the lifetime of any particular web pages or browser windows.
313
+ *
314
+ * Background scripts are loaded as soon as the extension is loaded and stay loaded until the extension is disabled or uninstalled unless persistent is specified as false. You can use any WebExtension APIs in the script if you have requested the necessary permissions.
315
+ *
316
+ * See Background scripts for some more details.
317
+ *
318
+ * The background key is an object that must have one of these properties (for more information on how these properties are supported, see Browser support)
319
+ *
320
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background
321
+ */
322
+ export interface BackgroundScriptInclusions {
323
+ /**
324
+ * If you need specific content in the background page, you can define a page using the page property. This is a String representing a path relative to the manifest.json file to an HTML document included in your extension bundle.
325
+ *
326
+ * If you use this property, you can not specify background scripts using scripts, but you can include scripts from the page, just like a normal web page.
327
+ */
328
+ page?: string;
329
+ /**
330
+ * An Array of Strings, each of which is a path to a JavaScript source. The path is relative to the manifest.json file itself. These are the scripts that are executed in the extension's background page.
331
+ * The scripts share the same window global context.
332
+ * The scripts are loaded in the order they appear in the array.
333
+ * If you specify scripts, an empty page is created where your scripts run.
334
+ * Note: If you want to fetch a script from a remote location with the <script> tag (e.g., <script src = "https://code.jquery.com/jquery-3.6.0.min.js">), you have to change the content_security_policy key in the manifest.json file of your extension.
335
+ */
336
+ scripts?: string[];
337
+ /**
338
+ * Specify a JavaScript file as the extension service worker. A service worker is a background script that acts as the extension's main event handler.
339
+ */
340
+ service_worker?: string;
341
+ /**
342
+ * If omitted, this property defaults to true in Manifest V2 and false in Manifest V3. Setting to true in Manifest V3 results in an error.
343
+ *
344
+ * `true` indicates the background page is to be kept in memory from when the extension is loaded or the browser starts until the extension is unloaded or disabled, or the browser is closed (that is, the background page is persistent).
345
+ * `false` indicates the background page may be unloaded from memory when idle and recreated when needed. Such background pages are often called Event Pages, because they are loaded into memory to allow the background page to handle the events to which it has added listeners. Registration of listeners is persistent when the page is unloaded from memory, but other values are not persistent. If you want to store data persistently in an event page, then you should use the storage API.
346
+ */
347
+ persistent?: boolean;
348
+ /**
349
+ * Determines whether the scripts specified in "scripts" are loaded as ES modules.
350
+ *
351
+ * `classic` indicates the background scripts or service workers are not included as an ES Module.
352
+ *
353
+ * If omitted, this property defaults to classic.
354
+ */
355
+ type?: 'classic' | 'module';
356
+ }
357
+ /**
358
+ * The browser_specific_settings key contains keys that are specific to a particular host application.
359
+ */
360
+ export interface BrowserSpecificSettings {
361
+ gecko?: GeckoSpecificSettings;
362
+ gecko_android?: GeckoAndroidSpecificSettings;
363
+ safari?: SafariSpecificSettings;
364
+ [k: string]: unknown | undefined;
365
+ }
366
+ export interface GeckoSpecificSettings {
367
+ /**
368
+ * id is the extension ID
369
+ */
370
+ id?: string;
371
+ /**
372
+ * Link to an add-on update manifest. (Requires Gecko 45)
373
+ */
374
+ update_url?: string;
375
+ [k: string]: unknown | undefined;
376
+ }
377
+ /**
378
+ * When not defined, it falls back to `gecko`
379
+ */
380
+ export interface GeckoAndroidSpecificSettings {
381
+ /**
382
+ * Minimum version of Gecko to support. If the Browser version on which the extension is being installed or run is below this version, the extension is not installed or not run. If not provided, all versions earlier than strict_max_version are supported. "*" is not valid in this field.
383
+ *
384
+ * See the list of valid Gecko versions: https://addons.mozilla.org/api/v5/applications/firefox/
385
+ */
386
+ strict_min_version?: string;
387
+ /**
388
+ * Maximum version of Gecko to support. If the Browser version on which the extension is being installed or run is above this version, the extension is not installed or not run. Defaults to "*", which disables checking for a maximum version.
389
+ *
390
+ * See the list of valid Gecko versions: https://addons.mozilla.org/api/v5/applications/firefox/
391
+ */
392
+ strict_max_version?: string;
393
+ [k: string]: unknown | undefined;
394
+ }
395
+ /**
396
+ * Specific for Safari and Safari on IOS
397
+ */
398
+ export interface SafariSpecificSettings {
399
+ /**
400
+ * Minimum version of Gecko to support. If the Browser version on which the extension is being installed or run is below this version, the extension is not installed or not run. If not provided, all versions earlier than strict_max_version are supported. "*" is not valid in this field.
401
+ *
402
+ * See the list of valid Gecko versions: https://addons.mozilla.org/api/v5/applications/firefox/
403
+ */
404
+ strict_min_version?: string;
405
+ /**
406
+ * Maximum version of Gecko to support. If the Browser version on which the extension is being installed or run is above this version, the extension is not installed or not run. Defaults to "*", which disables checking for a maximum version.
407
+ *
408
+ * See the list of valid Gecko versions: https://addons.mozilla.org/api/v5/applications/firefox/
409
+ */
410
+ strict_max_version?: string;
411
+ [k: string]: unknown | undefined;
412
+ }
413
+ /**
414
+ * Use the chrome_settings_overrides key to override the browser's home page and add a new search engine.
415
+ *
416
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides
417
+ */
418
+ export interface BrowserHomePage {
419
+ /**
420
+ * Defines the page to be used as the browser's homepage.
421
+ *
422
+ * The replacement is given as a URL. The URL may:
423
+ * - point to a file bundled with the extension, in which case it is given as a URL relative to the manifest.json file
424
+ * - be a remote URL, such as "https://developer.mozilla.org/".
425
+ *
426
+ * If two or more extensions both set this value, then the setting from the most recently installed one will take precedence.
427
+ *
428
+ * To override new tabs, use "chrome_url_overrides" instead.
429
+ *
430
+ * This is a localizable property.
431
+ */
432
+ homepage?: string;
433
+ search_provider?: SearchProviders;
434
+ }
435
+ /**
436
+ * Defines a search provider to add to the browser.
437
+ *
438
+ * In the URLs you supply, use "{searchTerms}" to interpolate the search term into the URL, like: https://www.discogs.com/search/?q={searchTerms}. You can also provide POST parameters to be sent along with the search.
439
+ *
440
+ * The search provider will be presented to the user alongside the built-in providers.
441
+ *
442
+ * All string properties are localizable.
443
+ */
444
+ export interface SearchProviders {
445
+ /**
446
+ * The search engine's name, displayed to the user.
447
+ */
448
+ name: string;
449
+ /**
450
+ * URL used by the search engine. This must be an HTTPS URL.
451
+ */
452
+ search_url: string;
453
+ /**
454
+ * True if the search engine should be the default choice. On Firefox, this is opt-in and the user will only be asked the first time the extension is installed. They will not be asked again if a search engine is added later.
455
+ */
456
+ is_default?: boolean;
457
+ /**
458
+ * An array of alternative URLs that can be used instead of search_url.
459
+ */
460
+ alternate_urls?: string[];
461
+ /**
462
+ * Encoding of the search term, specified as a standard character encoding name, such as "UTF-8".
463
+ */
464
+ encoding?: string;
465
+ /**
466
+ * URL pointing to an icon for the search engine. This must be an absolute HTTP or HTTPS URL.
467
+ */
468
+ favicon_url?: string;
469
+ /**
470
+ * URL used for image search.
471
+ */
472
+ image_url?: string;
473
+ /**
474
+ * POST parameters to send to image_url.
475
+ */
476
+ image_url_post_params?: string;
477
+ /**
478
+ * URL used for instant search.
479
+ */
480
+ instant_url?: string;
481
+ /**
482
+ * POST parameters to send to instant_url.
483
+ */
484
+ instant_url_post_params?: string;
485
+ /**
486
+ * Address bar keyword for the search engine.
487
+ */
488
+ keyword?: string;
489
+ /**
490
+ * The ID of a built-in search engine to use.
491
+ */
492
+ prepopulated_id?: string;
493
+ /**
494
+ * POST parameters to send to search_url.
495
+ */
496
+ search_url_post_params?: string;
497
+ /**
498
+ * URL used for search suggestions. This must be an HTTPS URL.
499
+ */
500
+ suggest_url?: string;
501
+ /**
502
+ * POST parameters to send to suggest_url.
503
+ */
504
+ suggest_url_post_params?: string;
505
+ }
506
+ /**
507
+ * Use the chrome_url_overrides key to provide a custom replacement for the documents loaded into various special pages usually provided by the browser itself.
508
+ *
509
+ * The replacements are given as a URL to an HTML file. The file must be bundled with the extension: you can't specify a remote URL here. You can specify it relative to the extension's root folder, like: "path/to/newtab.html".
510
+ *
511
+ * The document can load CSS and JavaScript, just like a normal web page. JavaScript running in the page gets access to the same privileged "browser.*" APIs as the extension's background script.
512
+ *
513
+ * If two or more extensions both define custom new tab pages, then the last one to be installed or enabled gets to use its value.
514
+ *
515
+ * All properties are localizable.
516
+ *
517
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/chrome_url_overrides
518
+ */
519
+ export interface CustomSpecialPages {
520
+ /**
521
+ * Provide a replacement for the page that shows the bookmarks.
522
+ */
523
+ bookmarks?: string;
524
+ /**
525
+ * Provide a replacement for the page that shows the browsing history.
526
+ */
527
+ history?: string;
528
+ /**
529
+ * Provide a replacement for the document that's shown in the "new tab" page
530
+ */
531
+ newtab?: string;
532
+ }
533
+ /**
534
+ * Use the commands key to define one or more keyboard shortcuts for your extension.
535
+ *
536
+ * Each keyboard shortcut is defined with a name, a combination of keys, and a description. Once you've defined commands in your extension's manifest.json, you can listen for their associated key combinations with the commands JavaScript API.
537
+ *
538
+ * The properties' name is the name of the shortcut.
539
+ *
540
+ * There are these 4 special shortcuts with default actions for which the commands.onCommand event does not fire
541
+ *
542
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands
543
+ */
544
+ export interface KeyboardShortcuts {
545
+ _execute_browser_action?: Command;
546
+ _execute_page_action?: Command1;
547
+ _execute_sidebar_action?: Command2;
548
+ [k: string]: Command3 | undefined;
549
+ }
550
+ /**
551
+ * Works like a click on a toolbar button created with browserAction or specified in the browser_action key in the manifest.json key.
552
+ */
553
+ export interface Command {
554
+ /**
555
+ * A description of the shortcut; i.e. what it does
556
+ */
557
+ description?: string;
558
+ /**
559
+ * The value of each property is the keyboard shortcut for the command on that platform, as a string containing keys separated by "+". The value for "default" is used on all platforms that are not explicitly listed.
560
+ */
561
+ suggested_key?: {
562
+ default?: CommandShortcut;
563
+ mac?: CommandShortcut;
564
+ linux?: CommandShortcut;
565
+ windows?: CommandShortcut;
566
+ chromeos?: CommandShortcut;
567
+ android?: CommandShortcut;
568
+ ios?: CommandShortcut;
415
569
  };
570
+ }
571
+ /**
572
+ * Works like a click on an address bar button created with pageAction or specified in the page_action key in the manifest.json key.
573
+ */
574
+ export interface Command1 {
416
575
  /**
417
- * One to four dot-separated integers identifying the version of this extension.
576
+ * A description of the shortcut; i.e. what it does
418
577
  */
419
- version: {
420
- [k: string]: any;
578
+ description?: string;
579
+ /**
580
+ * The value of each property is the keyboard shortcut for the command on that platform, as a string containing keys separated by "+". The value for "default" is used on all platforms that are not explicitly listed.
581
+ */
582
+ suggested_key?: {
583
+ default?: CommandShortcut;
584
+ mac?: CommandShortcut;
585
+ linux?: CommandShortcut;
586
+ windows?: CommandShortcut;
587
+ chromeos?: CommandShortcut;
588
+ android?: CommandShortcut;
589
+ ios?: CommandShortcut;
421
590
  };
591
+ }
592
+ /**
593
+ * Opens the extension's sidebar specified in the sidebar_action manifest.json key.
594
+ */
595
+ export interface Command2 {
422
596
  /**
423
- * An array of strings specifying the paths (relative to the package root) of packaged resources that are expected to be usable in the context of a web page.
597
+ * A description of the shortcut; i.e. what it does
424
598
  */
425
- web_accessible_resources?: string[];
426
- [k: string]: any;
599
+ description?: string;
600
+ /**
601
+ * The value of each property is the keyboard shortcut for the command on that platform, as a string containing keys separated by "+". The value for "default" is used on all platforms that are not explicitly listed.
602
+ */
603
+ suggested_key?: {
604
+ default?: CommandShortcut;
605
+ mac?: CommandShortcut;
606
+ linux?: CommandShortcut;
607
+ windows?: CommandShortcut;
608
+ chromeos?: CommandShortcut;
609
+ android?: CommandShortcut;
610
+ ios?: CommandShortcut;
611
+ };
427
612
  }
428
- export interface Command {
613
+ /**
614
+ * A custom command
615
+ */
616
+ export interface Command3 {
617
+ /**
618
+ * A description of the shortcut; i.e. what it does
619
+ */
429
620
  description?: string;
621
+ /**
622
+ * The value of each property is the keyboard shortcut for the command on that platform, as a string containing keys separated by "+". The value for "default" is used on all platforms that are not explicitly listed.
623
+ */
430
624
  suggested_key?: {
431
- default?: string;
432
- mac?: string;
433
- linux?: string;
434
- windows?: string;
435
- chromeos?: string;
436
- ios?: string;
437
- android?: string;
438
- [k: string]: any;
625
+ default?: CommandShortcut;
626
+ mac?: CommandShortcut;
627
+ linux?: CommandShortcut;
628
+ windows?: CommandShortcut;
629
+ chromeos?: CommandShortcut;
630
+ android?: CommandShortcut;
631
+ ios?: CommandShortcut;
632
+ };
633
+ }
634
+ export interface ContentScript {
635
+ /**
636
+ * Specifies which pages this content script will be injected into.<br>There are other optional keys including and excluding.<br>In summary: Match the `matches` property, AND match the `include_globs` property, if present, AND NOT match the `exclude_matches` property, if present, AND NOT match the `exclude_globs` property, if present
637
+ *
638
+ * @minItems 1
639
+ */
640
+ matches: [MatchPattern, ...MatchPattern[]];
641
+ /**
642
+ * Excludes pages that this content script would otherwise be injected into.
643
+ */
644
+ exclude_matches?: MatchPattern[];
645
+ /**
646
+ * An array of paths, relative to manifest.json, referencing CSS files that will be injected into matching pages.<br>Files are injected in the order given, and at the time specified by run_at.<br>Note: Firefox resolves URLs in injected CSS files relative to the CSS file itself, rather than to the page it's injected into.
647
+ */
648
+ css?: string[];
649
+ js?: Scripts;
650
+ /**
651
+ * This option determines when the files specified in css and js are injected. You can supply one of three strings here, each of which identifies a state in the process of loading a document. The states directly correspond to Document.readyState:<br>"document_start": Corresponds to loading. The DOM is still loading.<br>"document_end": Corresponds to interactive. The DOM has finished loading, but resources such as scripts and images may still be loading.<br>"document_idle": Corresponds to complete. The document and all its resources have finished loading.
652
+ */
653
+ run_at?: 'document_start' | 'document_end' | 'document_idle';
654
+ /**
655
+ * `true`: Inject the scripts specified in `js` and `css` into all frames matching the specified URL requirements, even if the frame is not the topmost frame in a tab. This does not inject into child frames where only their parent matches the URL requirements and the child frame does not match the URL requirements. The URL requirements are checked for each frame independently.<br>Note: This also applies to any tracker or ad that uses iframes, which means that enabling this could make your content script get called dozens of times on some pages.<br><br>false`: Inject only into frames matching the URL requirements which are the topmost frame in a tab.
656
+ */
657
+ all_frames?: boolean;
658
+ /**
659
+ * Applied after matches to include only those URLs that also match this glob.
660
+ */
661
+ include_globs?: GlobPattern[];
662
+ /**
663
+ * Applied after matches to exclude URLs that match this glob.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#matching_url_patterns
664
+ */
665
+ exclude_globs?: GlobPattern[];
666
+ /**
667
+ * Insert the content scripts into pages whose URL is "about:blank" or "about:srcdoc", if the URL of the page that opened or created this page matches the patterns specified in the rest of the content_scripts key.<br>This is especially useful to run scripts in empty iframes, whose URL is "about:blank". To do this you should also set the all_frames key.
668
+ */
669
+ match_about_blank?: boolean;
670
+ /**
671
+ * The JavaScript world the script executes in.<br>"ISOLATED": The default content scripts execution environment. This environment is isolated from the page's context: while they share the same document, the global scopes and available APIs differ.<br>"MAIN": The web page's execution environment. This environment is shared with the web page without isolation. Scripts in this environment don't have any access to the APIs that are only available to content scripts.<br><br>Warning: Due to the lack of isolation, the web page can detect and interfere with the executed code. Do not use the MAIN world unless it is acceptable for web pages to read, access, or modify the logic or data that flows through the executed code. world, and therefore "MAIN", is not supported in Firefox (although it is planned, and the work to introduce it is tracked by Bug 1736575). In the meantime, JavaScript code running in the isolated content script sandbox can use the Firefox "Xray vision" feature, as described in Share objects with page scripts.
672
+ */
673
+ world?: 'ISOLATED' | 'MAIN';
674
+ }
675
+ /**
676
+ * Specify static rulesets for use with declarativeNetRequest.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/declarative_net_request
677
+ */
678
+ export interface DeclarativeNetRequestRulesets {
679
+ /**
680
+ * An array of rulesets
681
+ */
682
+ rule_resources: Ruleset[];
683
+ }
684
+ /**
685
+ * Definition of a ruleset
686
+ */
687
+ export interface Ruleset {
688
+ /**
689
+ * A non-empty string uniquely identifying the ruleset. IDs beginning with '_' are reserved for internal use.
690
+ */
691
+ id: string;
692
+ /**
693
+ * Whether the ruleset is enabled by default. The declarativeNetRequest.updateEnabledRulesets method can be used to enable or disable a ruleset at runtime.
694
+ */
695
+ enabled: boolean;
696
+ /**
697
+ * The path of the JSON ruleset relative to the extension directory. See the Rules section of the declarativeNetRequest API for information on the content of the ruleset JSON file.
698
+ */
699
+ path: string;
700
+ }
701
+ /**
702
+ * The name of the extension's developer and their homepage URL, intended for display in the browser's user interface.<br>This object only allows for a single developer name and URL to be specified.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/developer
703
+ */
704
+ export interface DeveloperInformation {
705
+ /**
706
+ * Overrides the `author` key
707
+ */
708
+ name?: string;
709
+ /**
710
+ * Overrides the `homepage_url` key
711
+ */
712
+ url?: string;
713
+ }
714
+ /**
715
+ * The dictionaries key specifies the locale_code for which your extension supplies a dictionary (like `en-US`).<br>If you use the dictionaries key, you must also set an ID for your extension using the browser_specific_settings manifest.json key.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/dictionaries
716
+ */
717
+ export interface Localization {}
718
+ /**
719
+ * Externally connectable controls which other extensions and web pages can communicate with an extension using runtime.connect() and runtime.sendMessage() message passing. If externally_connectable is not specified, all extensions can communicate with each other but not with web pages.<br><br>Note: For communication with web pages:<br>In Chrome, chrome.runtime.connect and chrome.runtime.sendMessage are used. These methods are only available when there is at least one extension listening for messages, see chrome.runtime will no longer be defined unconditionally in Chrome 106 for more details.<br>In Safari, browser.runtime.connect and browser.runtime.sendMessage are used.<br>In Firefox, neither API is supported. See Firefox bug 1319168.<br><br>https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/externally_connectable
720
+ */
721
+ export interface ExternalExtensionAPI {
722
+ /**
723
+ * Enables communication between this extension and other installed extensions specified by extension identifiers. Use the pattern "*" to communicate with all extensions.
724
+ */
725
+ ids?: string[];
726
+ /**
727
+ * A list of regular expressions that enables communication between an extension and the web pages that match the expression.<br><br>Note: If `externally_connectable` is not specified, communication among extensions is allowed as if `externally_connectable` specified `{"ids": ["*"] }`. Therefore, if you specify `externally_connectable.matches`, don't forget to add `ids` if you want to communicate with other extensions.
728
+ */
729
+ matches?: string[];
730
+ }
731
+ /**
732
+ * Use the omnibox key to define an omnibox keyword for your extension.
733
+ *
734
+ * When the user types this keyword into the browser's address bar, followed by a space, then any subsequent characters will be sent to the extension using the omnibox API. The extension will then be able to populate the address bar's drop-down suggestions list with its own suggestions.
735
+ *
736
+ * If two or more extensions define the same keyword, then the extension that was installed last gets to control the keyword. Any previously installed extensions that defined the same keyword will no longer be able to use the omnibox API.
737
+ *
738
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/omnibox
739
+ */
740
+ export interface Keywords {
741
+ /**
742
+ * The keyword that will trigger your extension.
743
+ */
744
+ keyword: string;
745
+ }
746
+ /**
747
+ * Use the options_ui key to define an options page for your extension.
748
+ *
749
+ * The options page contains settings for the extension. The user can access it from the browser's add-ons manager, and you can open it from within your extension using runtime.openOptionsPage().
750
+ *
751
+ * You specify options_ui as a path to an HTML file packaged with your extension. The HTML file can include CSS and JavaScript files, just like a normal web page. Unlike a normal page, though, the JavaScript can use all the WebExtension APIs that the extension has permissions for. However, it runs in a different scope than your background scripts.
752
+ *
753
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/options_ui
754
+ */
755
+ export interface OptionsPage {
756
+ /**
757
+ * The path to an HTML file containing the specification of your options page.
758
+ *
759
+ * The path is relative to the location of manifest.json itself.
760
+ */
761
+ page: string;
762
+ browser_style?: BrowserStyle;
763
+ /**
764
+ * If true, the options page will open in a normal browser tab, rather than being integrated into the browser's add-ons manager.
765
+ */
766
+ open_in_tab?: boolean;
767
+ }
768
+ /**
769
+ * @deprecated
770
+ * Do not set browser_style to true: its not support in Manifest V3 from Firefox 118. See Manifest V3 migration for browser_style.
771
+ *
772
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles#manifest_v3_migration
773
+ */
774
+ export interface BrowserStyle {
775
+ [k: string]: unknown | undefined;
776
+ }
777
+ /**
778
+ * A page action is an icon that your extension adds inside the browser's URL bar.
779
+ *
780
+ * Your extension may optionally also supply an associated popup whose content is specified using HTML, CSS, and JavaScript.
781
+ *
782
+ * If you supply a popup, then the popup is opened when the user clicks the icon, and your JavaScript running in the popup can handle the user's interaction with it. If you don't supply a popup, then a click event is dispatched to your extension's background scripts when the user clicks the icon.
783
+ *
784
+ * Page actions are like browser actions, except that they are associated with particular web pages rather than with the browser as a whole. If an action is only relevant on certain pages, then you should use a page action and display it only on relevant pages. If an action is relevant to all pages or to the browser itself, use a browser action.
785
+ *
786
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action
787
+ */
788
+ export interface PagePopup {
789
+ /**
790
+ * Hide the page action by default for pages whose URLs match any of the given match patterns.
791
+ *
792
+ * Note that page actions are always hidden by default unless show_matches is given. Therefore, it only makes sense to include this property if show_matches is also given, and will override the patterns in show_matches.
793
+ */
794
+ hide_matches?: MatchPatternStrict[];
795
+ /**
796
+ * Show the page action by default for pages whose URLs match any of the given patterns.
797
+ */
798
+ show_matches?: MatchPattern[];
799
+ /**
800
+ * Controls whether or not the page action should appear in the location bar by default when the user installs the extension.
801
+ */
802
+ pinned?: boolean;
803
+ [k: string]: unknown | undefined;
804
+ }
805
+ /**
806
+ * A protocol handler specification
807
+ */
808
+ export interface ProtocolHandler {
809
+ /**
810
+ * A string defining the protocol. It can either be one of the predefined protocols, or a custom name prefixed with "web+" or "ext+". For example: "web+foo" or "ext+foo". The custom name must consist only of lower-case ASCII characters. It's recommended that extensions use the "ext+" form.
811
+ */
812
+ protocol:
813
+ | string
814
+ | (
815
+ | 'bitcoin'
816
+ | 'dat'
817
+ | 'dweb'
818
+ | 'ftp'
819
+ | 'geo'
820
+ | 'gopher'
821
+ | 'im'
822
+ | 'ipfs'
823
+ | 'ipns'
824
+ | 'irc'
825
+ | 'ircs'
826
+ | 'magnet'
827
+ | 'mailto'
828
+ | 'matrix'
829
+ | 'mms'
830
+ | 'news'
831
+ | 'nntp'
832
+ | 'sip'
833
+ | 'sms'
834
+ | 'smsto'
835
+ | 'ssb'
836
+ | 'ssh'
837
+ | 'tel'
838
+ | 'urn'
839
+ | 'webcal'
840
+ | 'wtai'
841
+ | 'xmpp'
842
+ );
843
+ /**
844
+ * A string representing the name of the protocol handler. This will be displayed to the user when they are being asked if they want this handler to open the link.
845
+ */
846
+ name: string;
847
+ /**
848
+ * A string representing the URL of the handler. This string must include "%s" as a placeholder: this will be replaced with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone number, email address, or so forth. This is a localizable property.
849
+ */
850
+ uriTemplate: {
851
+ [k: string]: unknown | undefined;
439
852
  };
440
- [k: string]: any;
853
+ }
854
+ /**
855
+ * A sidebar is a pane that is displayed at the left-hand side of the browser window, next to the web page. The browser provides a UI that enables the user to see the currently available sidebars and to select a sidebar to display.
856
+ *
857
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/sidebar_action
858
+ */
859
+ export interface SidebarPage {
860
+ default_icon?: Icon;
861
+ /**
862
+ * The path to an HTML file that specifies the sidebar's contents.
863
+ *
864
+ * Unlike a normal web page, JavaScript running in the panel can access all the WebExtension APIs (subject, of course, to the extension having the appropriate permissions).
865
+ *
866
+ * This is a localizable property.
867
+ */
868
+ default_panel: string;
869
+ /**
870
+ * Title for the sidebar. This is used in the browser UI for listing and opening sidebars, and is displayed at the top of the sidebar when it is open.
871
+ *
872
+ * This property is optional: if it is omitted, the sidebar's title is the extension's name.
873
+ *
874
+ * This is a localizable property.
875
+ */
876
+ default_title?: string;
877
+ /**
878
+ * Determines whether the sidebar should open on install. The default behavior is to open the sidebar when installation is completed.
879
+ */
880
+ open_at_install?: boolean;
881
+ browser_style?: BrowserStyle;
882
+ }
883
+ /**
884
+ * Use the storage key to specify the name of the schema file that defines the structure of data in managed storage.
885
+ *
886
+ * Managed data declares the enterprise policies supported by the app. Policies are analogous to options but are configured by a system administrator instead of the user, enabling the app to be configured for all users of an organization.
887
+ *
888
+ * After declaring the policies, they are read from the storage.managed API. However, if a policy value does not conform to the schema, then it is not published by the storage.managed API. It's up to the app to enforce the policies configured by the administrator.
889
+ *
890
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/storage
891
+ */
892
+ export interface StoragePolicies {
893
+ /**
894
+ * The full path of the file within the extension that defines the schema of the manage storage.
895
+ */
896
+ managed_schema: string;
897
+ }
898
+ /**
899
+ * Use the theme key to define a static theme to apply to Firefox.
900
+ *
901
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/theme
902
+ */
903
+ export interface Theme {
904
+ images?: Images;
905
+ colors?: Colors;
906
+ properties?: Properties;
907
+ }
908
+ /**
909
+ * Represents the images to display in various parts of the browser.
910
+ */
911
+ export interface Images {
912
+ /**
913
+ * The URL of a foreground image to be added to the header area and anchored to the upper right corner of the header area.
914
+ */
915
+ theme_frame?: string;
916
+ /**
917
+ * An array of URLs for additional background images to be added to the header area and displayed behind the "theme_frame": image. These images layer the first image in the array on top, the last image in the array at the bottom.
918
+ */
919
+ additional_backgrounds?: string[];
920
+ }
921
+ /**
922
+ * Represents the colors of various parts of the browser.
923
+ *
924
+ * These properties define the colors used for different parts of the browser. How these properties affect the Firefox UI can be seen at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/theme#colors.
925
+ *
926
+ * All these properties can be specified as either a string containing any valid CSS color string including hexadecimal (see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value), or an RGB array
927
+ *
928
+ * Note: Where a component is affected by multiple color properties, the properties are listed in order of precedence.
929
+ */
930
+ export interface Colors {
931
+ /**
932
+ * The color of text and icons in the bookmark and find bars. Also, if tab_text isn't defined it sets the color of the active tab text and if icons isn't defined the color of the toolbar icons. Provided as Chrome compatible alias for toolbar_text.
933
+ */
934
+ bookmark_text?: string | [number, number, number];
935
+ /**
936
+ * The color of the background of the pressed toolbar buttons.
937
+ */
938
+ button_background_active?: string | [number, number, number];
939
+ /**
940
+ * The color of the background of the toolbar buttons on hover.
941
+ */
942
+ button_background_hover?: string | [number, number, number];
943
+ /**
944
+ * The color of toolbar icons, excluding those in the find toolbar.
945
+ */
946
+ icons?: string | [number, number, number];
947
+ /**
948
+ * The color of toolbar icons in attention state such as the starred bookmark icon or finished download icon.
949
+ */
950
+ icons_attention?: string | [number, number, number];
951
+ /**
952
+ * The color of the header area background, displayed in the part of the header not covered or visible through the images specified in "theme_frame" and "additional_backgrounds".
953
+ */
954
+ frame?: string | [number, number, number];
955
+ /**
956
+ * The color of the header area background when the browser window is inactive, displayed in the part of the header not covered or visible through the images specified in "theme_frame" and "additional_backgrounds".
957
+ */
958
+ frame_inactive?: string | [number, number, number];
959
+ /**
960
+ * The new tab page background color.
961
+ */
962
+ ntp_background?: string | [number, number, number];
963
+ /**
964
+ * The new tab page card background color.
965
+ */
966
+ ntp_card_background?: string | [number, number, number];
967
+ /**
968
+ * The new tab page text color.
969
+ */
970
+ ntp_text?: string | [number, number, number];
971
+ /**
972
+ * The background color of popups (such as the URL bar dropdown and the arrow panels).
973
+ */
974
+ popup?: string | [number, number, number];
975
+ /**
976
+ * The border color of popups.
977
+ */
978
+ popup_border?: string | [number, number, number];
979
+ /**
980
+ * The background color of items highlighted using the keyboard inside popups (such as the selected URL bar dropdown item).
981
+ */
982
+ popup_highlight?: string | [number, number, number];
983
+ /**
984
+ * The text color of items highlighted inside popups.
985
+ */
986
+ popup_highlight_text?: string | [number, number, number];
987
+ /**
988
+ * The text color of popups.
989
+ */
990
+ popup_text?: string | [number, number, number];
991
+ /**
992
+ * The background color of the sidebar.
993
+ */
994
+ sidebar?: string | [number, number, number];
995
+ /**
996
+ * The border and splitter color of the browser sidebar
997
+ */
998
+ sidebar_border?: string | [number, number, number];
999
+ /**
1000
+ * The background color of highlighted rows in built-in sidebars
1001
+ */
1002
+ sidebar_highlight?: string | [number, number, number];
1003
+ /**
1004
+ * The text color of highlighted rows in sidebars.
1005
+ */
1006
+ sidebar_highlight_text?: string | [number, number, number];
1007
+ /**
1008
+ * The text color of sidebars.
1009
+ */
1010
+ sidebar_text?: string | [number, number, number];
1011
+ /**
1012
+ * The color of the vertical separator of the background tabs.
1013
+ *
1014
+ * DEPRECATED
1015
+ */
1016
+ tab_background_separator?: string | [number, number, number];
1017
+ /**
1018
+ * The color of the text displayed in the inactive page tabs. If tab_text or bookmark_text isn't specified, applies to the active tab text.
1019
+ */
1020
+ tab_background_text?: string | [number, number, number];
1021
+ /**
1022
+ * The color of the selected tab line.
1023
+ */
1024
+ tab_line?: string | [number, number, number];
1025
+ /**
1026
+ * The color of the tab loading indicator and the tab loading burst.
1027
+ */
1028
+ tab_loading?: string | [number, number, number];
1029
+ /**
1030
+ * The background color of the selected tab. When not in use selected tab color is set by frame and the frame_inactive.
1031
+ */
1032
+ tab_selected?: string | [number, number, number];
1033
+ /**
1034
+ * Represents the text color for the selected tab. If tab_line isn't specified, it also defines the color of the selected tab line.
1035
+ */
1036
+ tab_text?: string | [number, number, number];
1037
+ /**
1038
+ * The background color for the navigation bar, the bookmarks bar, and the selected tab.
1039
+ *
1040
+ * This also sets the background color of the "Find" bar.
1041
+ */
1042
+ toolbar?: string | [number, number, number];
1043
+ /**
1044
+ * The color of the line separating the bottom of the toolbar from the region below.
1045
+ */
1046
+ toolbar_bottom_separator?: string | [number, number, number];
1047
+ /**
1048
+ * The background color for fields in the toolbar, such as the URL bar.
1049
+ *
1050
+ * This also sets the background color of the Find in page field.
1051
+ */
1052
+ toolbar_field?: string | [number, number, number];
1053
+ /**
1054
+ * The border color for fields in the toolbar.
1055
+ *
1056
+ * This also sets the border color of the Find in page field.
1057
+ */
1058
+ toolbar_field_border?: string | [number, number, number];
1059
+ /**
1060
+ * The focused border color for fields in the toolbar.
1061
+ */
1062
+ toolbar_field_border_focus?: string | [number, number, number];
1063
+ /**
1064
+ * The focused background color for fields in the toolbar, such as the URL bar.
1065
+ */
1066
+ toolbar_field_focus?: string | [number, number, number];
1067
+ /**
1068
+ * The background color used to indicate the current selection of text in the URL bar (and the search bar, if it's configured to be separate).
1069
+ */
1070
+ toolbar_field_highlight?: string | [number, number, number];
1071
+ /**
1072
+ * The color used to draw text that's currently selected in the URL bar (and the search bar, if it's configured to be separate box).
1073
+ */
1074
+ toolbar_field_highlight_text?: string | [number, number, number];
1075
+ /**
1076
+ * The color of separators inside the URL bar. In Firefox 58 this was implemented as toolbar_vertical_separator.
1077
+ *
1078
+ * DEPRECATED
1079
+ */
1080
+ toolbar_field_separator?: string | [number, number, number];
1081
+ /**
1082
+ * The color of text in fields in the toolbar, such as the URL bar. This also sets the color of text in the Find in page field.
1083
+ */
1084
+ toolbar_field_text?: string | [number, number, number];
1085
+ /**
1086
+ * The color of text in focused fields in the toolbar, such as the URL bar.
1087
+ */
1088
+ toolbar_field_text_focus?: string | [number, number, number];
1089
+ /**
1090
+ * The color of toolbar text. This also sets the color of text in the "Find" bar.
1091
+ */
1092
+ toolbar_text?: string | [number, number, number];
1093
+ /**
1094
+ * The color of the line separating the top of the toolbar from the region above.
1095
+ */
1096
+ toolbar_top_separator?: string | [number, number, number];
1097
+ /**
1098
+ * The color of the separator in the bookmarks toolbar.
1099
+ */
1100
+ toolbar_vertical_separator?: string | [number, number, number];
1101
+ }
1102
+ /**
1103
+ * Affects how the "additional_backgrounds" images are displayed and color schemes are applied.
1104
+ */
1105
+ export interface Properties {
1106
+ /**
1107
+ * An array of enumeration values defining the alignment of the corresponding "additional_backgrounds": array item.
1108
+ */
1109
+ additional_backgrounds_alignment?: (
1110
+ | 'bottom'
1111
+ | 'center'
1112
+ | 'left'
1113
+ | 'right'
1114
+ | 'top'
1115
+ | 'center bottom'
1116
+ | 'center center'
1117
+ | 'center top'
1118
+ | 'left bottom'
1119
+ | 'left center'
1120
+ | 'left top'
1121
+ | 'right bottom'
1122
+ | 'right center'
1123
+ | 'right top'
1124
+ )[];
1125
+ /**
1126
+ * Defines how the corresponding "additional_backgrounds": array item repeats.
1127
+ */
1128
+ additional_backgrounds_tiling?: ('no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y')[];
1129
+ /**
1130
+ * Determines which color scheme is applied to the chrome (for example, context menus) and content (for example, built-in pages and the preferred color scheme for web pages).
1131
+ */
1132
+ color_scheme?: ('auto' | 'light' | 'dark' | 'system')[];
1133
+ /**
1134
+ * Determines which color scheme is applied to the content (for example, built-in pages and preferred color scheme for web pages). Overrides color_scheme.
1135
+ */
1136
+ content_color_scheme?: ('auto' | 'light' | 'dark' | 'system')[];
1137
+ }
1138
+ /**
1139
+ * Instructs the browser to load a script packaged in the extension, known as the API script, this script is used to export a set of custom API methods for use in user scripts.
1140
+ *
1141
+ * Note: The user_script key is required for the userScripts API to function, even if no API script is specified.
1142
+ *
1143
+ * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/user_scripts
1144
+ */
1145
+ export interface UserScripts {
1146
+ /**
1147
+ * The API script:
1148
+ * - runs in the content processes.
1149
+ * - has access to the window and document globals related to the webpage it is attached to.
1150
+ * - has access to the same subset of WebExtension APIs usually available in a content script.
1151
+ *
1152
+ * The script executes automatically on any webpage defined in matches by userScripts.register. However, this is before the user script sandbox object is created and the custom API methods can be exported.
1153
+ *
1154
+ * To export the custom API methods, the script listens for userScripts.onBeforeScript and then export the custom API methods.
1155
+ *
1156
+ * Not every user script may need to consume all of the custom API methods. You can, therefore, include details of the APIs needed in scriptMetadata when running userScripts.register. The API script then accesses the scriptMetadata through the script parameter received by the userScripts.onBeforeScript listener (as script.metadata).
1157
+ */
1158
+ api_script?: string;
441
1159
  }