@types/chrome 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.
- chrome/README.md +1 -1
- chrome/index.d.ts +540 -238
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated: Fri,
|
11
|
+
* Last updated: Fri, 30 May 2025 05:36:15 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
|
14
14
|
# Credits
|
chrome/index.d.ts
CHANGED
@@ -150,20 +150,17 @@ declare namespace chrome {
|
|
150
150
|
* @since Chrome 88, MV3
|
151
151
|
*/
|
152
152
|
export namespace action {
|
153
|
-
/** @deprecated Use BadgeColorDetails instead. */
|
154
|
-
export interface BadgeBackgroundColorDetails extends BadgeColorDetails {}
|
155
|
-
|
156
153
|
export interface BadgeColorDetails {
|
157
|
-
/** 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]
|
154
|
+
/** 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`. */
|
158
155
|
color: string | ColorArray;
|
159
|
-
/**
|
156
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
160
157
|
tabId?: number | undefined;
|
161
158
|
}
|
162
159
|
|
163
160
|
export interface BadgeTextDetails {
|
164
|
-
/** Any number of characters can be passed, but only about four can fit in the space. */
|
165
|
-
text
|
166
|
-
/**
|
161
|
+
/** 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. */
|
162
|
+
text?: string | undefined;
|
163
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
167
164
|
tabId?: number | undefined;
|
168
165
|
}
|
169
166
|
|
@@ -172,33 +169,34 @@ declare namespace chrome {
|
|
172
169
|
export interface TitleDetails {
|
173
170
|
/** The string the action should display when moused over. */
|
174
171
|
title: string;
|
175
|
-
/**
|
172
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
176
173
|
tabId?: number | undefined;
|
177
174
|
}
|
178
175
|
|
179
176
|
export interface PopupDetails {
|
180
|
-
/**
|
177
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
181
178
|
tabId?: number | undefined;
|
182
|
-
/** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
|
179
|
+
/** The html file to show in a popup. If set to the empty string (`''`), no popup is shown. */
|
183
180
|
popup: string;
|
184
181
|
}
|
185
182
|
|
186
183
|
export interface TabIconDetails {
|
187
|
-
/**
|
184
|
+
/** 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}' */
|
188
185
|
path?: string | { [index: number]: string } | undefined;
|
189
|
-
/**
|
186
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
190
187
|
tabId?: number | undefined;
|
191
|
-
/**
|
188
|
+
/** 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}' */
|
192
189
|
imageData?: ImageData | { [index: number]: ImageData } | undefined;
|
193
190
|
}
|
194
191
|
|
192
|
+
/** @since Chrome 99 */
|
195
193
|
export interface OpenPopupOptions {
|
196
|
-
/**
|
194
|
+
/** The id of the window to open the action popup in. Defaults to the currently-active window if unspecified. */
|
197
195
|
windowId?: number | undefined;
|
198
196
|
}
|
199
197
|
|
200
198
|
export interface TabDetails {
|
201
|
-
/**
|
199
|
+
/** The ID of the tab to query state for. If no tab is specified, the non-tab-specific state is returned. */
|
202
200
|
tabId?: number | undefined;
|
203
201
|
}
|
204
202
|
|
@@ -218,232 +216,154 @@ declare namespace chrome {
|
|
218
216
|
}
|
219
217
|
|
220
218
|
/**
|
221
|
-
* @since Chrome 88
|
222
219
|
* Disables the action for a tab.
|
223
|
-
* @param tabId The
|
224
|
-
*
|
220
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
221
|
+
*
|
222
|
+
* Can return its result via Promise.
|
225
223
|
*/
|
226
224
|
export function disable(tabId?: number): Promise<void>;
|
227
|
-
|
228
|
-
/**
|
229
|
-
* @since Chrome 88
|
230
|
-
* Disables the action for a tab.
|
231
|
-
* @param tabId The id of the tab for which you want to modify the action.
|
232
|
-
* @param callback
|
233
|
-
*/
|
234
225
|
export function disable(callback: () => void): void;
|
235
|
-
export function disable(tabId: number, callback: () => void): void;
|
226
|
+
export function disable(tabId: number | undefined, callback: () => void): void;
|
236
227
|
|
237
228
|
/**
|
238
|
-
* @since Chrome 88
|
239
229
|
* Enables the action for a tab. By default, actions are enabled.
|
240
|
-
* @param tabId The
|
241
|
-
*
|
230
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
231
|
+
*
|
232
|
+
* Can return its result via Promise.
|
242
233
|
*/
|
243
234
|
export function enable(tabId?: number): Promise<void>;
|
244
|
-
|
245
|
-
/**
|
246
|
-
* @since Chrome 88
|
247
|
-
* Enables the action for a tab. By default, actions are enabled.
|
248
|
-
* @param tabId The id of the tab for which you want to modify the action.
|
249
|
-
* @param callback
|
250
|
-
*/
|
251
235
|
export function enable(callback: () => void): void;
|
252
|
-
export function enable(tabId: number, callback: () => void): void;
|
236
|
+
export function enable(tabId: number | undefined, callback: () => void): void;
|
253
237
|
|
254
238
|
/**
|
255
|
-
* @since Chrome 88
|
256
|
-
* Gets the background color of the action.
|
257
|
-
*/
|
258
|
-
export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
|
259
|
-
/**
|
260
|
-
* @since Chrome 88
|
261
239
|
* Gets the background color of the action.
|
262
|
-
*
|
240
|
+
*
|
241
|
+
* Can return its result via Promise.
|
263
242
|
*/
|
264
243
|
export function getBadgeBackgroundColor(details: TabDetails): Promise<ColorArray>;
|
244
|
+
export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
|
265
245
|
|
266
246
|
/**
|
267
|
-
* @
|
268
|
-
*
|
269
|
-
*
|
270
|
-
* declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.
|
271
|
-
*/
|
272
|
-
export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
|
273
|
-
|
274
|
-
/**
|
275
|
-
* @since Chrome 88
|
276
|
-
* Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned.
|
277
|
-
* If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the
|
278
|
-
* declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.
|
279
|
-
* @return The `getBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only).
|
247
|
+
* 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.
|
248
|
+
*
|
249
|
+
* Can return its result via Promise.
|
280
250
|
*/
|
281
251
|
export function getBadgeText(details: TabDetails): Promise<string>;
|
252
|
+
export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
|
282
253
|
|
283
254
|
/**
|
284
|
-
* @since Chrome 110
|
285
255
|
* Gets the text color of the action.
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
/**
|
256
|
+
*
|
257
|
+
* Can return its result via Promise.
|
290
258
|
* @since Chrome 110
|
291
|
-
* Gets the text color of the action.
|
292
|
-
* @return The `getBadgeTextColor` method provides its result via callback or returned as a `Promise` (MV3 only).
|
293
259
|
*/
|
294
260
|
export function getBadgeTextColor(details: TabDetails): Promise<ColorArray>;
|
261
|
+
export function getBadgeTextColor(details: TabDetails, callback: (result: ColorArray) => void): void;
|
295
262
|
|
296
263
|
/**
|
297
|
-
* @since Chrome 88
|
298
|
-
* Gets the html document set as the popup for this action.
|
299
|
-
*/
|
300
|
-
export function getPopup(details: TabDetails, callback: (result: string) => void): void;
|
301
|
-
|
302
|
-
/**
|
303
|
-
* @since Chrome 88
|
304
264
|
* Gets the html document set as the popup for this action.
|
305
|
-
*
|
265
|
+
*
|
266
|
+
* Can return its result via Promise.
|
306
267
|
*/
|
307
268
|
export function getPopup(details: TabDetails): Promise<string>;
|
269
|
+
export function getPopup(details: TabDetails, callback: (result: string) => void): void;
|
308
270
|
|
309
271
|
/**
|
310
|
-
* @since Chrome 88
|
311
|
-
* Gets the title of the action.
|
312
|
-
*/
|
313
|
-
export function getTitle(details: TabDetails, callback: (result: string) => void): void;
|
314
|
-
|
315
|
-
/**
|
316
|
-
* @since Chrome 88
|
317
272
|
* Gets the title of the action.
|
318
|
-
*
|
273
|
+
*
|
274
|
+
* Can return its result via Promise.
|
319
275
|
*/
|
320
276
|
export function getTitle(details: TabDetails): Promise<string>;
|
277
|
+
export function getTitle(details: TabDetails, callback: (result: string) => void): void;
|
321
278
|
|
322
279
|
/**
|
323
|
-
* @since Chrome 91
|
324
280
|
* Returns the user-specified settings relating to an extension's action.
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
/**
|
281
|
+
*
|
282
|
+
* Can return its result via Promise.
|
329
283
|
* @since Chrome 91
|
330
|
-
* Returns the user-specified settings relating to an extension's action.
|
331
|
-
* @return The `getUserSettings` method provides its result via callback or returned as a `Promise` (MV3 only).
|
332
284
|
*/
|
333
285
|
export function getUserSettings(): Promise<UserSettings>;
|
286
|
+
export function getUserSettings(callback: (userSettings: UserSettings) => void): void;
|
334
287
|
|
335
288
|
/**
|
289
|
+
* 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.
|
290
|
+
*
|
291
|
+
* Can return its result via Promise.
|
336
292
|
* @since Chrome 110
|
337
|
-
* 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.
|
338
|
-
*/
|
339
|
-
export function isEnabled(tabId: number | undefined, callback: (isEnabled: boolean) => void): void;
|
340
|
-
|
341
|
-
/**
|
342
|
-
* @since Chrome 110
|
343
|
-
* 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.
|
344
|
-
* @return True if the extension action is enabled.
|
345
293
|
*/
|
346
294
|
export function isEnabled(tabId?: number): Promise<boolean>;
|
295
|
+
export function isEnabled(callback: (isEnabled: boolean) => void): void;
|
296
|
+
export function isEnabled(tabId: number | undefined, callback: (isEnabled: boolean) => void): void;
|
347
297
|
|
348
298
|
/**
|
349
|
-
*
|
350
|
-
*
|
299
|
+
* Opens the extension's popup. Between Chrome 118 and Chrome 126, this is only available to policy installed extensions.
|
300
|
+
*
|
351
301
|
* @param options Specifies options for opening the popup.
|
352
|
-
*
|
353
|
-
*
|
302
|
+
*
|
303
|
+
* Can return its result via Promise.
|
304
|
+
* @since Chrome 127
|
354
305
|
*/
|
355
306
|
export function openPopup(options?: OpenPopupOptions): Promise<void>;
|
356
|
-
|
357
|
-
/**
|
358
|
-
* @since Chrome 99
|
359
|
-
* Opens the extension's popup.
|
360
|
-
* @param options Specifies options for opening the popup.
|
361
|
-
*/
|
362
307
|
export function openPopup(callback: () => void): void;
|
363
|
-
export function openPopup(options: OpenPopupOptions, callback: () => void): void;
|
308
|
+
export function openPopup(options: OpenPopupOptions | undefined, callback: () => void): void;
|
364
309
|
|
365
310
|
/**
|
366
|
-
* @since Chrome 88
|
367
311
|
* Sets the background color for the badge.
|
368
|
-
*
|
312
|
+
*
|
313
|
+
* Can return its result via Promise.
|
369
314
|
*/
|
370
315
|
export function setBadgeBackgroundColor(details: BadgeColorDetails): Promise<void>;
|
371
|
-
|
372
|
-
/**
|
373
|
-
* @since Chrome 88
|
374
|
-
* Sets the background color for the badge.
|
375
|
-
*/
|
376
316
|
export function setBadgeBackgroundColor(details: BadgeColorDetails, callback: () => void): void;
|
377
317
|
|
378
318
|
/**
|
379
|
-
* @since Chrome 88
|
380
319
|
* Sets the badge text for the action. The badge is displayed on top of the icon.
|
381
|
-
*
|
320
|
+
*
|
321
|
+
* Can return its result via Promise.
|
382
322
|
*/
|
383
323
|
export function setBadgeText(details: BadgeTextDetails): Promise<void>;
|
384
|
-
|
385
|
-
/**
|
386
|
-
* @since Chrome 88
|
387
|
-
* Sets the badge text for the action. The badge is displayed on top of the icon.
|
388
|
-
*/
|
389
324
|
export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
|
390
325
|
|
391
326
|
/**
|
392
|
-
* @since Chrome 110
|
393
327
|
* Sets the text color for the badge.
|
394
|
-
*
|
328
|
+
*
|
329
|
+
* Can return its result via Promise.
|
330
|
+
* @since Chrome 110
|
395
331
|
*/
|
396
332
|
export function setBadgeTextColor(details: BadgeColorDetails): Promise<void>;
|
397
|
-
|
398
|
-
/**
|
399
|
-
* @since Chrome 100
|
400
|
-
* Sets the text color for the badge.
|
401
|
-
*/
|
402
333
|
export function setBadgeTextColor(details: BadgeColorDetails, callback: () => void): void;
|
403
334
|
|
404
335
|
/**
|
405
|
-
*
|
406
|
-
*
|
407
|
-
*
|
408
|
-
* @return The `setIcon` method provides its result via callback or returned as a `Promise` (MV3 only). Since Chrome 96.
|
336
|
+
* 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.
|
337
|
+
*
|
338
|
+
* Can return its result via Promise.
|
409
339
|
*/
|
410
340
|
export function setIcon(details: TabIconDetails): Promise<void>;
|
411
341
|
export function setIcon(details: TabIconDetails, callback: () => void): void;
|
412
342
|
|
413
343
|
/**
|
414
|
-
* @since Chrome 88
|
415
344
|
* Sets the html document to be opened as a popup when the user clicks on the action's icon.
|
416
|
-
*
|
345
|
+
*
|
346
|
+
* Can return its result via Promise.
|
417
347
|
*/
|
418
348
|
export function setPopup(details: PopupDetails): Promise<void>;
|
419
|
-
|
420
|
-
/**
|
421
|
-
* @since Chrome 88
|
422
|
-
* Sets the html document to be opened as a popup when the user clicks on the action's icon.
|
423
|
-
*/
|
424
349
|
export function setPopup(details: PopupDetails, callback: () => void): void;
|
425
350
|
|
426
351
|
/**
|
427
|
-
* @since Chrome 88
|
428
352
|
* Sets the title of the action. This shows up in the tooltip.
|
429
|
-
*
|
353
|
+
*
|
354
|
+
* Can return its result via Promise.
|
430
355
|
*/
|
431
356
|
export function setTitle(details: TitleDetails): Promise<void>;
|
432
|
-
|
433
|
-
/**
|
434
|
-
* @since Chrome 88
|
435
|
-
* Sets the title of the action. This shows up in the tooltip.
|
436
|
-
*/
|
437
357
|
export function setTitle(details: TitleDetails, callback: () => void): void;
|
438
358
|
|
439
359
|
/** Fired when an action icon is clicked. This event will not fire if the action has a popup. */
|
440
|
-
export const onClicked:
|
360
|
+
export const onClicked: events.Event<(tab: chrome.tabs.Tab) => void>;
|
441
361
|
|
442
362
|
/**
|
443
363
|
* Fired when user-specified settings relating to an extension's action change.
|
444
364
|
* @since Chrome 130
|
445
365
|
*/
|
446
|
-
export const onUserSettingsChanged:
|
366
|
+
export const onUserSettingsChanged: events.Event<(change: UserSettingsChange) => void>;
|
447
367
|
}
|
448
368
|
|
449
369
|
////////////////////
|
@@ -1463,6 +1383,246 @@ declare namespace chrome {
|
|
1463
1383
|
export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
|
1464
1384
|
}
|
1465
1385
|
|
1386
|
+
////////////////////
|
1387
|
+
// Certificate Provider
|
1388
|
+
////////////////////
|
1389
|
+
/**
|
1390
|
+
* Use this API to expose certificates to the platform which can use these certificates for TLS authentications.
|
1391
|
+
*
|
1392
|
+
* Manifest: "certificateProvider"
|
1393
|
+
* @platform ChromeOS only
|
1394
|
+
* @since Chrome 46
|
1395
|
+
*/
|
1396
|
+
export namespace certificateProvider {
|
1397
|
+
/** Types of supported cryptographic signature algorithms. */
|
1398
|
+
export enum Algorithm {
|
1399
|
+
/**
|
1400
|
+
* 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.
|
1401
|
+
* @deprecated This algorithm is deprecated and will never be requested by Chrome as of version 109.
|
1402
|
+
*/
|
1403
|
+
RSASSA_PKCS1_V1_5_MD5_SHA1 = "RSASSA_PKCS1_v1_5_MD5_SHA1",
|
1404
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-1 hash function. */
|
1405
|
+
RSASSA_PKCS1_V1_5_SHA1 = "RSASSA_PKCS1_v1_5_SHA1",
|
1406
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-256 hashing function. */
|
1407
|
+
RSASSA_PKCS1_V1_5_SHA256 = "RSASSA_PKCS1_v1_5_SHA256",
|
1408
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-384 hashing function. */
|
1409
|
+
RSASSA_PKCS1_V1_5_SHA384 = "RSASSA_PKCS1_v1_5_SHA384",
|
1410
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-512 hashing function. */
|
1411
|
+
RSASSA_PKCS1_V1_5_SHA512 = "RSASSA_PKCS1_v1_5_SHA512",
|
1412
|
+
/** 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. */
|
1413
|
+
RSASSA_PSS_SHA256 = "RSASSA_PSS_SHA256",
|
1414
|
+
/** 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. */
|
1415
|
+
RSASSA_PSS_SHA384 = "RSASSA_PSS_SHA384",
|
1416
|
+
/** 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. */
|
1417
|
+
RSASSA_PSS_SHA512 = "RSASSA_PSS_SHA512",
|
1418
|
+
}
|
1419
|
+
|
1420
|
+
export interface CertificateInfo {
|
1421
|
+
/** Must be the DER encoding of a X.509 certificate. Currently, only certificates of RSA keys are supported. */
|
1422
|
+
certificate: ArrayBuffer;
|
1423
|
+
/** 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. */
|
1424
|
+
supportedHashes: `${Hash}`[];
|
1425
|
+
}
|
1426
|
+
|
1427
|
+
/** @since Chrome 86 */
|
1428
|
+
export interface CertificatesUpdateRequest {
|
1429
|
+
/** Request identifier to be passed to {@link setCertificates}. */
|
1430
|
+
certificatesRequestId: number;
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
/** @since Chrome 86 */
|
1434
|
+
export interface ClientCertificateInfo {
|
1435
|
+
/**
|
1436
|
+
* The array must contain the DER encoding of the X.509 client certificate as its first element.
|
1437
|
+
*
|
1438
|
+
* This must include exactly one certificate.
|
1439
|
+
*/
|
1440
|
+
certificateChain: ArrayBuffer[];
|
1441
|
+
/** All algorithms supported for this certificate. The extension will only be asked for signatures using one of these algorithms. */
|
1442
|
+
supportedAlgorithms: `${Algorithm}`[];
|
1443
|
+
}
|
1444
|
+
|
1445
|
+
/**
|
1446
|
+
* Types of errors that the extension can report.
|
1447
|
+
* @since Chrome 86
|
1448
|
+
*/
|
1449
|
+
export enum Error {
|
1450
|
+
GENERAL_ERROR = "GENERAL_ERROR",
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
/** @deprecated Replaced by {@link Algorithm}.*/
|
1454
|
+
export enum Hash {
|
1455
|
+
/** Specifies the MD5 and SHA1 hashing algorithms. */
|
1456
|
+
MD5_SHA1 = "MD5_SHA1",
|
1457
|
+
/** Specifies the SHA1 hashing algorithm. */
|
1458
|
+
SHA1 = "SHA1",
|
1459
|
+
/** Specifies the SHA256 hashing algorithm. */
|
1460
|
+
SHA256 = "SHA256",
|
1461
|
+
/** Specifies the SHA384 hashing algorithm. */
|
1462
|
+
SHA384 = "SHA384",
|
1463
|
+
/** Specifies the SHA512 hashing algorithm. */
|
1464
|
+
SHA512 = "SHA512",
|
1465
|
+
}
|
1466
|
+
|
1467
|
+
/**
|
1468
|
+
* The types of errors that can be presented to the user through the requestPin function.
|
1469
|
+
* @since Chrome 57
|
1470
|
+
*/
|
1471
|
+
export enum PinRequestErrorType {
|
1472
|
+
/** Specifies the PIN is invalid. */
|
1473
|
+
INVALID_PIN = "INVALID_PIN",
|
1474
|
+
/** Specifies the PUK is invalid. */
|
1475
|
+
INVALID_PUK = "INVALID_PUK",
|
1476
|
+
/** Specifies the maximum attempt number has been exceeded. */
|
1477
|
+
MAX_ATTEMPTS_EXCEEDED = "MAX_ATTEMPTS_EXCEEDED",
|
1478
|
+
/** Specifies that the error cannot be represented by the above types. */
|
1479
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
1480
|
+
}
|
1481
|
+
|
1482
|
+
/**
|
1483
|
+
* The type of code being requested by the extension with requestPin function.
|
1484
|
+
* @since Chrome 57
|
1485
|
+
*/
|
1486
|
+
export enum PinRequestType {
|
1487
|
+
/** Specifies the requested code is a PIN. */
|
1488
|
+
PIN = "PIN",
|
1489
|
+
/** Specifies the requested code is a PUK. */
|
1490
|
+
PUK = "PUK",
|
1491
|
+
}
|
1492
|
+
|
1493
|
+
/** @since Chrome 57 */
|
1494
|
+
export interface PinResponseDetails {
|
1495
|
+
/** The code provided by the user. Empty if user closed the dialog or some other error occurred. */
|
1496
|
+
userInput?: string | undefined;
|
1497
|
+
}
|
1498
|
+
|
1499
|
+
/** @since Chrome 86 */
|
1500
|
+
export interface ReportSignatureDetails {
|
1501
|
+
/** Error that occurred while generating the signature, if any. */
|
1502
|
+
error?: `${Error}` | undefined;
|
1503
|
+
/** Request identifier that was received via the {@link onSignatureRequested} event. */
|
1504
|
+
signRequestId: number;
|
1505
|
+
/** The signature, if successfully generated. */
|
1506
|
+
signature?: ArrayBuffer | undefined;
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
/** @since Chrome 57 */
|
1510
|
+
export interface RequestPinDetails {
|
1511
|
+
/** 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. */
|
1512
|
+
attemptsLeft?: number | undefined;
|
1513
|
+
/** The error template displayed to the user. This should be set if the previous request failed, to notify the user of the failure reason. */
|
1514
|
+
errorType?: `${PinRequestErrorType}` | undefined;
|
1515
|
+
/** The type of code requested. Default is PIN. */
|
1516
|
+
requestType?: `${PinRequestType}` | undefined;
|
1517
|
+
/** The ID given by Chrome in SignRequest. */
|
1518
|
+
signRequestId: number;
|
1519
|
+
}
|
1520
|
+
|
1521
|
+
/** @since Chrome 86 */
|
1522
|
+
export interface SetCertificatesDetails {
|
1523
|
+
/** When called in response to {@link onCertificatesUpdateRequested}, should contain the received `certificatesRequestId` value. Otherwise, should be unset. */
|
1524
|
+
certificatesRequestId?: number | undefined;
|
1525
|
+
/** List of currently available client certificates. */
|
1526
|
+
clientCertificates: ClientCertificateInfo[];
|
1527
|
+
/** Error that occurred while extracting the certificates, if any. This error will be surfaced to the user when appropriate. */
|
1528
|
+
error?: `${Error}` | undefined;
|
1529
|
+
}
|
1530
|
+
|
1531
|
+
/** @since Chrome 86 */
|
1532
|
+
export interface SignatureRequest {
|
1533
|
+
/** Signature algorithm to be used. */
|
1534
|
+
algorithm: `${Algorithm}`;
|
1535
|
+
/** The DER encoding of a X.509 certificate. The extension must sign `input` using the associated private key. */
|
1536
|
+
certificate: ArrayBuffer;
|
1537
|
+
/** Data to be signed. Note that the data is not hashed. */
|
1538
|
+
input: ArrayBuffer;
|
1539
|
+
/** Request identifier to be passed to {@link reportSignature}. */
|
1540
|
+
signRequestId: number;
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
export interface SignRequest {
|
1544
|
+
/** The DER encoding of a X.509 certificate. The extension must sign `digest` using the associated private key. */
|
1545
|
+
certificate: ArrayBuffer;
|
1546
|
+
/** The digest that must be signed. */
|
1547
|
+
digest: ArrayBuffer;
|
1548
|
+
/** Refers to the hash algorithm that was used to create `digest`. */
|
1549
|
+
hash: `${Hash}`;
|
1550
|
+
/**
|
1551
|
+
* The unique ID to be used by the extension should it need to call a method that requires it, e.g. requestPin.
|
1552
|
+
* @since Chrome 57
|
1553
|
+
*/
|
1554
|
+
signRequestId: number;
|
1555
|
+
}
|
1556
|
+
|
1557
|
+
/** @since Chrome 57 */
|
1558
|
+
export interface StopPinRequestDetails {
|
1559
|
+
/** 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. */
|
1560
|
+
errorType?: `${PinRequestErrorType}` | undefined;
|
1561
|
+
/** The ID given by Chrome in SignRequest. */
|
1562
|
+
signRequestId: number;
|
1563
|
+
}
|
1564
|
+
|
1565
|
+
/**
|
1566
|
+
* Should be called as a response to {@link onSignatureRequested}.
|
1567
|
+
*
|
1568
|
+
* 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.
|
1569
|
+
*
|
1570
|
+
* Can return its result via Promise since Chrome 96.
|
1571
|
+
* @since Chrome 86
|
1572
|
+
*/
|
1573
|
+
export function reportSignature(details: ReportSignatureDetails): Promise<void>;
|
1574
|
+
export function reportSignature(details: ReportSignatureDetails, callback: () => void): void;
|
1575
|
+
|
1576
|
+
/**
|
1577
|
+
* 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.
|
1578
|
+
*
|
1579
|
+
* Can return its result via Promise since Chrome 96.
|
1580
|
+
* @param details Contains the details about the requested dialog.
|
1581
|
+
* @since Chrome 57
|
1582
|
+
*/
|
1583
|
+
export function requestPin(details: RequestPinDetails): Promise<PinResponseDetails | undefined>;
|
1584
|
+
export function requestPin(
|
1585
|
+
details: RequestPinDetails,
|
1586
|
+
callback: (details?: PinResponseDetails | undefined) => void,
|
1587
|
+
): void;
|
1588
|
+
|
1589
|
+
/**
|
1590
|
+
* Sets a list of certificates to use in the browser.
|
1591
|
+
*
|
1592
|
+
* 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.
|
1593
|
+
*
|
1594
|
+
* Can return its result via Promise since Chrome 96.
|
1595
|
+
* @param details The certificates to set. Invalid certificates will be ignored.
|
1596
|
+
* @since Chrome 86
|
1597
|
+
*/
|
1598
|
+
export function setCertificates(details: SetCertificatesDetails): Promise<void>;
|
1599
|
+
export function setCertificates(details: SetCertificatesDetails, callback: () => void): void;
|
1600
|
+
|
1601
|
+
/**
|
1602
|
+
* Stops the pin request started by the {@link requestPin} function.
|
1603
|
+
*
|
1604
|
+
* Can return its result via Promise since Chrome 96.
|
1605
|
+
* @param details Contains the details about the reason for stopping the request flow.
|
1606
|
+
* @since Chrome 57
|
1607
|
+
*/
|
1608
|
+
export function stopPinRequest(details: StopPinRequestDetails): Promise<void>;
|
1609
|
+
export function stopPinRequest(details: StopPinRequestDetails, callback: () => void): void;
|
1610
|
+
|
1611
|
+
/**
|
1612
|
+
* 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`.
|
1613
|
+
* @since Chrome 86
|
1614
|
+
*/
|
1615
|
+
export const onCertificatesUpdateRequested: events.Event<(request: CertificatesUpdateRequest) => void>;
|
1616
|
+
|
1617
|
+
/**
|
1618
|
+
* This event fires every time the browser needs to sign a message using a certificate provided by this extension via {@link setCertificates}.
|
1619
|
+
*
|
1620
|
+
* 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`.
|
1621
|
+
* @since Chrome 86
|
1622
|
+
*/
|
1623
|
+
export const onSignatureRequested: events.Event<(request: SignatureRequest) => void>;
|
1624
|
+
}
|
1625
|
+
|
1466
1626
|
////////////////////
|
1467
1627
|
// Commands
|
1468
1628
|
////////////////////
|
@@ -4497,6 +4657,84 @@ declare namespace chrome {
|
|
4497
4657
|
export var onRequestExternal: OnRequestEvent;
|
4498
4658
|
}
|
4499
4659
|
|
4660
|
+
////////////////////
|
4661
|
+
// Extension Types
|
4662
|
+
////////////////////
|
4663
|
+
/** The `chrome.extensionTypes` API contains type declarations for Chrome extensions. */
|
4664
|
+
export namespace extensionTypes {
|
4665
|
+
/**
|
4666
|
+
* The origin of injected CSS.
|
4667
|
+
* @since Chrome 66
|
4668
|
+
*/
|
4669
|
+
export type CSSOrigin = "author" | "user";
|
4670
|
+
|
4671
|
+
/**
|
4672
|
+
* The document lifecycle of the frame.
|
4673
|
+
* @since Chrome 106
|
4674
|
+
*/
|
4675
|
+
export type DocumentLifecycle = "prerender" | "active" | "cached" | "pending_deletion";
|
4676
|
+
|
4677
|
+
/**
|
4678
|
+
* The type of frame.
|
4679
|
+
* @since Chrome 106
|
4680
|
+
*/
|
4681
|
+
export type FrameType = "outermost_frame" | "fenced_frame" | "sub_frame";
|
4682
|
+
|
4683
|
+
/** Details about the format and quality of an image. */
|
4684
|
+
export interface ImageDetails {
|
4685
|
+
/** The format of the resulting image. Default is `"jpeg"`. */
|
4686
|
+
format?: ImageFormat | undefined;
|
4687
|
+
/** 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. */
|
4688
|
+
quality?: number | undefined;
|
4689
|
+
}
|
4690
|
+
|
4691
|
+
/**
|
4692
|
+
* The format of an image.
|
4693
|
+
* @since Chrome 44
|
4694
|
+
*/
|
4695
|
+
export type ImageFormat = "jpeg" | "png";
|
4696
|
+
|
4697
|
+
/** 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. */
|
4698
|
+
export interface InjectDetails {
|
4699
|
+
/** 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. */
|
4700
|
+
allFrames?: boolean | undefined;
|
4701
|
+
/**
|
4702
|
+
* JavaScript or CSS code to inject.
|
4703
|
+
*
|
4704
|
+
* **Warning:** Be careful using the `code` parameter. Incorrect use of it may open your extension to cross site scripting attacks
|
4705
|
+
*/
|
4706
|
+
code?: string | undefined;
|
4707
|
+
/**
|
4708
|
+
* The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to `"author"`.
|
4709
|
+
* @since Chrome 66
|
4710
|
+
*/
|
4711
|
+
cssOrigin?: CSSOrigin | undefined;
|
4712
|
+
/** JavaScript or CSS file to inject. */
|
4713
|
+
file?: string | undefined;
|
4714
|
+
/**
|
4715
|
+
* The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame).
|
4716
|
+
* @since Chrome 50
|
4717
|
+
*/
|
4718
|
+
frameId?: number | undefined;
|
4719
|
+
/** 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`. */
|
4720
|
+
matchAboutBlank?: boolean;
|
4721
|
+
/** The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". */
|
4722
|
+
runAt?: RunAt | undefined;
|
4723
|
+
}
|
4724
|
+
|
4725
|
+
/**
|
4726
|
+
* The soonest that the JavaScript or CSS will be injected into the tab.
|
4727
|
+
*
|
4728
|
+
* "document_start" : Script is injected after any files from css, but before any other DOM is constructed or any other script is run.
|
4729
|
+
*
|
4730
|
+
* "document_end" : Script is injected immediately after the DOM is complete, but before subresources like images and frames have loaded.
|
4731
|
+
*
|
4732
|
+
* "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.
|
4733
|
+
* @since Chrome 44
|
4734
|
+
*/
|
4735
|
+
export type RunAt = "document_start" | "document_end" | "document_idle";
|
4736
|
+
}
|
4737
|
+
|
4500
4738
|
////////////////////
|
4501
4739
|
// File Browser Handler
|
4502
4740
|
////////////////////
|
@@ -8706,9 +8944,6 @@ declare namespace chrome {
|
|
8706
8944
|
export function addListener(callback: (info: OnReceiveErrorInfo) => void): void;
|
8707
8945
|
}
|
8708
8946
|
|
8709
|
-
type DocumentLifecycle = "prerender" | "active" | "cached" | "pending_deletion";
|
8710
|
-
type FrameType = "outermost_frame" | "fenced_frame" | "sub_frame";
|
8711
|
-
|
8712
8947
|
////////////////////
|
8713
8948
|
// Runtime
|
8714
8949
|
////////////////////
|
@@ -8864,7 +9099,7 @@ declare namespace chrome {
|
|
8864
9099
|
* 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.
|
8865
9100
|
* @since Chrome 106
|
8866
9101
|
*/
|
8867
|
-
documentLifecycle?: DocumentLifecycle | undefined;
|
9102
|
+
documentLifecycle?: extensionTypes.DocumentLifecycle | undefined;
|
8868
9103
|
/**
|
8869
9104
|
* A UUID of the document that opened the connection.
|
8870
9105
|
* @since Chrome 106
|
@@ -9698,7 +9933,7 @@ declare namespace chrome {
|
|
9698
9933
|
js?: string[];
|
9699
9934
|
matches?: string[];
|
9700
9935
|
persistAcrossSessions?: boolean;
|
9701
|
-
runAt?:
|
9936
|
+
runAt?: extensionTypes.RunAt;
|
9702
9937
|
world?: ExecutionWorld;
|
9703
9938
|
}
|
9704
9939
|
|
@@ -11143,45 +11378,6 @@ declare namespace chrome {
|
|
11143
11378
|
defaultZoomFactor?: number | undefined;
|
11144
11379
|
}
|
11145
11380
|
|
11146
|
-
export interface InjectDetails {
|
11147
|
-
/**
|
11148
|
-
* Optional.
|
11149
|
-
* 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.
|
11150
|
-
*/
|
11151
|
-
allFrames?: boolean | undefined;
|
11152
|
-
/**
|
11153
|
-
* Optional. JavaScript or CSS code to inject.
|
11154
|
-
* Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks.
|
11155
|
-
*/
|
11156
|
-
code?: string | undefined;
|
11157
|
-
/**
|
11158
|
-
* Optional. The soonest that the JavaScript or CSS will be injected into the tab.
|
11159
|
-
* One of: "document_start", "document_end", or "document_idle"
|
11160
|
-
* @since Chrome 20
|
11161
|
-
*/
|
11162
|
-
runAt?: string | undefined;
|
11163
|
-
/** Optional. JavaScript or CSS file to inject. */
|
11164
|
-
file?: string | undefined;
|
11165
|
-
/**
|
11166
|
-
* Optional.
|
11167
|
-
* The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame).
|
11168
|
-
* @since Chrome 39
|
11169
|
-
*/
|
11170
|
-
frameId?: number | undefined;
|
11171
|
-
/**
|
11172
|
-
* Optional.
|
11173
|
-
* 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.
|
11174
|
-
* @since Chrome 39
|
11175
|
-
*/
|
11176
|
-
matchAboutBlank?: boolean | undefined;
|
11177
|
-
/**
|
11178
|
-
* Optional. The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to "author".
|
11179
|
-
* One of: "author", or "user"
|
11180
|
-
* @since Chrome 66
|
11181
|
-
*/
|
11182
|
-
cssOrigin?: string | undefined;
|
11183
|
-
}
|
11184
|
-
|
11185
11381
|
export interface CreateProperties {
|
11186
11382
|
/** 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. */
|
11187
11383
|
index?: number | undefined;
|
@@ -11263,19 +11459,6 @@ declare namespace chrome {
|
|
11263
11459
|
autoDiscardable?: boolean | undefined;
|
11264
11460
|
}
|
11265
11461
|
|
11266
|
-
export interface CaptureVisibleTabOptions {
|
11267
|
-
/**
|
11268
|
-
* Optional.
|
11269
|
-
* 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.
|
11270
|
-
*/
|
11271
|
-
quality?: number | undefined;
|
11272
|
-
/**
|
11273
|
-
* Optional. The format of an image.
|
11274
|
-
* One of: "jpeg", or "png"
|
11275
|
-
*/
|
11276
|
-
format?: string | undefined;
|
11277
|
-
}
|
11278
|
-
|
11279
11462
|
export interface ReloadProperties {
|
11280
11463
|
/** Optional. Whether using any local cache. Default is false. */
|
11281
11464
|
bypassCache?: boolean | undefined;
|
@@ -11538,21 +11721,21 @@ declare namespace chrome {
|
|
11538
11721
|
* @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.
|
11539
11722
|
* @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.
|
11540
11723
|
*/
|
11541
|
-
export function executeScript(details: InjectDetails): Promise<any[]>;
|
11724
|
+
export function executeScript(details: extensionTypes.InjectDetails): Promise<any[]>;
|
11542
11725
|
/**
|
11543
11726
|
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
|
11544
11727
|
* @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.
|
11545
11728
|
* @param callback Optional. Called after all the JavaScript has been executed.
|
11546
11729
|
* Parameter result: The result of the script in every injected frame.
|
11547
11730
|
*/
|
11548
|
-
export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void;
|
11731
|
+
export function executeScript(details: extensionTypes.InjectDetails, callback?: (result: any[]) => void): void;
|
11549
11732
|
/**
|
11550
11733
|
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
|
11551
11734
|
* @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
|
11552
11735
|
* @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.
|
11553
11736
|
* @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.
|
11554
11737
|
*/
|
11555
|
-
export function executeScript(tabId: number, details: InjectDetails): Promise<any[]>;
|
11738
|
+
export function executeScript(tabId: number, details: extensionTypes.InjectDetails): Promise<any[]>;
|
11556
11739
|
/**
|
11557
11740
|
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
|
11558
11741
|
* @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
|
@@ -11560,7 +11743,11 @@ declare namespace chrome {
|
|
11560
11743
|
* @param callback Optional. Called after all the JavaScript has been executed.
|
11561
11744
|
* Parameter result: The result of the script in every injected frame.
|
11562
11745
|
*/
|
11563
|
-
export function executeScript(
|
11746
|
+
export function executeScript(
|
11747
|
+
tabId: number,
|
11748
|
+
details: extensionTypes.InjectDetails,
|
11749
|
+
callback?: (result: any[]) => void,
|
11750
|
+
): void;
|
11564
11751
|
/** Retrieves details about the specified tab. */
|
11565
11752
|
export function get(tabId: number, callback: (tab: Tab) => void): void;
|
11566
11753
|
/**
|
@@ -11735,14 +11922,17 @@ declare namespace chrome {
|
|
11735
11922
|
* @param options Optional. Details about the format and quality of an image.
|
11736
11923
|
* @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.
|
11737
11924
|
*/
|
11738
|
-
export function captureVisibleTab(options:
|
11925
|
+
export function captureVisibleTab(options: extensionTypes.ImageDetails): Promise<string>;
|
11739
11926
|
/**
|
11740
11927
|
* Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
|
11741
11928
|
* @param options Optional. Details about the format and quality of an image.
|
11742
11929
|
* @param callback
|
11743
11930
|
* 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.
|
11744
11931
|
*/
|
11745
|
-
export function captureVisibleTab(
|
11932
|
+
export function captureVisibleTab(
|
11933
|
+
options: extensionTypes.ImageDetails,
|
11934
|
+
callback: (dataUrl: string) => void,
|
11935
|
+
): void;
|
11746
11936
|
/**
|
11747
11937
|
* Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
|
11748
11938
|
* @param windowId Optional. The target window. Defaults to the current window.
|
@@ -11751,7 +11941,7 @@ declare namespace chrome {
|
|
11751
11941
|
*/
|
11752
11942
|
export function captureVisibleTab(
|
11753
11943
|
windowId: number,
|
11754
|
-
options:
|
11944
|
+
options: extensionTypes.ImageDetails,
|
11755
11945
|
): Promise<string>;
|
11756
11946
|
/**
|
11757
11947
|
* Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
|
@@ -11762,7 +11952,7 @@ declare namespace chrome {
|
|
11762
11952
|
*/
|
11763
11953
|
export function captureVisibleTab(
|
11764
11954
|
windowId: number,
|
11765
|
-
options:
|
11955
|
+
options: extensionTypes.ImageDetails,
|
11766
11956
|
callback: (dataUrl: string) => void,
|
11767
11957
|
): void;
|
11768
11958
|
/**
|
@@ -11879,27 +12069,27 @@ declare namespace chrome {
|
|
11879
12069
|
* @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.
|
11880
12070
|
* @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
|
11881
12071
|
*/
|
11882
|
-
export function insertCSS(details: InjectDetails): Promise<void>;
|
12072
|
+
export function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
|
11883
12073
|
/**
|
11884
12074
|
* Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
|
11885
12075
|
* @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.
|
11886
12076
|
* @param callback Optional. Called when all the CSS has been inserted.
|
11887
12077
|
*/
|
11888
|
-
export function insertCSS(details: InjectDetails, callback: () => void): void;
|
12078
|
+
export function insertCSS(details: extensionTypes.InjectDetails, callback: () => void): void;
|
11889
12079
|
/**
|
11890
12080
|
* Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
|
11891
12081
|
* @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
|
11892
12082
|
* @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.
|
11893
12083
|
* @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
|
11894
12084
|
*/
|
11895
|
-
export function insertCSS(tabId: number, details: InjectDetails): Promise<void>;
|
12085
|
+
export function insertCSS(tabId: number, details: extensionTypes.InjectDetails): Promise<void>;
|
11896
12086
|
/**
|
11897
12087
|
* Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
|
11898
12088
|
* @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
|
11899
12089
|
* @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.
|
11900
12090
|
* @param callback Optional. Called when all the CSS has been inserted.
|
11901
12091
|
*/
|
11902
|
-
export function insertCSS(tabId: number, details: InjectDetails, callback: () => void): void;
|
12092
|
+
export function insertCSS(tabId: number, details: extensionTypes.InjectDetails, callback: () => void): void;
|
11903
12093
|
/**
|
11904
12094
|
* Highlights the given tabs.
|
11905
12095
|
* @since Chrome 16
|
@@ -12930,6 +13120,123 @@ declare namespace chrome {
|
|
12930
13120
|
export function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: ArrayBuffer) => void): void;
|
12931
13121
|
}
|
12932
13122
|
|
13123
|
+
////////////////////
|
13124
|
+
// Web Authentication Proxy
|
13125
|
+
////////////////////
|
13126
|
+
/**
|
13127
|
+
* The `chrome.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.
|
13128
|
+
*
|
13129
|
+
* Permissions: "webAuthenticationProxy"
|
13130
|
+
* @since Chrome 115, MV3
|
13131
|
+
*/
|
13132
|
+
export namespace webAuthenticationProxy {
|
13133
|
+
export interface CreateRequest {
|
13134
|
+
/** 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). */
|
13135
|
+
requestDetailsJson: string;
|
13136
|
+
/** An opaque identifier for the request. */
|
13137
|
+
requestId: number;
|
13138
|
+
}
|
13139
|
+
|
13140
|
+
export interface CreateResponseDetails {
|
13141
|
+
/** The `DOMException` yielded by the remote request, if any. */
|
13142
|
+
error?: DOMExceptionDetails | undefined;
|
13143
|
+
/** The `requestId` of the `CreateRequest`. */
|
13144
|
+
requestId: number;
|
13145
|
+
/** 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). */
|
13146
|
+
responseJson?: string | undefined;
|
13147
|
+
}
|
13148
|
+
|
13149
|
+
export interface DOMExceptionDetails {
|
13150
|
+
name: string;
|
13151
|
+
message: string;
|
13152
|
+
}
|
13153
|
+
|
13154
|
+
export interface GetRequest {
|
13155
|
+
/** 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). */
|
13156
|
+
requestDetailsJson: string;
|
13157
|
+
/** An opaque identifier for the request. */
|
13158
|
+
requestId: number;
|
13159
|
+
}
|
13160
|
+
|
13161
|
+
export interface GetResponseDetails {
|
13162
|
+
/** The `DOMException` yielded by the remote request, if any. */
|
13163
|
+
error?: DOMExceptionDetails | undefined;
|
13164
|
+
/** The `requestId` of the `CreateRequest`. */
|
13165
|
+
requestId: number;
|
13166
|
+
/** 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). */
|
13167
|
+
responseJson?: string | undefined;
|
13168
|
+
}
|
13169
|
+
|
13170
|
+
export interface IsUvpaaRequest {
|
13171
|
+
/** An opaque identifier for the request. */
|
13172
|
+
requestId: number;
|
13173
|
+
}
|
13174
|
+
|
13175
|
+
export interface IsUvpaaResponseDetails {
|
13176
|
+
isUvpaa: boolean;
|
13177
|
+
requestId: number;
|
13178
|
+
}
|
13179
|
+
|
13180
|
+
/**
|
13181
|
+
* Makes this extension the active Web Authentication API request proxy.
|
13182
|
+
*
|
13183
|
+
* 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.
|
13184
|
+
*
|
13185
|
+
* This method fails with an error if a different extension is already attached.
|
13186
|
+
*
|
13187
|
+
* 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.
|
13188
|
+
*
|
13189
|
+
* Refer to the `onRemoteSessionStateChange` event for signaling a change of remote session attachment from a native application to to the (possibly suspended) extension.
|
13190
|
+
*/
|
13191
|
+
export function attach(): Promise<string | undefined>;
|
13192
|
+
export function attach(callback: (error?: string | undefined) => void): void;
|
13193
|
+
|
13194
|
+
/** 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). */
|
13195
|
+
export function completeCreateRequest(details: CreateResponseDetails): Promise<void>;
|
13196
|
+
export function completeCreateRequest(details: CreateResponseDetails, callback: () => void): void;
|
13197
|
+
|
13198
|
+
/** 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). */
|
13199
|
+
export function completeGetRequest(details: GetResponseDetails): Promise<void>;
|
13200
|
+
export function completeGetRequest(details: GetResponseDetails, callback: () => void): void;
|
13201
|
+
|
13202
|
+
/** Reports the result of a `PublicKeyCredential.isUserVerifyingPlatformAuthenticator()` call. The extension must call this for every `onIsUvpaaRequest` event it has received. */
|
13203
|
+
export function completeIsUvpaaRequest(details: IsUvpaaResponseDetails): Promise<void>;
|
13204
|
+
export function completeIsUvpaaRequest(details: IsUvpaaResponseDetails, callback: () => void): void;
|
13205
|
+
|
13206
|
+
/**
|
13207
|
+
* Removes this extension from being the active Web Authentication API request proxy.
|
13208
|
+
*
|
13209
|
+
* 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.
|
13210
|
+
*
|
13211
|
+
* Refer to the `onRemoteSessionStateChange` event for signaling a change of remote session attachment from a native application to to the (possibly suspended) extension.
|
13212
|
+
*/
|
13213
|
+
export function detach(): Promise<string | undefined>;
|
13214
|
+
export function detach(callback: (error?: string | undefined) => void): void;
|
13215
|
+
|
13216
|
+
/** Fires when a WebAuthn `navigator.credentials.create()` call occurs. The extension must supply a response by calling `completeCreateRequest()` with the `requestId` from `requestInfo`. */
|
13217
|
+
export const onCreateRequest: events.Event<(requestInfo: CreateRequest) => void>;
|
13218
|
+
|
13219
|
+
/** Fires when a WebAuthn `navigator.credentials.get()` call occurs. The extension must supply a response by calling `completeGetRequest()` with the `requestId` from `requestInfo` */
|
13220
|
+
export const onGetRequest: events.Event<(requestInfo: GetRequest) => void>;
|
13221
|
+
|
13222
|
+
/** Fires when a `PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()` call occurs. The extension must supply a response by calling `completeIsUvpaaRequest()` with the `requestId` from `requestInfo` */
|
13223
|
+
export const onIsUvpaaRequest: events.Event<(requestInfo: IsUvpaaRequest) => void>;
|
13224
|
+
|
13225
|
+
/**
|
13226
|
+
* 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)
|
13227
|
+
*
|
13228
|
+
* 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.
|
13229
|
+
*
|
13230
|
+
* 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.
|
13231
|
+
*
|
13232
|
+
* The event listener must be registered synchronously at load time.
|
13233
|
+
*/
|
13234
|
+
export const onRemoteSessionStateChange: events.Event<() => void>;
|
13235
|
+
|
13236
|
+
/** 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. */
|
13237
|
+
export const onRequestCanceled: events.Event<(requestId: number) => void>;
|
13238
|
+
}
|
13239
|
+
|
12933
13240
|
////////////////////
|
12934
13241
|
// Web Navigation
|
12935
13242
|
////////////////////
|
@@ -12958,11 +13265,11 @@ declare namespace chrome {
|
|
12958
13265
|
/** A UUID of the document loaded. */
|
12959
13266
|
documentId: string;
|
12960
13267
|
/** The lifecycle the document is in. */
|
12961
|
-
documentLifecycle: DocumentLifecycle;
|
13268
|
+
documentLifecycle: extensionTypes.DocumentLifecycle;
|
12962
13269
|
/** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */
|
12963
13270
|
errorOccurred: boolean;
|
12964
13271
|
/** The type of frame the navigation occurred in. */
|
12965
|
-
frameType: FrameType;
|
13272
|
+
frameType: extensionTypes.FrameType;
|
12966
13273
|
/** A UUID of the parent document owning this frame. This is not set if there is no parent. */
|
12967
13274
|
parentDocumentId?: string | undefined;
|
12968
13275
|
/** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
|
@@ -13001,11 +13308,11 @@ declare namespace chrome {
|
|
13001
13308
|
/** 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. */
|
13002
13309
|
frameId: number;
|
13003
13310
|
/** The type of frame the navigation occurred in. */
|
13004
|
-
frameType: FrameType;
|
13311
|
+
frameType: extensionTypes.FrameType;
|
13005
13312
|
/** A UUID of the document loaded. (This is not set for onBeforeNavigate callbacks.) */
|
13006
13313
|
documentId?: string | undefined;
|
13007
13314
|
/** The lifecycle the document is in. */
|
13008
|
-
documentLifecycle: DocumentLifecycle;
|
13315
|
+
documentLifecycle: extensionTypes.DocumentLifecycle;
|
13009
13316
|
/** A UUID of the parent document owning this frame. This is not set if there is no parent. */
|
13010
13317
|
parentDocumentId?: string | undefined;
|
13011
13318
|
/**
|
@@ -13288,8 +13595,8 @@ declare namespace chrome {
|
|
13288
13595
|
/** Optional. The HTTP request headers that are going to be sent out with this request. */
|
13289
13596
|
requestHeaders?: HttpHeader[] | undefined;
|
13290
13597
|
documentId: string;
|
13291
|
-
documentLifecycle: DocumentLifecycle;
|
13292
|
-
frameType: FrameType;
|
13598
|
+
documentLifecycle: extensionTypes.DocumentLifecycle;
|
13599
|
+
frameType: extensionTypes.FrameType;
|
13293
13600
|
frameId: number;
|
13294
13601
|
initiator?: string | undefined;
|
13295
13602
|
parentDocumentId?: string | undefined;
|
@@ -13982,7 +14289,7 @@ declare namespace chrome {
|
|
13982
14289
|
tabId: number;
|
13983
14290
|
|
13984
14291
|
/** The resource type of the request. */
|
13985
|
-
type: ResourceType
|
14292
|
+
type: `${ResourceType}`;
|
13986
14293
|
|
13987
14294
|
/** The URL of the request. */
|
13988
14295
|
url: string;
|
@@ -14024,7 +14331,7 @@ declare namespace chrome {
|
|
14024
14331
|
responseHeaders?: ModifyHeaderInfo[] | undefined;
|
14025
14332
|
|
14026
14333
|
/** The type of action to perform. */
|
14027
|
-
type: RuleActionType
|
14334
|
+
type: `${RuleActionType}`;
|
14028
14335
|
}
|
14029
14336
|
|
14030
14337
|
export interface RuleCondition {
|
@@ -14032,7 +14339,7 @@ declare namespace chrome {
|
|
14032
14339
|
* Specifies whether the network request is first-party or third-party to the domain from which it originated.
|
14033
14340
|
* If omitted, all requests are accepted.
|
14034
14341
|
*/
|
14035
|
-
domainType?: DomainType | undefined;
|
14342
|
+
domainType?: `${DomainType}` | undefined;
|
14036
14343
|
|
14037
14344
|
/**
|
14038
14345
|
* @deprecated since Chrome 101. Use initiatorDomains instead.
|
@@ -14119,7 +14426,7 @@ declare namespace chrome {
|
|
14119
14426
|
* Only one of requestMethods and excludedRequestMethods should be specified.
|
14120
14427
|
* If neither of them is specified, all request methods are matched.
|
14121
14428
|
*/
|
14122
|
-
excludedRequestMethods?: RequestMethod[] | undefined;
|
14429
|
+
excludedRequestMethods?: `${RequestMethod}`[] | undefined;
|
14123
14430
|
|
14124
14431
|
/**
|
14125
14432
|
* List of resource types which the rule won't match.
|
@@ -14127,7 +14434,7 @@ declare namespace chrome {
|
|
14127
14434
|
* and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
|
14128
14435
|
* If neither of them is specified, all resource types except "main_frame" are blocked.
|
14129
14436
|
*/
|
14130
|
-
excludedResourceTypes?: ResourceType[] | undefined;
|
14437
|
+
excludedResourceTypes?: `${ResourceType}`[] | undefined;
|
14131
14438
|
|
14132
14439
|
/**
|
14133
14440
|
* List of {@link chrome.tabs.Tab.id} which the rule should not match.
|
@@ -14158,7 +14465,7 @@ declare namespace chrome {
|
|
14158
14465
|
* Note: Specifying a {@link chrome.declarativeNetRequest.RuleCondition.requestMethods} rule condition will also exclude non-HTTP(s) requests,
|
14159
14466
|
* whereas specifying {@link chrome.declarativeNetRequest.RuleCondition.excludedRequestMethods} will not.
|
14160
14467
|
*/
|
14161
|
-
requestMethods?: RequestMethod[];
|
14468
|
+
requestMethods?: `${RequestMethod}`[] | undefined;
|
14162
14469
|
|
14163
14470
|
/**
|
14164
14471
|
* List of {@link chrome.tabs.Tab.id} which the rule should not match.
|
@@ -14200,7 +14507,7 @@ declare namespace chrome {
|
|
14200
14507
|
*
|
14201
14508
|
* Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
|
14202
14509
|
*/
|
14203
|
-
resourceTypes?: ResourceType[] | undefined;
|
14510
|
+
resourceTypes?: `${ResourceType}`[] | undefined;
|
14204
14511
|
|
14205
14512
|
/**
|
14206
14513
|
* 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.
|
@@ -14270,7 +14577,7 @@ declare namespace chrome {
|
|
14270
14577
|
header: string;
|
14271
14578
|
|
14272
14579
|
/** The operation to be performed on a header. */
|
14273
|
-
operation: HeaderOperation
|
14580
|
+
operation: `${HeaderOperation}`;
|
14274
14581
|
|
14275
14582
|
/** The new value for the header.
|
14276
14583
|
* Must be specified for append and set operations.
|
@@ -14352,7 +14659,7 @@ declare namespace chrome {
|
|
14352
14659
|
/** Specifies the reason why the regular expression is not supported.
|
14353
14660
|
* Only provided if isSupported is false.
|
14354
14661
|
*/
|
14355
|
-
reason?: UnsupportedRegexReason | undefined;
|
14662
|
+
reason?: `${UnsupportedRegexReason}` | undefined;
|
14356
14663
|
}
|
14357
14664
|
|
14358
14665
|
export interface TabActionCountUpdate {
|
@@ -14907,7 +15214,7 @@ declare namespace chrome {
|
|
14907
15214
|
/** 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}. */
|
14908
15215
|
matches?: string[];
|
14909
15216
|
/** Specifies when JavaScript files are injected into the web page. The preferred and default value is document_idle */
|
14910
|
-
runAt?: RunAt;
|
15217
|
+
runAt?: extensionTypes.RunAt;
|
14911
15218
|
/** The JavaScript execution environment to run the script in. The default is `USER_SCRIPT` */
|
14912
15219
|
world?: ExecutionWorld;
|
14913
15220
|
/**
|
@@ -14941,11 +15248,6 @@ declare namespace chrome {
|
|
14941
15248
|
file?: string;
|
14942
15249
|
}
|
14943
15250
|
|
14944
|
-
/**
|
14945
|
-
* Enum for the run-at property.
|
14946
|
-
*/
|
14947
|
-
export type RunAt = "document_start" | "document_end" | "document_idle";
|
14948
|
-
|
14949
15251
|
/**
|
14950
15252
|
* Configures the `USER_SCRIPT` execution environment.
|
14951
15253
|
*
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.325",
|
4
4
|
"description": "TypeScript definitions for chrome",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -94,6 +94,6 @@
|
|
94
94
|
"@types/har-format": "*"
|
95
95
|
},
|
96
96
|
"peerDependencies": {},
|
97
|
-
"typesPublisherContentHash": "
|
97
|
+
"typesPublisherContentHash": "c1d7a98a250e307669524f700baba806e6e2a28d0fd1402c7f9e197c29e908c2",
|
98
98
|
"typeScriptVersion": "5.1"
|
99
99
|
}
|