@wxt-dev/browser 0.0.323 → 0.0.325
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.
- package/package.json +2 -2
- package/src/gen/index.d.ts +540 -238
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wxt-dev/browser",
|
|
3
3
|
"description": "Provides a cross-browser API for using extension APIs and types based on @types/chrome",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.325",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.mjs",
|
|
7
7
|
"types": "src/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"src"
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/chrome": "0.0.
|
|
22
|
+
"@types/chrome": "0.0.325",
|
|
23
23
|
"fs-extra": "^11.3.0",
|
|
24
24
|
"nano-spawn": "^0.2.0",
|
|
25
25
|
"tsx": "4.19.4",
|
package/src/gen/index.d.ts
CHANGED
|
@@ -152,20 +152,17 @@ export namespace Browser {
|
|
|
152
152
|
* @since Chrome 88, MV3
|
|
153
153
|
*/
|
|
154
154
|
export namespace action {
|
|
155
|
-
/** @deprecated Use BadgeColorDetails instead. */
|
|
156
|
-
export interface BadgeBackgroundColorDetails extends BadgeColorDetails {}
|
|
157
|
-
|
|
158
155
|
export interface BadgeColorDetails {
|
|
159
|
-
/** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]
|
|
156
|
+
/** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is `[255, 0, 0, 255]`. Can also be a string with a CSS value, with opaque red being `#FF0000` or `#F00`. */
|
|
160
157
|
color: string | ColorArray;
|
|
161
|
-
/**
|
|
158
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
|
162
159
|
tabId?: number | undefined;
|
|
163
160
|
}
|
|
164
161
|
|
|
165
162
|
export interface BadgeTextDetails {
|
|
166
|
-
/** Any number of characters can be passed, but only about four can fit in the space. */
|
|
167
|
-
text
|
|
168
|
-
/**
|
|
163
|
+
/** Any number of characters can be passed, but only about four can fit in the space. If an empty string (`''`) is passed, the badge text is cleared. If `tabId` is specified and `text` is null, the text for the specified tab is cleared and defaults to the global badge text. */
|
|
164
|
+
text?: string | undefined;
|
|
165
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
|
169
166
|
tabId?: number | undefined;
|
|
170
167
|
}
|
|
171
168
|
|
|
@@ -174,33 +171,34 @@ export namespace Browser {
|
|
|
174
171
|
export interface TitleDetails {
|
|
175
172
|
/** The string the action should display when moused over. */
|
|
176
173
|
title: string;
|
|
177
|
-
/**
|
|
174
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
|
178
175
|
tabId?: number | undefined;
|
|
179
176
|
}
|
|
180
177
|
|
|
181
178
|
export interface PopupDetails {
|
|
182
|
-
/**
|
|
179
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
|
183
180
|
tabId?: number | undefined;
|
|
184
|
-
/** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
|
|
181
|
+
/** The html file to show in a popup. If set to the empty string (`''`), no popup is shown. */
|
|
185
182
|
popup: string;
|
|
186
183
|
}
|
|
187
184
|
|
|
188
185
|
export interface TabIconDetails {
|
|
189
|
-
/**
|
|
186
|
+
/** Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */
|
|
190
187
|
path?: string | { [index: number]: string } | undefined;
|
|
191
|
-
/**
|
|
188
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
|
192
189
|
tabId?: number | undefined;
|
|
193
|
-
/**
|
|
190
|
+
/** Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */
|
|
194
191
|
imageData?: ImageData | { [index: number]: ImageData } | undefined;
|
|
195
192
|
}
|
|
196
193
|
|
|
194
|
+
/** @since Chrome 99 */
|
|
197
195
|
export interface OpenPopupOptions {
|
|
198
|
-
/**
|
|
196
|
+
/** The id of the window to open the action popup in. Defaults to the currently-active window if unspecified. */
|
|
199
197
|
windowId?: number | undefined;
|
|
200
198
|
}
|
|
201
199
|
|
|
202
200
|
export interface TabDetails {
|
|
203
|
-
/**
|
|
201
|
+
/** The ID of the tab to query state for. If no tab is specified, the non-tab-specific state is returned. */
|
|
204
202
|
tabId?: number | undefined;
|
|
205
203
|
}
|
|
206
204
|
|
|
@@ -220,232 +218,154 @@ export namespace Browser {
|
|
|
220
218
|
}
|
|
221
219
|
|
|
222
220
|
/**
|
|
223
|
-
* @since Chrome 88
|
|
224
221
|
* Disables the action for a tab.
|
|
225
|
-
* @param tabId The
|
|
226
|
-
*
|
|
222
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
223
|
+
*
|
|
224
|
+
* Can return its result via Promise.
|
|
227
225
|
*/
|
|
228
226
|
export function disable(tabId?: number): Promise<void>;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @since Chrome 88
|
|
232
|
-
* Disables the action for a tab.
|
|
233
|
-
* @param tabId The id of the tab for which you want to modify the action.
|
|
234
|
-
* @param callback
|
|
235
|
-
*/
|
|
236
227
|
export function disable(callback: () => void): void;
|
|
237
|
-
export function disable(tabId: number, callback: () => void): void;
|
|
228
|
+
export function disable(tabId: number | undefined, callback: () => void): void;
|
|
238
229
|
|
|
239
230
|
/**
|
|
240
|
-
* @since Chrome 88
|
|
241
231
|
* Enables the action for a tab. By default, actions are enabled.
|
|
242
|
-
* @param tabId The
|
|
243
|
-
*
|
|
232
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
233
|
+
*
|
|
234
|
+
* Can return its result via Promise.
|
|
244
235
|
*/
|
|
245
236
|
export function enable(tabId?: number): Promise<void>;
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* @since Chrome 88
|
|
249
|
-
* Enables the action for a tab. By default, actions are enabled.
|
|
250
|
-
* @param tabId The id of the tab for which you want to modify the action.
|
|
251
|
-
* @param callback
|
|
252
|
-
*/
|
|
253
237
|
export function enable(callback: () => void): void;
|
|
254
|
-
export function enable(tabId: number, callback: () => void): void;
|
|
238
|
+
export function enable(tabId: number | undefined, callback: () => void): void;
|
|
255
239
|
|
|
256
240
|
/**
|
|
257
|
-
* @since Chrome 88
|
|
258
|
-
* Gets the background color of the action.
|
|
259
|
-
*/
|
|
260
|
-
export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
|
|
261
|
-
/**
|
|
262
|
-
* @since Chrome 88
|
|
263
241
|
* Gets the background color of the action.
|
|
264
|
-
*
|
|
242
|
+
*
|
|
243
|
+
* Can return its result via Promise.
|
|
265
244
|
*/
|
|
266
245
|
export function getBadgeBackgroundColor(details: TabDetails): Promise<ColorArray>;
|
|
246
|
+
export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
|
|
267
247
|
|
|
268
248
|
/**
|
|
269
|
-
* @
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.
|
|
273
|
-
*/
|
|
274
|
-
export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* @since Chrome 88
|
|
278
|
-
* Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned.
|
|
279
|
-
* If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the
|
|
280
|
-
* declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.
|
|
281
|
-
* @return The `getBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only).
|
|
249
|
+
* Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned. If {@link declarativeNetRequest.ExtensionActionOptions.displayActionCountAsBadgeText displayActionCountAsBadgeText} is enabled, a placeholder text will be returned unless the {@link runtime.ManifestPermissions declarativeNetRequestFeedback} permission is present or tab-specific badge text was provided.
|
|
250
|
+
*
|
|
251
|
+
* Can return its result via Promise.
|
|
282
252
|
*/
|
|
283
253
|
export function getBadgeText(details: TabDetails): Promise<string>;
|
|
254
|
+
export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
|
|
284
255
|
|
|
285
256
|
/**
|
|
286
|
-
* @since Chrome 110
|
|
287
257
|
* Gets the text color of the action.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
/**
|
|
258
|
+
*
|
|
259
|
+
* Can return its result via Promise.
|
|
292
260
|
* @since Chrome 110
|
|
293
|
-
* Gets the text color of the action.
|
|
294
|
-
* @return The `getBadgeTextColor` method provides its result via callback or returned as a `Promise` (MV3 only).
|
|
295
261
|
*/
|
|
296
262
|
export function getBadgeTextColor(details: TabDetails): Promise<ColorArray>;
|
|
263
|
+
export function getBadgeTextColor(details: TabDetails, callback: (result: ColorArray) => void): void;
|
|
297
264
|
|
|
298
265
|
/**
|
|
299
|
-
* @since Chrome 88
|
|
300
|
-
* Gets the html document set as the popup for this action.
|
|
301
|
-
*/
|
|
302
|
-
export function getPopup(details: TabDetails, callback: (result: string) => void): void;
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* @since Chrome 88
|
|
306
266
|
* Gets the html document set as the popup for this action.
|
|
307
|
-
*
|
|
267
|
+
*
|
|
268
|
+
* Can return its result via Promise.
|
|
308
269
|
*/
|
|
309
270
|
export function getPopup(details: TabDetails): Promise<string>;
|
|
271
|
+
export function getPopup(details: TabDetails, callback: (result: string) => void): void;
|
|
310
272
|
|
|
311
273
|
/**
|
|
312
|
-
* @since Chrome 88
|
|
313
|
-
* Gets the title of the action.
|
|
314
|
-
*/
|
|
315
|
-
export function getTitle(details: TabDetails, callback: (result: string) => void): void;
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* @since Chrome 88
|
|
319
274
|
* Gets the title of the action.
|
|
320
|
-
*
|
|
275
|
+
*
|
|
276
|
+
* Can return its result via Promise.
|
|
321
277
|
*/
|
|
322
278
|
export function getTitle(details: TabDetails): Promise<string>;
|
|
279
|
+
export function getTitle(details: TabDetails, callback: (result: string) => void): void;
|
|
323
280
|
|
|
324
281
|
/**
|
|
325
|
-
* @since Chrome 91
|
|
326
282
|
* Returns the user-specified settings relating to an extension's action.
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
/**
|
|
283
|
+
*
|
|
284
|
+
* Can return its result via Promise.
|
|
331
285
|
* @since Chrome 91
|
|
332
|
-
* Returns the user-specified settings relating to an extension's action.
|
|
333
|
-
* @return The `getUserSettings` method provides its result via callback or returned as a `Promise` (MV3 only).
|
|
334
286
|
*/
|
|
335
287
|
export function getUserSettings(): Promise<UserSettings>;
|
|
288
|
+
export function getUserSettings(callback: (userSettings: UserSettings) => void): void;
|
|
336
289
|
|
|
337
290
|
/**
|
|
291
|
+
* Indicates whether the extension action is enabled for a tab (or globally if no `tabId` is provided). Actions enabled using only {@link declarativeContent} always return false.
|
|
292
|
+
*
|
|
293
|
+
* Can return its result via Promise.
|
|
338
294
|
* @since Chrome 110
|
|
339
|
-
* Indicates whether the extension action is enabled for a tab (or globally if no tabId is provided). Actions enabled using only declarativeContent always return false.
|
|
340
|
-
*/
|
|
341
|
-
export function isEnabled(tabId: number | undefined, callback: (isEnabled: boolean) => void): void;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* @since Chrome 110
|
|
345
|
-
* Indicates whether the extension action is enabled for a tab (or globally if no tabId is provided). Actions enabled using only declarativeContent always return false.
|
|
346
|
-
* @return True if the extension action is enabled.
|
|
347
295
|
*/
|
|
348
296
|
export function isEnabled(tabId?: number): Promise<boolean>;
|
|
297
|
+
export function isEnabled(callback: (isEnabled: boolean) => void): void;
|
|
298
|
+
export function isEnabled(tabId: number | undefined, callback: (isEnabled: boolean) => void): void;
|
|
349
299
|
|
|
350
300
|
/**
|
|
351
|
-
*
|
|
352
|
-
*
|
|
301
|
+
* Opens the extension's popup. Between Chrome 118 and Chrome 126, this is only available to policy installed extensions.
|
|
302
|
+
*
|
|
353
303
|
* @param options Specifies options for opening the popup.
|
|
354
|
-
*
|
|
355
|
-
*
|
|
304
|
+
*
|
|
305
|
+
* Can return its result via Promise.
|
|
306
|
+
* @since Chrome 127
|
|
356
307
|
*/
|
|
357
308
|
export function openPopup(options?: OpenPopupOptions): Promise<void>;
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* @since Chrome 99
|
|
361
|
-
* Opens the extension's popup.
|
|
362
|
-
* @param options Specifies options for opening the popup.
|
|
363
|
-
*/
|
|
364
309
|
export function openPopup(callback: () => void): void;
|
|
365
|
-
export function openPopup(options: OpenPopupOptions, callback: () => void): void;
|
|
310
|
+
export function openPopup(options: OpenPopupOptions | undefined, callback: () => void): void;
|
|
366
311
|
|
|
367
312
|
/**
|
|
368
|
-
* @since Chrome 88
|
|
369
313
|
* Sets the background color for the badge.
|
|
370
|
-
*
|
|
314
|
+
*
|
|
315
|
+
* Can return its result via Promise.
|
|
371
316
|
*/
|
|
372
317
|
export function setBadgeBackgroundColor(details: BadgeColorDetails): Promise<void>;
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* @since Chrome 88
|
|
376
|
-
* Sets the background color for the badge.
|
|
377
|
-
*/
|
|
378
318
|
export function setBadgeBackgroundColor(details: BadgeColorDetails, callback: () => void): void;
|
|
379
319
|
|
|
380
320
|
/**
|
|
381
|
-
* @since Chrome 88
|
|
382
321
|
* Sets the badge text for the action. The badge is displayed on top of the icon.
|
|
383
|
-
*
|
|
322
|
+
*
|
|
323
|
+
* Can return its result via Promise.
|
|
384
324
|
*/
|
|
385
325
|
export function setBadgeText(details: BadgeTextDetails): Promise<void>;
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* @since Chrome 88
|
|
389
|
-
* Sets the badge text for the action. The badge is displayed on top of the icon.
|
|
390
|
-
*/
|
|
391
326
|
export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
|
|
392
327
|
|
|
393
328
|
/**
|
|
394
|
-
* @since Chrome 110
|
|
395
329
|
* Sets the text color for the badge.
|
|
396
|
-
*
|
|
330
|
+
*
|
|
331
|
+
* Can return its result via Promise.
|
|
332
|
+
* @since Chrome 110
|
|
397
333
|
*/
|
|
398
334
|
export function setBadgeTextColor(details: BadgeColorDetails): Promise<void>;
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* @since Chrome 100
|
|
402
|
-
* Sets the text color for the badge.
|
|
403
|
-
*/
|
|
404
335
|
export function setBadgeTextColor(details: BadgeColorDetails, callback: () => void): void;
|
|
405
336
|
|
|
406
337
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
* @return The `setIcon` method provides its result via callback or returned as a `Promise` (MV3 only). Since Chrome 96.
|
|
338
|
+
* Sets the icon for the action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
|
|
339
|
+
*
|
|
340
|
+
* Can return its result via Promise.
|
|
411
341
|
*/
|
|
412
342
|
export function setIcon(details: TabIconDetails): Promise<void>;
|
|
413
343
|
export function setIcon(details: TabIconDetails, callback: () => void): void;
|
|
414
344
|
|
|
415
345
|
/**
|
|
416
|
-
* @since Chrome 88
|
|
417
346
|
* Sets the html document to be opened as a popup when the user clicks on the action's icon.
|
|
418
|
-
*
|
|
347
|
+
*
|
|
348
|
+
* Can return its result via Promise.
|
|
419
349
|
*/
|
|
420
350
|
export function setPopup(details: PopupDetails): Promise<void>;
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* @since Chrome 88
|
|
424
|
-
* Sets the html document to be opened as a popup when the user clicks on the action's icon.
|
|
425
|
-
*/
|
|
426
351
|
export function setPopup(details: PopupDetails, callback: () => void): void;
|
|
427
352
|
|
|
428
353
|
/**
|
|
429
|
-
* @since Chrome 88
|
|
430
354
|
* Sets the title of the action. This shows up in the tooltip.
|
|
431
|
-
*
|
|
355
|
+
*
|
|
356
|
+
* Can return its result via Promise.
|
|
432
357
|
*/
|
|
433
358
|
export function setTitle(details: TitleDetails): Promise<void>;
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* @since Chrome 88
|
|
437
|
-
* Sets the title of the action. This shows up in the tooltip.
|
|
438
|
-
*/
|
|
439
359
|
export function setTitle(details: TitleDetails, callback: () => void): void;
|
|
440
360
|
|
|
441
361
|
/** Fired when an action icon is clicked. This event will not fire if the action has a popup. */
|
|
442
|
-
export const onClicked:
|
|
362
|
+
export const onClicked: events.Event<(tab: Browser.tabs.Tab) => void>;
|
|
443
363
|
|
|
444
364
|
/**
|
|
445
365
|
* Fired when user-specified settings relating to an extension's action change.
|
|
446
366
|
* @since Chrome 130
|
|
447
367
|
*/
|
|
448
|
-
export const onUserSettingsChanged:
|
|
368
|
+
export const onUserSettingsChanged: events.Event<(change: UserSettingsChange) => void>;
|
|
449
369
|
}
|
|
450
370
|
|
|
451
371
|
////////////////////
|
|
@@ -1465,6 +1385,246 @@ export namespace Browser {
|
|
|
1465
1385
|
export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
|
|
1466
1386
|
}
|
|
1467
1387
|
|
|
1388
|
+
////////////////////
|
|
1389
|
+
// Certificate Provider
|
|
1390
|
+
////////////////////
|
|
1391
|
+
/**
|
|
1392
|
+
* Use this API to expose certificates to the platform which can use these certificates for TLS authentications.
|
|
1393
|
+
*
|
|
1394
|
+
* Manifest: "certificateProvider"
|
|
1395
|
+
* @platform ChromeOS only
|
|
1396
|
+
* @since Chrome 46
|
|
1397
|
+
*/
|
|
1398
|
+
export namespace certificateProvider {
|
|
1399
|
+
/** Types of supported cryptographic signature algorithms. */
|
|
1400
|
+
export enum Algorithm {
|
|
1401
|
+
/**
|
|
1402
|
+
* Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the MD5-SHA-1 hashing. The extension must not prepend a DigestInfo prefix but only add PKCS#1 padding.
|
|
1403
|
+
* @deprecated This algorithm is deprecated and will never be requested by Chrome as of version 109.
|
|
1404
|
+
*/
|
|
1405
|
+
RSASSA_PKCS1_V1_5_MD5_SHA1 = "RSASSA_PKCS1_v1_5_MD5_SHA1",
|
|
1406
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-1 hash function. */
|
|
1407
|
+
RSASSA_PKCS1_V1_5_SHA1 = "RSASSA_PKCS1_v1_5_SHA1",
|
|
1408
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-256 hashing function. */
|
|
1409
|
+
RSASSA_PKCS1_V1_5_SHA256 = "RSASSA_PKCS1_v1_5_SHA256",
|
|
1410
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-384 hashing function. */
|
|
1411
|
+
RSASSA_PKCS1_V1_5_SHA384 = "RSASSA_PKCS1_v1_5_SHA384",
|
|
1412
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-512 hashing function. */
|
|
1413
|
+
RSASSA_PKCS1_V1_5_SHA512 = "RSASSA_PKCS1_v1_5_SHA512",
|
|
1414
|
+
/** Specifies the RSASSA PSS signature algorithm with the SHA-256 hashing function, MGF1 mask generation function and the salt of the same size as the hash. */
|
|
1415
|
+
RSASSA_PSS_SHA256 = "RSASSA_PSS_SHA256",
|
|
1416
|
+
/** Specifies the RSASSA PSS signature algorithm with the SHA-384 hashing function, MGF1 mask generation function and the salt of the same size as the hash. */
|
|
1417
|
+
RSASSA_PSS_SHA384 = "RSASSA_PSS_SHA384",
|
|
1418
|
+
/** Specifies the RSASSA PSS signature algorithm with the SHA-512 hashing function, MGF1 mask generation function and the salt of the same size as the hash. */
|
|
1419
|
+
RSASSA_PSS_SHA512 = "RSASSA_PSS_SHA512",
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
export interface CertificateInfo {
|
|
1423
|
+
/** Must be the DER encoding of a X.509 certificate. Currently, only certificates of RSA keys are supported. */
|
|
1424
|
+
certificate: ArrayBuffer;
|
|
1425
|
+
/** Must be set to all hashes supported for this certificate. This extension will only be asked for signatures of digests calculated with one of these hash algorithms. This should be in order of decreasing hash preference. */
|
|
1426
|
+
supportedHashes: `${Hash}`[];
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/** @since Chrome 86 */
|
|
1430
|
+
export interface CertificatesUpdateRequest {
|
|
1431
|
+
/** Request identifier to be passed to {@link setCertificates}. */
|
|
1432
|
+
certificatesRequestId: number;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
/** @since Chrome 86 */
|
|
1436
|
+
export interface ClientCertificateInfo {
|
|
1437
|
+
/**
|
|
1438
|
+
* The array must contain the DER encoding of the X.509 client certificate as its first element.
|
|
1439
|
+
*
|
|
1440
|
+
* This must include exactly one certificate.
|
|
1441
|
+
*/
|
|
1442
|
+
certificateChain: ArrayBuffer[];
|
|
1443
|
+
/** All algorithms supported for this certificate. The extension will only be asked for signatures using one of these algorithms. */
|
|
1444
|
+
supportedAlgorithms: `${Algorithm}`[];
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* Types of errors that the extension can report.
|
|
1449
|
+
* @since Chrome 86
|
|
1450
|
+
*/
|
|
1451
|
+
export enum Error {
|
|
1452
|
+
GENERAL_ERROR = "GENERAL_ERROR",
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/** @deprecated Replaced by {@link Algorithm}.*/
|
|
1456
|
+
export enum Hash {
|
|
1457
|
+
/** Specifies the MD5 and SHA1 hashing algorithms. */
|
|
1458
|
+
MD5_SHA1 = "MD5_SHA1",
|
|
1459
|
+
/** Specifies the SHA1 hashing algorithm. */
|
|
1460
|
+
SHA1 = "SHA1",
|
|
1461
|
+
/** Specifies the SHA256 hashing algorithm. */
|
|
1462
|
+
SHA256 = "SHA256",
|
|
1463
|
+
/** Specifies the SHA384 hashing algorithm. */
|
|
1464
|
+
SHA384 = "SHA384",
|
|
1465
|
+
/** Specifies the SHA512 hashing algorithm. */
|
|
1466
|
+
SHA512 = "SHA512",
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* The types of errors that can be presented to the user through the requestPin function.
|
|
1471
|
+
* @since Chrome 57
|
|
1472
|
+
*/
|
|
1473
|
+
export enum PinRequestErrorType {
|
|
1474
|
+
/** Specifies the PIN is invalid. */
|
|
1475
|
+
INVALID_PIN = "INVALID_PIN",
|
|
1476
|
+
/** Specifies the PUK is invalid. */
|
|
1477
|
+
INVALID_PUK = "INVALID_PUK",
|
|
1478
|
+
/** Specifies the maximum attempt number has been exceeded. */
|
|
1479
|
+
MAX_ATTEMPTS_EXCEEDED = "MAX_ATTEMPTS_EXCEEDED",
|
|
1480
|
+
/** Specifies that the error cannot be represented by the above types. */
|
|
1481
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
/**
|
|
1485
|
+
* The type of code being requested by the extension with requestPin function.
|
|
1486
|
+
* @since Chrome 57
|
|
1487
|
+
*/
|
|
1488
|
+
export enum PinRequestType {
|
|
1489
|
+
/** Specifies the requested code is a PIN. */
|
|
1490
|
+
PIN = "PIN",
|
|
1491
|
+
/** Specifies the requested code is a PUK. */
|
|
1492
|
+
PUK = "PUK",
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/** @since Chrome 57 */
|
|
1496
|
+
export interface PinResponseDetails {
|
|
1497
|
+
/** The code provided by the user. Empty if user closed the dialog or some other error occurred. */
|
|
1498
|
+
userInput?: string | undefined;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
/** @since Chrome 86 */
|
|
1502
|
+
export interface ReportSignatureDetails {
|
|
1503
|
+
/** Error that occurred while generating the signature, if any. */
|
|
1504
|
+
error?: `${Error}` | undefined;
|
|
1505
|
+
/** Request identifier that was received via the {@link onSignatureRequested} event. */
|
|
1506
|
+
signRequestId: number;
|
|
1507
|
+
/** The signature, if successfully generated. */
|
|
1508
|
+
signature?: ArrayBuffer | undefined;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/** @since Chrome 57 */
|
|
1512
|
+
export interface RequestPinDetails {
|
|
1513
|
+
/** The number of attempts left. This is provided so that any UI can present this information to the user. Chrome is not expected to enforce this, instead stopPinRequest should be called by the extension with errorType = MAX_ATTEMPTS_EXCEEDED when the number of pin requests is exceeded. */
|
|
1514
|
+
attemptsLeft?: number | undefined;
|
|
1515
|
+
/** The error template displayed to the user. This should be set if the previous request failed, to notify the user of the failure reason. */
|
|
1516
|
+
errorType?: `${PinRequestErrorType}` | undefined;
|
|
1517
|
+
/** The type of code requested. Default is PIN. */
|
|
1518
|
+
requestType?: `${PinRequestType}` | undefined;
|
|
1519
|
+
/** The ID given by Chrome in SignRequest. */
|
|
1520
|
+
signRequestId: number;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
/** @since Chrome 86 */
|
|
1524
|
+
export interface SetCertificatesDetails {
|
|
1525
|
+
/** When called in response to {@link onCertificatesUpdateRequested}, should contain the received `certificatesRequestId` value. Otherwise, should be unset. */
|
|
1526
|
+
certificatesRequestId?: number | undefined;
|
|
1527
|
+
/** List of currently available client certificates. */
|
|
1528
|
+
clientCertificates: ClientCertificateInfo[];
|
|
1529
|
+
/** Error that occurred while extracting the certificates, if any. This error will be surfaced to the user when appropriate. */
|
|
1530
|
+
error?: `${Error}` | undefined;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
/** @since Chrome 86 */
|
|
1534
|
+
export interface SignatureRequest {
|
|
1535
|
+
/** Signature algorithm to be used. */
|
|
1536
|
+
algorithm: `${Algorithm}`;
|
|
1537
|
+
/** The DER encoding of a X.509 certificate. The extension must sign `input` using the associated private key. */
|
|
1538
|
+
certificate: ArrayBuffer;
|
|
1539
|
+
/** Data to be signed. Note that the data is not hashed. */
|
|
1540
|
+
input: ArrayBuffer;
|
|
1541
|
+
/** Request identifier to be passed to {@link reportSignature}. */
|
|
1542
|
+
signRequestId: number;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
export interface SignRequest {
|
|
1546
|
+
/** The DER encoding of a X.509 certificate. The extension must sign `digest` using the associated private key. */
|
|
1547
|
+
certificate: ArrayBuffer;
|
|
1548
|
+
/** The digest that must be signed. */
|
|
1549
|
+
digest: ArrayBuffer;
|
|
1550
|
+
/** Refers to the hash algorithm that was used to create `digest`. */
|
|
1551
|
+
hash: `${Hash}`;
|
|
1552
|
+
/**
|
|
1553
|
+
* The unique ID to be used by the extension should it need to call a method that requires it, e.g. requestPin.
|
|
1554
|
+
* @since Chrome 57
|
|
1555
|
+
*/
|
|
1556
|
+
signRequestId: number;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
/** @since Chrome 57 */
|
|
1560
|
+
export interface StopPinRequestDetails {
|
|
1561
|
+
/** The error template. If present it is displayed to user. Intended to contain the reason for stopping the flow if it was caused by an error, e.g. MAX\_ATTEMPTS\_EXCEEDED. */
|
|
1562
|
+
errorType?: `${PinRequestErrorType}` | undefined;
|
|
1563
|
+
/** The ID given by Chrome in SignRequest. */
|
|
1564
|
+
signRequestId: number;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* Should be called as a response to {@link onSignatureRequested}.
|
|
1569
|
+
*
|
|
1570
|
+
* The extension must eventually call this function for every {@link onSignatureRequested} event; the API implementation will stop waiting for this call after some time and respond with a timeout error when this function is called.
|
|
1571
|
+
*
|
|
1572
|
+
* Can return its result via Promise since Chrome 96.
|
|
1573
|
+
* @since Chrome 86
|
|
1574
|
+
*/
|
|
1575
|
+
export function reportSignature(details: ReportSignatureDetails): Promise<void>;
|
|
1576
|
+
export function reportSignature(details: ReportSignatureDetails, callback: () => void): void;
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* Requests the PIN from the user. Only one ongoing request at a time is allowed. The requests issued while another flow is ongoing are rejected. It's the extension's responsibility to try again later if another flow is in progress.
|
|
1580
|
+
*
|
|
1581
|
+
* Can return its result via Promise since Chrome 96.
|
|
1582
|
+
* @param details Contains the details about the requested dialog.
|
|
1583
|
+
* @since Chrome 57
|
|
1584
|
+
*/
|
|
1585
|
+
export function requestPin(details: RequestPinDetails): Promise<PinResponseDetails | undefined>;
|
|
1586
|
+
export function requestPin(
|
|
1587
|
+
details: RequestPinDetails,
|
|
1588
|
+
callback: (details?: PinResponseDetails | undefined) => void,
|
|
1589
|
+
): void;
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* Sets a list of certificates to use in the browser.
|
|
1593
|
+
*
|
|
1594
|
+
* The extension should call this function after initialization and on every change in the set of currently available certificates. The extension should also call this function in response to {@link onCertificatesUpdateRequested} every time this event is received.
|
|
1595
|
+
*
|
|
1596
|
+
* Can return its result via Promise since Chrome 96.
|
|
1597
|
+
* @param details The certificates to set. Invalid certificates will be ignored.
|
|
1598
|
+
* @since Chrome 86
|
|
1599
|
+
*/
|
|
1600
|
+
export function setCertificates(details: SetCertificatesDetails): Promise<void>;
|
|
1601
|
+
export function setCertificates(details: SetCertificatesDetails, callback: () => void): void;
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* Stops the pin request started by the {@link requestPin} function.
|
|
1605
|
+
*
|
|
1606
|
+
* Can return its result via Promise since Chrome 96.
|
|
1607
|
+
* @param details Contains the details about the reason for stopping the request flow.
|
|
1608
|
+
* @since Chrome 57
|
|
1609
|
+
*/
|
|
1610
|
+
export function stopPinRequest(details: StopPinRequestDetails): Promise<void>;
|
|
1611
|
+
export function stopPinRequest(details: StopPinRequestDetails, callback: () => void): void;
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* This event fires if the certificates set via {@link setCertificates} are insufficient or the browser requests updated information. The extension must call {@link setCertificates} with the updated list of certificates and the received `certificatesRequestId`.
|
|
1615
|
+
* @since Chrome 86
|
|
1616
|
+
*/
|
|
1617
|
+
export const onCertificatesUpdateRequested: events.Event<(request: CertificatesUpdateRequest) => void>;
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* This event fires every time the browser needs to sign a message using a certificate provided by this extension via {@link setCertificates}.
|
|
1621
|
+
*
|
|
1622
|
+
* The extension must sign the input data from `request` using the appropriate algorithm and private key and return it by calling {@link reportSignature} with the received `signRequestId`.
|
|
1623
|
+
* @since Chrome 86
|
|
1624
|
+
*/
|
|
1625
|
+
export const onSignatureRequested: events.Event<(request: SignatureRequest) => void>;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1468
1628
|
////////////////////
|
|
1469
1629
|
// Commands
|
|
1470
1630
|
////////////////////
|
|
@@ -4499,6 +4659,84 @@ export namespace Browser {
|
|
|
4499
4659
|
export var onRequestExternal: OnRequestEvent;
|
|
4500
4660
|
}
|
|
4501
4661
|
|
|
4662
|
+
////////////////////
|
|
4663
|
+
// Extension Types
|
|
4664
|
+
////////////////////
|
|
4665
|
+
/** The `Browser.extensionTypes` API contains type declarations for Chrome extensions. */
|
|
4666
|
+
export namespace extensionTypes {
|
|
4667
|
+
/**
|
|
4668
|
+
* The origin of injected CSS.
|
|
4669
|
+
* @since Chrome 66
|
|
4670
|
+
*/
|
|
4671
|
+
export type CSSOrigin = "author" | "user";
|
|
4672
|
+
|
|
4673
|
+
/**
|
|
4674
|
+
* The document lifecycle of the frame.
|
|
4675
|
+
* @since Chrome 106
|
|
4676
|
+
*/
|
|
4677
|
+
export type DocumentLifecycle = "prerender" | "active" | "cached" | "pending_deletion";
|
|
4678
|
+
|
|
4679
|
+
/**
|
|
4680
|
+
* The type of frame.
|
|
4681
|
+
* @since Chrome 106
|
|
4682
|
+
*/
|
|
4683
|
+
export type FrameType = "outermost_frame" | "fenced_frame" | "sub_frame";
|
|
4684
|
+
|
|
4685
|
+
/** Details about the format and quality of an image. */
|
|
4686
|
+
export interface ImageDetails {
|
|
4687
|
+
/** The format of the resulting image. Default is `"jpeg"`. */
|
|
4688
|
+
format?: ImageFormat | undefined;
|
|
4689
|
+
/** When format is `"jpeg"`, controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. */
|
|
4690
|
+
quality?: number | undefined;
|
|
4691
|
+
}
|
|
4692
|
+
|
|
4693
|
+
/**
|
|
4694
|
+
* The format of an image.
|
|
4695
|
+
* @since Chrome 44
|
|
4696
|
+
*/
|
|
4697
|
+
export type ImageFormat = "jpeg" | "png";
|
|
4698
|
+
|
|
4699
|
+
/** Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. */
|
|
4700
|
+
export interface InjectDetails {
|
|
4701
|
+
/** If allFrames is `true`, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's `false` and is only injected into the top frame. If `true` and `frameId` is set, then the code is inserted in the selected frame and all of its child frames. */
|
|
4702
|
+
allFrames?: boolean | undefined;
|
|
4703
|
+
/**
|
|
4704
|
+
* JavaScript or CSS code to inject.
|
|
4705
|
+
*
|
|
4706
|
+
* **Warning:** Be careful using the `code` parameter. Incorrect use of it may open your extension to cross site scripting attacks
|
|
4707
|
+
*/
|
|
4708
|
+
code?: string | undefined;
|
|
4709
|
+
/**
|
|
4710
|
+
* The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to `"author"`.
|
|
4711
|
+
* @since Chrome 66
|
|
4712
|
+
*/
|
|
4713
|
+
cssOrigin?: CSSOrigin | undefined;
|
|
4714
|
+
/** JavaScript or CSS file to inject. */
|
|
4715
|
+
file?: string | undefined;
|
|
4716
|
+
/**
|
|
4717
|
+
* The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame).
|
|
4718
|
+
* @since Chrome 50
|
|
4719
|
+
*/
|
|
4720
|
+
frameId?: number | undefined;
|
|
4721
|
+
/** If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is `false`. */
|
|
4722
|
+
matchAboutBlank?: boolean;
|
|
4723
|
+
/** The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". */
|
|
4724
|
+
runAt?: RunAt | undefined;
|
|
4725
|
+
}
|
|
4726
|
+
|
|
4727
|
+
/**
|
|
4728
|
+
* The soonest that the JavaScript or CSS will be injected into the tab.
|
|
4729
|
+
*
|
|
4730
|
+
* "document_start" : Script is injected after any files from css, but before any other DOM is constructed or any other script is run.
|
|
4731
|
+
*
|
|
4732
|
+
* "document_end" : Script is injected immediately after the DOM is complete, but before subresources like images and frames have loaded.
|
|
4733
|
+
*
|
|
4734
|
+
* "document_idle" : The browser chooses a time to inject the script between "document_end" and immediately after the `window.onload` event fires. The exact moment of injection depends on how complex the document is and how long it is taking to load, and is optimized for page load speed. Content scripts running at "document_idle" don't need to listen for the `window.onload` event; they are guaranteed to run after the DOM completes. If a script definitely needs to run after `window.onload`, the extension can check if `onload` has already fired by using the `document.readyState` property.
|
|
4735
|
+
* @since Chrome 44
|
|
4736
|
+
*/
|
|
4737
|
+
export type RunAt = "document_start" | "document_end" | "document_idle";
|
|
4738
|
+
}
|
|
4739
|
+
|
|
4502
4740
|
////////////////////
|
|
4503
4741
|
// File Browser Handler
|
|
4504
4742
|
////////////////////
|
|
@@ -8708,9 +8946,6 @@ export namespace Browser {
|
|
|
8708
8946
|
export function addListener(callback: (info: OnReceiveErrorInfo) => void): void;
|
|
8709
8947
|
}
|
|
8710
8948
|
|
|
8711
|
-
type DocumentLifecycle = "prerender" | "active" | "cached" | "pending_deletion";
|
|
8712
|
-
type FrameType = "outermost_frame" | "fenced_frame" | "sub_frame";
|
|
8713
|
-
|
|
8714
8949
|
////////////////////
|
|
8715
8950
|
// Runtime
|
|
8716
8951
|
////////////////////
|
|
@@ -8866,7 +9101,7 @@ export namespace Browser {
|
|
|
8866
9101
|
* The lifecycle the document that opened the connection is in at the time the port was created. Note that the lifecycle state of the document may have changed since port creation.
|
|
8867
9102
|
* @since Chrome 106
|
|
8868
9103
|
*/
|
|
8869
|
-
documentLifecycle?: DocumentLifecycle | undefined;
|
|
9104
|
+
documentLifecycle?: extensionTypes.DocumentLifecycle | undefined;
|
|
8870
9105
|
/**
|
|
8871
9106
|
* A UUID of the document that opened the connection.
|
|
8872
9107
|
* @since Chrome 106
|
|
@@ -9700,7 +9935,7 @@ export namespace Browser {
|
|
|
9700
9935
|
js?: string[];
|
|
9701
9936
|
matches?: string[];
|
|
9702
9937
|
persistAcrossSessions?: boolean;
|
|
9703
|
-
runAt?:
|
|
9938
|
+
runAt?: extensionTypes.RunAt;
|
|
9704
9939
|
world?: ExecutionWorld;
|
|
9705
9940
|
}
|
|
9706
9941
|
|
|
@@ -11145,45 +11380,6 @@ export namespace Browser {
|
|
|
11145
11380
|
defaultZoomFactor?: number | undefined;
|
|
11146
11381
|
}
|
|
11147
11382
|
|
|
11148
|
-
export interface InjectDetails {
|
|
11149
|
-
/**
|
|
11150
|
-
* Optional.
|
|
11151
|
-
* If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame.
|
|
11152
|
-
*/
|
|
11153
|
-
allFrames?: boolean | undefined;
|
|
11154
|
-
/**
|
|
11155
|
-
* Optional. JavaScript or CSS code to inject.
|
|
11156
|
-
* Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks.
|
|
11157
|
-
*/
|
|
11158
|
-
code?: string | undefined;
|
|
11159
|
-
/**
|
|
11160
|
-
* Optional. The soonest that the JavaScript or CSS will be injected into the tab.
|
|
11161
|
-
* One of: "document_start", "document_end", or "document_idle"
|
|
11162
|
-
* @since Chrome 20
|
|
11163
|
-
*/
|
|
11164
|
-
runAt?: string | undefined;
|
|
11165
|
-
/** Optional. JavaScript or CSS file to inject. */
|
|
11166
|
-
file?: string | undefined;
|
|
11167
|
-
/**
|
|
11168
|
-
* Optional.
|
|
11169
|
-
* The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame).
|
|
11170
|
-
* @since Chrome 39
|
|
11171
|
-
*/
|
|
11172
|
-
frameId?: number | undefined;
|
|
11173
|
-
/**
|
|
11174
|
-
* Optional.
|
|
11175
|
-
* If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false.
|
|
11176
|
-
* @since Chrome 39
|
|
11177
|
-
*/
|
|
11178
|
-
matchAboutBlank?: boolean | undefined;
|
|
11179
|
-
/**
|
|
11180
|
-
* Optional. The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to "author".
|
|
11181
|
-
* One of: "author", or "user"
|
|
11182
|
-
* @since Chrome 66
|
|
11183
|
-
*/
|
|
11184
|
-
cssOrigin?: string | undefined;
|
|
11185
|
-
}
|
|
11186
|
-
|
|
11187
11383
|
export interface CreateProperties {
|
|
11188
11384
|
/** Optional. The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. */
|
|
11189
11385
|
index?: number | undefined;
|
|
@@ -11265,19 +11461,6 @@ export namespace Browser {
|
|
|
11265
11461
|
autoDiscardable?: boolean | undefined;
|
|
11266
11462
|
}
|
|
11267
11463
|
|
|
11268
|
-
export interface CaptureVisibleTabOptions {
|
|
11269
|
-
/**
|
|
11270
|
-
* Optional.
|
|
11271
|
-
* When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease.
|
|
11272
|
-
*/
|
|
11273
|
-
quality?: number | undefined;
|
|
11274
|
-
/**
|
|
11275
|
-
* Optional. The format of an image.
|
|
11276
|
-
* One of: "jpeg", or "png"
|
|
11277
|
-
*/
|
|
11278
|
-
format?: string | undefined;
|
|
11279
|
-
}
|
|
11280
|
-
|
|
11281
11464
|
export interface ReloadProperties {
|
|
11282
11465
|
/** Optional. Whether using any local cache. Default is false. */
|
|
11283
11466
|
bypassCache?: boolean | undefined;
|
|
@@ -11540,21 +11723,21 @@ export namespace Browser {
|
|
|
11540
11723
|
* @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11541
11724
|
* @return The `executeScript` method provides its result via callback or returned as a `Promise` (MV3 only). The result of the script in every injected frame.
|
|
11542
11725
|
*/
|
|
11543
|
-
export function executeScript(details: InjectDetails): Promise<any[]>;
|
|
11726
|
+
export function executeScript(details: extensionTypes.InjectDetails): Promise<any[]>;
|
|
11544
11727
|
/**
|
|
11545
11728
|
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
|
|
11546
11729
|
* @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11547
11730
|
* @param callback Optional. Called after all the JavaScript has been executed.
|
|
11548
11731
|
* Parameter result: The result of the script in every injected frame.
|
|
11549
11732
|
*/
|
|
11550
|
-
export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void;
|
|
11733
|
+
export function executeScript(details: extensionTypes.InjectDetails, callback?: (result: any[]) => void): void;
|
|
11551
11734
|
/**
|
|
11552
11735
|
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
|
|
11553
11736
|
* @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
|
|
11554
11737
|
* @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11555
11738
|
* @return The `executeScript` method provides its result via callback or returned as a `Promise` (MV3 only). The result of the script in every injected frame.
|
|
11556
11739
|
*/
|
|
11557
|
-
export function executeScript(tabId: number, details: InjectDetails): Promise<any[]>;
|
|
11740
|
+
export function executeScript(tabId: number, details: extensionTypes.InjectDetails): Promise<any[]>;
|
|
11558
11741
|
/**
|
|
11559
11742
|
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
|
|
11560
11743
|
* @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
|
|
@@ -11562,7 +11745,11 @@ export namespace Browser {
|
|
|
11562
11745
|
* @param callback Optional. Called after all the JavaScript has been executed.
|
|
11563
11746
|
* Parameter result: The result of the script in every injected frame.
|
|
11564
11747
|
*/
|
|
11565
|
-
export function executeScript(
|
|
11748
|
+
export function executeScript(
|
|
11749
|
+
tabId: number,
|
|
11750
|
+
details: extensionTypes.InjectDetails,
|
|
11751
|
+
callback?: (result: any[]) => void,
|
|
11752
|
+
): void;
|
|
11566
11753
|
/** Retrieves details about the specified tab. */
|
|
11567
11754
|
export function get(tabId: number, callback: (tab: Tab) => void): void;
|
|
11568
11755
|
/**
|
|
@@ -11737,14 +11924,17 @@ export namespace Browser {
|
|
|
11737
11924
|
* @param options Optional. Details about the format and quality of an image.
|
|
11738
11925
|
* @return The `captureVisibleTab` method provides its result via callback or returned as a `Promise` (MV3 only). A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
|
|
11739
11926
|
*/
|
|
11740
|
-
export function captureVisibleTab(options:
|
|
11927
|
+
export function captureVisibleTab(options: extensionTypes.ImageDetails): Promise<string>;
|
|
11741
11928
|
/**
|
|
11742
11929
|
* Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
|
|
11743
11930
|
* @param options Optional. Details about the format and quality of an image.
|
|
11744
11931
|
* @param callback
|
|
11745
11932
|
* Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
|
|
11746
11933
|
*/
|
|
11747
|
-
export function captureVisibleTab(
|
|
11934
|
+
export function captureVisibleTab(
|
|
11935
|
+
options: extensionTypes.ImageDetails,
|
|
11936
|
+
callback: (dataUrl: string) => void,
|
|
11937
|
+
): void;
|
|
11748
11938
|
/**
|
|
11749
11939
|
* Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
|
|
11750
11940
|
* @param windowId Optional. The target window. Defaults to the current window.
|
|
@@ -11753,7 +11943,7 @@ export namespace Browser {
|
|
|
11753
11943
|
*/
|
|
11754
11944
|
export function captureVisibleTab(
|
|
11755
11945
|
windowId: number,
|
|
11756
|
-
options:
|
|
11946
|
+
options: extensionTypes.ImageDetails,
|
|
11757
11947
|
): Promise<string>;
|
|
11758
11948
|
/**
|
|
11759
11949
|
* Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
|
|
@@ -11764,7 +11954,7 @@ export namespace Browser {
|
|
|
11764
11954
|
*/
|
|
11765
11955
|
export function captureVisibleTab(
|
|
11766
11956
|
windowId: number,
|
|
11767
|
-
options:
|
|
11957
|
+
options: extensionTypes.ImageDetails,
|
|
11768
11958
|
callback: (dataUrl: string) => void,
|
|
11769
11959
|
): void;
|
|
11770
11960
|
/**
|
|
@@ -11881,27 +12071,27 @@ export namespace Browser {
|
|
|
11881
12071
|
* @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11882
12072
|
* @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
|
|
11883
12073
|
*/
|
|
11884
|
-
export function insertCSS(details: InjectDetails): Promise<void>;
|
|
12074
|
+
export function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
|
|
11885
12075
|
/**
|
|
11886
12076
|
* Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
|
|
11887
12077
|
* @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11888
12078
|
* @param callback Optional. Called when all the CSS has been inserted.
|
|
11889
12079
|
*/
|
|
11890
|
-
export function insertCSS(details: InjectDetails, callback: () => void): void;
|
|
12080
|
+
export function insertCSS(details: extensionTypes.InjectDetails, callback: () => void): void;
|
|
11891
12081
|
/**
|
|
11892
12082
|
* Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
|
|
11893
12083
|
* @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
|
|
11894
12084
|
* @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11895
12085
|
* @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
|
|
11896
12086
|
*/
|
|
11897
|
-
export function insertCSS(tabId: number, details: InjectDetails): Promise<void>;
|
|
12087
|
+
export function insertCSS(tabId: number, details: extensionTypes.InjectDetails): Promise<void>;
|
|
11898
12088
|
/**
|
|
11899
12089
|
* Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
|
|
11900
12090
|
* @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
|
|
11901
12091
|
* @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11902
12092
|
* @param callback Optional. Called when all the CSS has been inserted.
|
|
11903
12093
|
*/
|
|
11904
|
-
export function insertCSS(tabId: number, details: InjectDetails, callback: () => void): void;
|
|
12094
|
+
export function insertCSS(tabId: number, details: extensionTypes.InjectDetails, callback: () => void): void;
|
|
11905
12095
|
/**
|
|
11906
12096
|
* Highlights the given tabs.
|
|
11907
12097
|
* @since Chrome 16
|
|
@@ -12932,6 +13122,123 @@ export namespace Browser {
|
|
|
12932
13122
|
export function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: ArrayBuffer) => void): void;
|
|
12933
13123
|
}
|
|
12934
13124
|
|
|
13125
|
+
////////////////////
|
|
13126
|
+
// Web Authentication Proxy
|
|
13127
|
+
////////////////////
|
|
13128
|
+
/**
|
|
13129
|
+
* The `Browser.webAuthenticationProxy` API lets remote desktop software running on a remote host intercept Web Authentication API (WebAuthn) requests in order to handle them on a local client.
|
|
13130
|
+
*
|
|
13131
|
+
* Permissions: "webAuthenticationProxy"
|
|
13132
|
+
* @since Chrome 115, MV3
|
|
13133
|
+
*/
|
|
13134
|
+
export namespace webAuthenticationProxy {
|
|
13135
|
+
export interface CreateRequest {
|
|
13136
|
+
/** The `PublicKeyCredentialCreationOptions` passed to `navigator.credentials.create()`, serialized as a JSON string. The serialization format is compatible with [`PublicKeyCredential.parseCreationOptionsFromJSON()`](https://w3c.github.io/webauthn/#sctn-parseCreationOptionsFromJSON). */
|
|
13137
|
+
requestDetailsJson: string;
|
|
13138
|
+
/** An opaque identifier for the request. */
|
|
13139
|
+
requestId: number;
|
|
13140
|
+
}
|
|
13141
|
+
|
|
13142
|
+
export interface CreateResponseDetails {
|
|
13143
|
+
/** The `DOMException` yielded by the remote request, if any. */
|
|
13144
|
+
error?: DOMExceptionDetails | undefined;
|
|
13145
|
+
/** The `requestId` of the `CreateRequest`. */
|
|
13146
|
+
requestId: number;
|
|
13147
|
+
/** The `PublicKeyCredential`, yielded by the remote request, if any, serialized as a JSON string by calling [`PublicKeyCredential.toJSON()`](https://w3c.github.io/webauthn/#dom-publickeycredential-tojson). */
|
|
13148
|
+
responseJson?: string | undefined;
|
|
13149
|
+
}
|
|
13150
|
+
|
|
13151
|
+
export interface DOMExceptionDetails {
|
|
13152
|
+
name: string;
|
|
13153
|
+
message: string;
|
|
13154
|
+
}
|
|
13155
|
+
|
|
13156
|
+
export interface GetRequest {
|
|
13157
|
+
/** The `PublicKeyCredentialRequestOptions` passed to `navigator.credentials.get()`, serialized as a JSON string. The serialization format is compatible with [`PublicKeyCredential.parseRequestOptionsFromJSON()`](https://w3c.github.io/webauthn/#sctn-parseRequestOptionsFromJSON). */
|
|
13158
|
+
requestDetailsJson: string;
|
|
13159
|
+
/** An opaque identifier for the request. */
|
|
13160
|
+
requestId: number;
|
|
13161
|
+
}
|
|
13162
|
+
|
|
13163
|
+
export interface GetResponseDetails {
|
|
13164
|
+
/** The `DOMException` yielded by the remote request, if any. */
|
|
13165
|
+
error?: DOMExceptionDetails | undefined;
|
|
13166
|
+
/** The `requestId` of the `CreateRequest`. */
|
|
13167
|
+
requestId: number;
|
|
13168
|
+
/** The `PublicKeyCredential`, yielded by the remote request, if any, serialized as a JSON string by calling [`PublicKeyCredential.toJSON()`](https://w3c.github.io/webauthn/#dom-publickeycredential-tojson). */
|
|
13169
|
+
responseJson?: string | undefined;
|
|
13170
|
+
}
|
|
13171
|
+
|
|
13172
|
+
export interface IsUvpaaRequest {
|
|
13173
|
+
/** An opaque identifier for the request. */
|
|
13174
|
+
requestId: number;
|
|
13175
|
+
}
|
|
13176
|
+
|
|
13177
|
+
export interface IsUvpaaResponseDetails {
|
|
13178
|
+
isUvpaa: boolean;
|
|
13179
|
+
requestId: number;
|
|
13180
|
+
}
|
|
13181
|
+
|
|
13182
|
+
/**
|
|
13183
|
+
* Makes this extension the active Web Authentication API request proxy.
|
|
13184
|
+
*
|
|
13185
|
+
* Remote desktop extensions typically call this method after detecting attachment of a remote session to this host. Once this method returns without error, regular processing of WebAuthn requests is suspended, and events from this extension API are raised.
|
|
13186
|
+
*
|
|
13187
|
+
* This method fails with an error if a different extension is already attached.
|
|
13188
|
+
*
|
|
13189
|
+
* The attached extension must call `detach()` once the remote desktop session has ended in order to resume regular WebAuthn request processing. Extensions automatically become detached if they are unloaded.
|
|
13190
|
+
*
|
|
13191
|
+
* Refer to the `onRemoteSessionStateChange` event for signaling a change of remote session attachment from a native application to to the (possibly suspended) extension.
|
|
13192
|
+
*/
|
|
13193
|
+
export function attach(): Promise<string | undefined>;
|
|
13194
|
+
export function attach(callback: (error?: string | undefined) => void): void;
|
|
13195
|
+
|
|
13196
|
+
/** Reports the result of a `navigator.credentials.create()` call. The extension must call this for every `onCreateRequest` event it has received, unless the request was canceled (in which case, an `onRequestCanceled` event is fired). */
|
|
13197
|
+
export function completeCreateRequest(details: CreateResponseDetails): Promise<void>;
|
|
13198
|
+
export function completeCreateRequest(details: CreateResponseDetails, callback: () => void): void;
|
|
13199
|
+
|
|
13200
|
+
/** Reports the result of a `navigator.credentials.get()` call. The extension must call this for every `onGetRequest` event it has received, unless the request was canceled (in which case, an `onRequestCanceled` event is fired). */
|
|
13201
|
+
export function completeGetRequest(details: GetResponseDetails): Promise<void>;
|
|
13202
|
+
export function completeGetRequest(details: GetResponseDetails, callback: () => void): void;
|
|
13203
|
+
|
|
13204
|
+
/** Reports the result of a `PublicKeyCredential.isUserVerifyingPlatformAuthenticator()` call. The extension must call this for every `onIsUvpaaRequest` event it has received. */
|
|
13205
|
+
export function completeIsUvpaaRequest(details: IsUvpaaResponseDetails): Promise<void>;
|
|
13206
|
+
export function completeIsUvpaaRequest(details: IsUvpaaResponseDetails, callback: () => void): void;
|
|
13207
|
+
|
|
13208
|
+
/**
|
|
13209
|
+
* Removes this extension from being the active Web Authentication API request proxy.
|
|
13210
|
+
*
|
|
13211
|
+
* This method is typically called when the extension detects that a remote desktop session was terminated. Once this method returns, the extension ceases to be the active Web Authentication API request proxy.
|
|
13212
|
+
*
|
|
13213
|
+
* Refer to the `onRemoteSessionStateChange` event for signaling a change of remote session attachment from a native application to to the (possibly suspended) extension.
|
|
13214
|
+
*/
|
|
13215
|
+
export function detach(): Promise<string | undefined>;
|
|
13216
|
+
export function detach(callback: (error?: string | undefined) => void): void;
|
|
13217
|
+
|
|
13218
|
+
/** Fires when a WebAuthn `navigator.credentials.create()` call occurs. The extension must supply a response by calling `completeCreateRequest()` with the `requestId` from `requestInfo`. */
|
|
13219
|
+
export const onCreateRequest: events.Event<(requestInfo: CreateRequest) => void>;
|
|
13220
|
+
|
|
13221
|
+
/** Fires when a WebAuthn `navigator.credentials.get()` call occurs. The extension must supply a response by calling `completeGetRequest()` with the `requestId` from `requestInfo` */
|
|
13222
|
+
export const onGetRequest: events.Event<(requestInfo: GetRequest) => void>;
|
|
13223
|
+
|
|
13224
|
+
/** Fires when a `PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()` call occurs. The extension must supply a response by calling `completeIsUvpaaRequest()` with the `requestId` from `requestInfo` */
|
|
13225
|
+
export const onIsUvpaaRequest: events.Event<(requestInfo: IsUvpaaRequest) => void>;
|
|
13226
|
+
|
|
13227
|
+
/**
|
|
13228
|
+
* A native application associated with this extension can cause this event to be fired by writing to a file with a name equal to the extension's ID in a directory named `WebAuthenticationProxyRemoteSessionStateChange` inside the [default user data directory](https://chromium.googlesource.com/chromium/src/+/main/docs/user_data_dir.md#default-location)
|
|
13229
|
+
*
|
|
13230
|
+
* The contents of the file should be empty. I.e., it is not necessary to change the contents of the file in order to trigger this event.
|
|
13231
|
+
*
|
|
13232
|
+
* The native host application may use this event mechanism to signal a possible remote session state change (i.e. from detached to attached, or vice versa) while the extension service worker is possibly suspended. In the handler for this event, the extension can call the `attach()` or `detach()` API methods accordingly.
|
|
13233
|
+
*
|
|
13234
|
+
* The event listener must be registered synchronously at load time.
|
|
13235
|
+
*/
|
|
13236
|
+
export const onRemoteSessionStateChange: events.Event<() => void>;
|
|
13237
|
+
|
|
13238
|
+
/** Fires when a `onCreateRequest` or `onGetRequest` event is canceled (because the WebAuthn request was aborted by the caller, or because it timed out). When receiving this event, the extension should cancel processing of the corresponding request on the client side. Extensions cannot complete a request once it has been canceled. */
|
|
13239
|
+
export const onRequestCanceled: events.Event<(requestId: number) => void>;
|
|
13240
|
+
}
|
|
13241
|
+
|
|
12935
13242
|
////////////////////
|
|
12936
13243
|
// Web Navigation
|
|
12937
13244
|
////////////////////
|
|
@@ -12960,11 +13267,11 @@ export namespace Browser {
|
|
|
12960
13267
|
/** A UUID of the document loaded. */
|
|
12961
13268
|
documentId: string;
|
|
12962
13269
|
/** The lifecycle the document is in. */
|
|
12963
|
-
documentLifecycle: DocumentLifecycle;
|
|
13270
|
+
documentLifecycle: extensionTypes.DocumentLifecycle;
|
|
12964
13271
|
/** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */
|
|
12965
13272
|
errorOccurred: boolean;
|
|
12966
13273
|
/** The type of frame the navigation occurred in. */
|
|
12967
|
-
frameType: FrameType;
|
|
13274
|
+
frameType: extensionTypes.FrameType;
|
|
12968
13275
|
/** A UUID of the parent document owning this frame. This is not set if there is no parent. */
|
|
12969
13276
|
parentDocumentId?: string | undefined;
|
|
12970
13277
|
/** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
|
|
@@ -13003,11 +13310,11 @@ export namespace Browser {
|
|
|
13003
13310
|
/** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. */
|
|
13004
13311
|
frameId: number;
|
|
13005
13312
|
/** The type of frame the navigation occurred in. */
|
|
13006
|
-
frameType: FrameType;
|
|
13313
|
+
frameType: extensionTypes.FrameType;
|
|
13007
13314
|
/** A UUID of the document loaded. (This is not set for onBeforeNavigate callbacks.) */
|
|
13008
13315
|
documentId?: string | undefined;
|
|
13009
13316
|
/** The lifecycle the document is in. */
|
|
13010
|
-
documentLifecycle: DocumentLifecycle;
|
|
13317
|
+
documentLifecycle: extensionTypes.DocumentLifecycle;
|
|
13011
13318
|
/** A UUID of the parent document owning this frame. This is not set if there is no parent. */
|
|
13012
13319
|
parentDocumentId?: string | undefined;
|
|
13013
13320
|
/**
|
|
@@ -13290,8 +13597,8 @@ export namespace Browser {
|
|
|
13290
13597
|
/** Optional. The HTTP request headers that are going to be sent out with this request. */
|
|
13291
13598
|
requestHeaders?: HttpHeader[] | undefined;
|
|
13292
13599
|
documentId: string;
|
|
13293
|
-
documentLifecycle: DocumentLifecycle;
|
|
13294
|
-
frameType: FrameType;
|
|
13600
|
+
documentLifecycle: extensionTypes.DocumentLifecycle;
|
|
13601
|
+
frameType: extensionTypes.FrameType;
|
|
13295
13602
|
frameId: number;
|
|
13296
13603
|
initiator?: string | undefined;
|
|
13297
13604
|
parentDocumentId?: string | undefined;
|
|
@@ -13984,7 +14291,7 @@ export namespace Browser {
|
|
|
13984
14291
|
tabId: number;
|
|
13985
14292
|
|
|
13986
14293
|
/** The resource type of the request. */
|
|
13987
|
-
type: ResourceType
|
|
14294
|
+
type: `${ResourceType}`;
|
|
13988
14295
|
|
|
13989
14296
|
/** The URL of the request. */
|
|
13990
14297
|
url: string;
|
|
@@ -14026,7 +14333,7 @@ export namespace Browser {
|
|
|
14026
14333
|
responseHeaders?: ModifyHeaderInfo[] | undefined;
|
|
14027
14334
|
|
|
14028
14335
|
/** The type of action to perform. */
|
|
14029
|
-
type: RuleActionType
|
|
14336
|
+
type: `${RuleActionType}`;
|
|
14030
14337
|
}
|
|
14031
14338
|
|
|
14032
14339
|
export interface RuleCondition {
|
|
@@ -14034,7 +14341,7 @@ export namespace Browser {
|
|
|
14034
14341
|
* Specifies whether the network request is first-party or third-party to the domain from which it originated.
|
|
14035
14342
|
* If omitted, all requests are accepted.
|
|
14036
14343
|
*/
|
|
14037
|
-
domainType?: DomainType | undefined;
|
|
14344
|
+
domainType?: `${DomainType}` | undefined;
|
|
14038
14345
|
|
|
14039
14346
|
/**
|
|
14040
14347
|
* @deprecated since Chrome 101. Use initiatorDomains instead.
|
|
@@ -14121,7 +14428,7 @@ export namespace Browser {
|
|
|
14121
14428
|
* Only one of requestMethods and excludedRequestMethods should be specified.
|
|
14122
14429
|
* If neither of them is specified, all request methods are matched.
|
|
14123
14430
|
*/
|
|
14124
|
-
excludedRequestMethods?: RequestMethod[] | undefined;
|
|
14431
|
+
excludedRequestMethods?: `${RequestMethod}`[] | undefined;
|
|
14125
14432
|
|
|
14126
14433
|
/**
|
|
14127
14434
|
* List of resource types which the rule won't match.
|
|
@@ -14129,7 +14436,7 @@ export namespace Browser {
|
|
|
14129
14436
|
* and {@link Browser.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
|
|
14130
14437
|
* If neither of them is specified, all resource types except "main_frame" are blocked.
|
|
14131
14438
|
*/
|
|
14132
|
-
excludedResourceTypes?: ResourceType[] | undefined;
|
|
14439
|
+
excludedResourceTypes?: `${ResourceType}`[] | undefined;
|
|
14133
14440
|
|
|
14134
14441
|
/**
|
|
14135
14442
|
* List of {@link Browser.tabs.Tab.id} which the rule should not match.
|
|
@@ -14160,7 +14467,7 @@ export namespace Browser {
|
|
|
14160
14467
|
* Note: Specifying a {@link Browser.declarativeNetRequest.RuleCondition.requestMethods} rule condition will also exclude non-HTTP(s) requests,
|
|
14161
14468
|
* whereas specifying {@link Browser.declarativeNetRequest.RuleCondition.excludedRequestMethods} will not.
|
|
14162
14469
|
*/
|
|
14163
|
-
requestMethods?: RequestMethod[];
|
|
14470
|
+
requestMethods?: `${RequestMethod}`[] | undefined;
|
|
14164
14471
|
|
|
14165
14472
|
/**
|
|
14166
14473
|
* List of {@link Browser.tabs.Tab.id} which the rule should not match.
|
|
@@ -14202,7 +14509,7 @@ export namespace Browser {
|
|
|
14202
14509
|
*
|
|
14203
14510
|
* Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
|
|
14204
14511
|
*/
|
|
14205
|
-
resourceTypes?: ResourceType[] | undefined;
|
|
14512
|
+
resourceTypes?: `${ResourceType}`[] | undefined;
|
|
14206
14513
|
|
|
14207
14514
|
/**
|
|
14208
14515
|
* Rule does not match if the request matches any response header condition in this list (if specified). If both `excludedResponseHeaders` and `responseHeaders` are specified, then the `excludedResponseHeaders` property takes precedence.
|
|
@@ -14272,7 +14579,7 @@ export namespace Browser {
|
|
|
14272
14579
|
header: string;
|
|
14273
14580
|
|
|
14274
14581
|
/** The operation to be performed on a header. */
|
|
14275
|
-
operation: HeaderOperation
|
|
14582
|
+
operation: `${HeaderOperation}`;
|
|
14276
14583
|
|
|
14277
14584
|
/** The new value for the header.
|
|
14278
14585
|
* Must be specified for append and set operations.
|
|
@@ -14354,7 +14661,7 @@ export namespace Browser {
|
|
|
14354
14661
|
/** Specifies the reason why the regular expression is not supported.
|
|
14355
14662
|
* Only provided if isSupported is false.
|
|
14356
14663
|
*/
|
|
14357
|
-
reason?: UnsupportedRegexReason | undefined;
|
|
14664
|
+
reason?: `${UnsupportedRegexReason}` | undefined;
|
|
14358
14665
|
}
|
|
14359
14666
|
|
|
14360
14667
|
export interface TabActionCountUpdate {
|
|
@@ -14909,7 +15216,7 @@ export namespace Browser {
|
|
|
14909
15216
|
/** Specifies which pages this user script will be injected into. See Match Patterns for more details on the syntax of these strings. This property must be specified for ${ref:register}. */
|
|
14910
15217
|
matches?: string[];
|
|
14911
15218
|
/** Specifies when JavaScript files are injected into the web page. The preferred and default value is document_idle */
|
|
14912
|
-
runAt?: RunAt;
|
|
15219
|
+
runAt?: extensionTypes.RunAt;
|
|
14913
15220
|
/** The JavaScript execution environment to run the script in. The default is `USER_SCRIPT` */
|
|
14914
15221
|
world?: ExecutionWorld;
|
|
14915
15222
|
/**
|
|
@@ -14943,11 +15250,6 @@ export namespace Browser {
|
|
|
14943
15250
|
file?: string;
|
|
14944
15251
|
}
|
|
14945
15252
|
|
|
14946
|
-
/**
|
|
14947
|
-
* Enum for the run-at property.
|
|
14948
|
-
*/
|
|
14949
|
-
export type RunAt = "document_start" | "document_end" | "document_idle";
|
|
14950
|
-
|
|
14951
15253
|
/**
|
|
14952
15254
|
* Configures the `USER_SCRIPT` execution environment.
|
|
14953
15255
|
*
|