@types/chrome 0.0.323 → 0.0.324

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +174 -229
  3. 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, 16 May 2025 23:33:24 GMT
11
+ * Last updated: Fri, 30 May 2025 00:47:14 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]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */
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
- /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
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: string;
166
- /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
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
- /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
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
- /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
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
- /** Optional. 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 * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */
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
- /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
186
+ /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
190
187
  tabId?: number | undefined;
191
- /** Optional. 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 * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */
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
- /** Optional. The id of the window to open the action popup in. Defaults to the currently-active window if unspecified. */
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
- /** Optional. The ID of the tab to query state for. If no tab is specified, the non-tab-specific state is returned. */
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 id of the tab for which you want to modify the action.
224
- * @return The `disable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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 id of the tab for which you want to modify the action.
241
- * @return The `enable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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
- * @return The `getBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only).
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
- * @since Chrome 88
268
- * Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned.
269
- * If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the
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
- export function getBadgeTextColor(details: TabDetails, callback: (result: ColorArray) => void): void;
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
- * @return The `getPopup` method provides its result via callback or returned as a `Promise` (MV3 only).
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
272
  * 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
- * Gets the title of the action.
318
- * @return The `getTitle` method provides its result via callback or returned as a `Promise` (MV3 only).
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
- export function getUserSettings(callback: (userSettings: UserSettings) => void): void;
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
- * @since Chrome 99
350
- * Opens the extension's popup.
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
- * @return The `openPopup` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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
- * @return The `setBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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
- * @return The `setBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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
- * @return The `setBadgeTextColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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
- * @since Chrome 88
406
- * 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,
407
- * or as dictionary of either one of those. Either the path or the imageData property must be specified.
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
- * @return The `setPopup` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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
- * @return The `setTitle` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
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: chrome.events.Event<(tab: chrome.tabs.Tab) => void>;
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: chrome.events.Event<(change: UserSettingsChange) => void>;
366
+ export const onUserSettingsChanged: events.Event<(change: UserSettingsChange) => void>;
447
367
  }
448
368
 
449
369
  ////////////////////
@@ -4497,6 +4417,84 @@ declare namespace chrome {
4497
4417
  export var onRequestExternal: OnRequestEvent;
4498
4418
  }
4499
4419
 
4420
+ ////////////////////
4421
+ // Extension Types
4422
+ ////////////////////
4423
+ /** The `chrome.extensionTypes` API contains type declarations for Chrome extensions. */
4424
+ export namespace extensionTypes {
4425
+ /**
4426
+ * The origin of injected CSS.
4427
+ * @since Chrome 66
4428
+ */
4429
+ export type CSSOrigin = "author" | "user";
4430
+
4431
+ /**
4432
+ * The document lifecycle of the frame.
4433
+ * @since Chrome 106
4434
+ */
4435
+ export type DocumentLifecycle = "prerender" | "active" | "cached" | "pending_deletion";
4436
+
4437
+ /**
4438
+ * The type of frame.
4439
+ * @since Chrome 106
4440
+ */
4441
+ export type FrameType = "outermost_frame" | "fenced_frame" | "sub_frame";
4442
+
4443
+ /** Details about the format and quality of an image. */
4444
+ export interface ImageDetails {
4445
+ /** The format of the resulting image. Default is `"jpeg"`. */
4446
+ format?: ImageFormat | undefined;
4447
+ /** 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. */
4448
+ quality?: number | undefined;
4449
+ }
4450
+
4451
+ /**
4452
+ * The format of an image.
4453
+ * @since Chrome 44
4454
+ */
4455
+ export type ImageFormat = "jpeg" | "png";
4456
+
4457
+ /** 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. */
4458
+ export interface InjectDetails {
4459
+ /** 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. */
4460
+ allFrames?: boolean | undefined;
4461
+ /**
4462
+ * JavaScript or CSS code to inject.
4463
+ *
4464
+ * **Warning:** Be careful using the `code` parameter. Incorrect use of it may open your extension to cross site scripting attacks
4465
+ */
4466
+ code?: string | undefined;
4467
+ /**
4468
+ * The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to `"author"`.
4469
+ * @since Chrome 66
4470
+ */
4471
+ cssOrigin?: CSSOrigin | undefined;
4472
+ /** JavaScript or CSS file to inject. */
4473
+ file?: string | undefined;
4474
+ /**
4475
+ * The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame).
4476
+ * @since Chrome 50
4477
+ */
4478
+ frameId?: number | undefined;
4479
+ /** 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`. */
4480
+ matchAboutBlank?: boolean;
4481
+ /** The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". */
4482
+ runAt?: RunAt | undefined;
4483
+ }
4484
+
4485
+ /**
4486
+ * The soonest that the JavaScript or CSS will be injected into the tab.
4487
+ *
4488
+ * "document_start" : Script is injected after any files from css, but before any other DOM is constructed or any other script is run.
4489
+ *
4490
+ * "document_end" : Script is injected immediately after the DOM is complete, but before subresources like images and frames have loaded.
4491
+ *
4492
+ * "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.
4493
+ * @since Chrome 44
4494
+ */
4495
+ export type RunAt = "document_start" | "document_end" | "document_idle";
4496
+ }
4497
+
4500
4498
  ////////////////////
4501
4499
  // File Browser Handler
4502
4500
  ////////////////////
@@ -8706,9 +8704,6 @@ declare namespace chrome {
8706
8704
  export function addListener(callback: (info: OnReceiveErrorInfo) => void): void;
8707
8705
  }
8708
8706
 
8709
- type DocumentLifecycle = "prerender" | "active" | "cached" | "pending_deletion";
8710
- type FrameType = "outermost_frame" | "fenced_frame" | "sub_frame";
8711
-
8712
8707
  ////////////////////
8713
8708
  // Runtime
8714
8709
  ////////////////////
@@ -8864,7 +8859,7 @@ declare namespace chrome {
8864
8859
  * 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
8860
  * @since Chrome 106
8866
8861
  */
8867
- documentLifecycle?: DocumentLifecycle | undefined;
8862
+ documentLifecycle?: extensionTypes.DocumentLifecycle | undefined;
8868
8863
  /**
8869
8864
  * A UUID of the document that opened the connection.
8870
8865
  * @since Chrome 106
@@ -9698,7 +9693,7 @@ declare namespace chrome {
9698
9693
  js?: string[];
9699
9694
  matches?: string[];
9700
9695
  persistAcrossSessions?: boolean;
9701
- runAt?: "document_start" | "document_end" | "document_idle";
9696
+ runAt?: extensionTypes.RunAt;
9702
9697
  world?: ExecutionWorld;
9703
9698
  }
9704
9699
 
@@ -11143,45 +11138,6 @@ declare namespace chrome {
11143
11138
  defaultZoomFactor?: number | undefined;
11144
11139
  }
11145
11140
 
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
11141
  export interface CreateProperties {
11186
11142
  /** 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
11143
  index?: number | undefined;
@@ -11263,19 +11219,6 @@ declare namespace chrome {
11263
11219
  autoDiscardable?: boolean | undefined;
11264
11220
  }
11265
11221
 
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
11222
  export interface ReloadProperties {
11280
11223
  /** Optional. Whether using any local cache. Default is false. */
11281
11224
  bypassCache?: boolean | undefined;
@@ -11538,21 +11481,21 @@ declare namespace chrome {
11538
11481
  * @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
11482
  * @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
11483
  */
11541
- export function executeScript(details: InjectDetails): Promise<any[]>;
11484
+ export function executeScript(details: extensionTypes.InjectDetails): Promise<any[]>;
11542
11485
  /**
11543
11486
  * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
11544
11487
  * @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
11488
  * @param callback Optional. Called after all the JavaScript has been executed.
11546
11489
  * Parameter result: The result of the script in every injected frame.
11547
11490
  */
11548
- export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void;
11491
+ export function executeScript(details: extensionTypes.InjectDetails, callback?: (result: any[]) => void): void;
11549
11492
  /**
11550
11493
  * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
11551
11494
  * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
11552
11495
  * @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
11496
  * @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
11497
  */
11555
- export function executeScript(tabId: number, details: InjectDetails): Promise<any[]>;
11498
+ export function executeScript(tabId: number, details: extensionTypes.InjectDetails): Promise<any[]>;
11556
11499
  /**
11557
11500
  * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
11558
11501
  * @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 +11503,11 @@ declare namespace chrome {
11560
11503
  * @param callback Optional. Called after all the JavaScript has been executed.
11561
11504
  * Parameter result: The result of the script in every injected frame.
11562
11505
  */
11563
- export function executeScript(tabId: number, details: InjectDetails, callback?: (result: any[]) => void): void;
11506
+ export function executeScript(
11507
+ tabId: number,
11508
+ details: extensionTypes.InjectDetails,
11509
+ callback?: (result: any[]) => void,
11510
+ ): void;
11564
11511
  /** Retrieves details about the specified tab. */
11565
11512
  export function get(tabId: number, callback: (tab: Tab) => void): void;
11566
11513
  /**
@@ -11735,14 +11682,17 @@ declare namespace chrome {
11735
11682
  * @param options Optional. Details about the format and quality of an image.
11736
11683
  * @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
11684
  */
11738
- export function captureVisibleTab(options: CaptureVisibleTabOptions): Promise<string>;
11685
+ export function captureVisibleTab(options: extensionTypes.ImageDetails): Promise<string>;
11739
11686
  /**
11740
11687
  * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
11741
11688
  * @param options Optional. Details about the format and quality of an image.
11742
11689
  * @param callback
11743
11690
  * 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
11691
  */
11745
- export function captureVisibleTab(options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void;
11692
+ export function captureVisibleTab(
11693
+ options: extensionTypes.ImageDetails,
11694
+ callback: (dataUrl: string) => void,
11695
+ ): void;
11746
11696
  /**
11747
11697
  * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
11748
11698
  * @param windowId Optional. The target window. Defaults to the current window.
@@ -11751,7 +11701,7 @@ declare namespace chrome {
11751
11701
  */
11752
11702
  export function captureVisibleTab(
11753
11703
  windowId: number,
11754
- options: CaptureVisibleTabOptions,
11704
+ options: extensionTypes.ImageDetails,
11755
11705
  ): Promise<string>;
11756
11706
  /**
11757
11707
  * 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 +11712,7 @@ declare namespace chrome {
11762
11712
  */
11763
11713
  export function captureVisibleTab(
11764
11714
  windowId: number,
11765
- options: CaptureVisibleTabOptions,
11715
+ options: extensionTypes.ImageDetails,
11766
11716
  callback: (dataUrl: string) => void,
11767
11717
  ): void;
11768
11718
  /**
@@ -11879,27 +11829,27 @@ declare namespace chrome {
11879
11829
  * @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
11830
  * @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
11881
11831
  */
11882
- export function insertCSS(details: InjectDetails): Promise<void>;
11832
+ export function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
11883
11833
  /**
11884
11834
  * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
11885
11835
  * @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
11836
  * @param callback Optional. Called when all the CSS has been inserted.
11887
11837
  */
11888
- export function insertCSS(details: InjectDetails, callback: () => void): void;
11838
+ export function insertCSS(details: extensionTypes.InjectDetails, callback: () => void): void;
11889
11839
  /**
11890
11840
  * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
11891
11841
  * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
11892
11842
  * @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
11843
  * @return The `insertCSS` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
11894
11844
  */
11895
- export function insertCSS(tabId: number, details: InjectDetails): Promise<void>;
11845
+ export function insertCSS(tabId: number, details: extensionTypes.InjectDetails): Promise<void>;
11896
11846
  /**
11897
11847
  * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
11898
11848
  * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
11899
11849
  * @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
11850
  * @param callback Optional. Called when all the CSS has been inserted.
11901
11851
  */
11902
- export function insertCSS(tabId: number, details: InjectDetails, callback: () => void): void;
11852
+ export function insertCSS(tabId: number, details: extensionTypes.InjectDetails, callback: () => void): void;
11903
11853
  /**
11904
11854
  * Highlights the given tabs.
11905
11855
  * @since Chrome 16
@@ -12958,11 +12908,11 @@ declare namespace chrome {
12958
12908
  /** A UUID of the document loaded. */
12959
12909
  documentId: string;
12960
12910
  /** The lifecycle the document is in. */
12961
- documentLifecycle: DocumentLifecycle;
12911
+ documentLifecycle: extensionTypes.DocumentLifecycle;
12962
12912
  /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */
12963
12913
  errorOccurred: boolean;
12964
12914
  /** The type of frame the navigation occurred in. */
12965
- frameType: FrameType;
12915
+ frameType: extensionTypes.FrameType;
12966
12916
  /** A UUID of the parent document owning this frame. This is not set if there is no parent. */
12967
12917
  parentDocumentId?: string | undefined;
12968
12918
  /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
@@ -13001,11 +12951,11 @@ declare namespace chrome {
13001
12951
  /** 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
12952
  frameId: number;
13003
12953
  /** The type of frame the navigation occurred in. */
13004
- frameType: FrameType;
12954
+ frameType: extensionTypes.FrameType;
13005
12955
  /** A UUID of the document loaded. (This is not set for onBeforeNavigate callbacks.) */
13006
12956
  documentId?: string | undefined;
13007
12957
  /** The lifecycle the document is in. */
13008
- documentLifecycle: DocumentLifecycle;
12958
+ documentLifecycle: extensionTypes.DocumentLifecycle;
13009
12959
  /** A UUID of the parent document owning this frame. This is not set if there is no parent. */
13010
12960
  parentDocumentId?: string | undefined;
13011
12961
  /**
@@ -13288,8 +13238,8 @@ declare namespace chrome {
13288
13238
  /** Optional. The HTTP request headers that are going to be sent out with this request. */
13289
13239
  requestHeaders?: HttpHeader[] | undefined;
13290
13240
  documentId: string;
13291
- documentLifecycle: DocumentLifecycle;
13292
- frameType: FrameType;
13241
+ documentLifecycle: extensionTypes.DocumentLifecycle;
13242
+ frameType: extensionTypes.FrameType;
13293
13243
  frameId: number;
13294
13244
  initiator?: string | undefined;
13295
13245
  parentDocumentId?: string | undefined;
@@ -14907,7 +14857,7 @@ declare namespace chrome {
14907
14857
  /** 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
14858
  matches?: string[];
14909
14859
  /** Specifies when JavaScript files are injected into the web page. The preferred and default value is document_idle */
14910
- runAt?: RunAt;
14860
+ runAt?: extensionTypes.RunAt;
14911
14861
  /** The JavaScript execution environment to run the script in. The default is `USER_SCRIPT` */
14912
14862
  world?: ExecutionWorld;
14913
14863
  /**
@@ -14941,11 +14891,6 @@ declare namespace chrome {
14941
14891
  file?: string;
14942
14892
  }
14943
14893
 
14944
- /**
14945
- * Enum for the run-at property.
14946
- */
14947
- export type RunAt = "document_start" | "document_end" | "document_idle";
14948
-
14949
14894
  /**
14950
14895
  * Configures the `USER_SCRIPT` execution environment.
14951
14896
  *
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.323",
3
+ "version": "0.0.324",
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": "074305d089f256f5db9ac97d229525e353e1da24eac729acc00f00f3cbd462e1",
97
+ "typesPublisherContentHash": "3608251c1dcc614ccdb865ee939d2bd75468aba9bd27570e630bf6de852dce15",
98
98
  "typeScriptVersion": "5.1"
99
99
  }