@wxt-dev/browser 0.1.38 → 0.1.40

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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/gen/index.d.ts +143 -90
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wxt-dev/browser",
3
3
  "description": "Provides a cross-browser API for using extension APIs and types based on @types/chrome",
4
- "version": "0.1.38",
4
+ "version": "0.1.40",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
7
7
  "types": "src/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "src"
20
20
  ],
21
21
  "devDependencies": {
22
- "@types/chrome": "0.1.38",
22
+ "@types/chrome": "0.1.40",
23
23
  "@types/node": "^20.0.0",
24
24
  "nano-spawn": "^2.0.0",
25
25
  "typescript": "^5.9.3",
@@ -348,9 +348,10 @@ export namespace Browser {
348
348
  export function setIcon(details: TabIconDetails, callback: () => void): void;
349
349
 
350
350
  /**
351
- * Sets the html document to be opened as a popup when the user clicks on the action's icon.
351
+ * Sets the HTML document to be opened as a popup when the user clicks on the action's icon.
352
352
  *
353
353
  * Can return its result via Promise.
354
+ * @since Chrome 96
354
355
  */
355
356
  export function setPopup(details: PopupDetails): Promise<void>;
356
357
  export function setPopup(details: PopupDetails, callback: () => void): void;
@@ -1167,6 +1168,7 @@ export namespace Browser {
1167
1168
  * Clears websites' cache storage data.
1168
1169
  *
1169
1170
  * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1171
+ * @since Chrome 72
1170
1172
  */
1171
1173
  export function removeCacheStorage(options: RemovalOptions): Promise<void>;
1172
1174
  export function removeCacheStorage(options: RemovalOptions, callback: () => void): void;
@@ -2435,7 +2437,17 @@ export namespace Browser {
2435
2437
  * Exactly one of `imageData` or `path` must be specified. Both are dictionaries mapping a number of pixels to an image representation. The image representation in `imageData` is an `ImageData` object; for example, from a `canvas` element, while the image representation in `path` is the path to an image file relative to the extension's manifest. If `scale` screen pixels fit into a device-independent pixel, the `scale * n` icon is used. If that scale is missing, another image is resized to the required size.
2436
2438
  */
2437
2439
  export class SetIcon {
2438
- constructor(options?: { imageData?: ImageData | { [size: string]: ImageData } | undefined });
2440
+ constructor(
2441
+ options:
2442
+ | {
2443
+ imageData: ImageData | { [index: number]: ImageData };
2444
+ path?: string | { [index: number]: string } | undefined;
2445
+ }
2446
+ | {
2447
+ imageData?: ImageData | { [index: number]: ImageData } | undefined;
2448
+ path: string | { [index: number]: string };
2449
+ },
2450
+ );
2439
2451
  }
2440
2452
 
2441
2453
  /** Provides the Declarative Event API consisting of {@link events.Event.addRules addRules}, {@link events.Event.removeRules removeRules}, and {@link events.Event.getRules getRules}. */
@@ -3332,7 +3344,7 @@ export namespace Browser {
3332
3344
  /** Indicates the data type of the option. The requested data type must match the real data type of the underlying option. */
3333
3345
  type: `${OptionType}`;
3334
3346
  /** Indicates the value to set. Leave unset to request automatic setting for options that have `autoSettable` enabled. The data type supplied for `value` must match `type`. */
3335
- value?: string | number | boolean | number;
3347
+ value?: string | number | boolean | number[];
3336
3348
  }
3337
3349
 
3338
3350
  /**
@@ -3562,6 +3574,8 @@ export namespace Browser {
3562
3574
  /**
3563
3575
  * Performs a document scan and returns a Promise that resolves with a {@link ScanResults} object. If a callback is passed to this function, the returned data is passed to it instead.
3564
3576
  * @param options An object containing scan parameters.
3577
+ *
3578
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
3565
3579
  */
3566
3580
  export function scan(options: ScanOptions): Promise<ScanResults>;
3567
3581
  export function scan(options: ScanOptions, callback: (result: ScanResults) => void): void;
@@ -4366,9 +4380,12 @@ export namespace Browser {
4366
4380
  }
4367
4381
 
4368
4382
  /**
4369
- * Retrieves the network details of the device's default network. If the user is not affiliated or the device is not connected to a network, runtime.lastError will be set with a failure reason.
4383
+ * Retrieves the network details of the device's default network. If the user is not affiliated or the device is not connected to a network, {@link runtime.lastError} will be set with a failure reason.
4370
4384
  * @param callback Called with the device's default network's NetworkDetails.
4385
+ *
4386
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
4371
4387
  */
4388
+ export function getNetworkDetails(): Promise<NetworkDetails>;
4372
4389
  export function getNetworkDetails(callback: (networkDetails: NetworkDetails) => void): void;
4373
4390
  }
4374
4391
 
@@ -6310,7 +6327,7 @@ export namespace Browser {
6310
6327
  * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
6311
6328
  * @param details Profile options.
6312
6329
  *
6313
- * Can return its result via Promise since Chrome 105.
6330
+ * Can return its result via Promise since Chrome 106.
6314
6331
  */
6315
6332
  export function getProfileUserInfo(details?: ProfileDetails): Promise<ProfileUserInfo>;
6316
6333
  export function getProfileUserInfo(
@@ -6325,7 +6342,7 @@ export namespace Browser {
6325
6342
  * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with `getAuthToken`.
6326
6343
  * @param details Token information.
6327
6344
  *
6328
- * Can return its result via Promise since Chrome 105.
6345
+ * Can return its result via Promise since Chrome 106.
6329
6346
  */
6330
6347
  export function removeCachedAuthToken(details: InvalidTokenDetails): Promise<void>;
6331
6348
  export function removeCachedAuthToken(details: InvalidTokenDetails, callback: () => void): void;
@@ -7913,7 +7930,7 @@ export namespace Browser {
7913
7930
 
7914
7931
  export enum ClientCertificateType {
7915
7932
  ECDSA_SIGN = "ecdsaSign",
7916
- RAS_SIGN = "rasSign",
7933
+ RSA_SIGN = "rsaSign",
7917
7934
  }
7918
7935
 
7919
7936
  export interface SelectDetails {
@@ -8808,7 +8825,7 @@ export namespace Browser {
8808
8825
  export type QueryInfo =
8809
8826
  & {
8810
8827
  /** String to query with the default search provider. */
8811
- text?: string | undefined;
8828
+ text: string;
8812
8829
  }
8813
8830
  & (
8814
8831
  | {
@@ -9249,36 +9266,37 @@ export namespace Browser {
9249
9266
 
9250
9267
  export interface ManifestBase {
9251
9268
  // Required
9269
+ /** An integer specifying the version of the manifest file format that your extension uses. */
9252
9270
  manifest_version: number;
9271
+ /** A string that identifies the extension in the Chrome Web Store, the install dialog, and the user's Chrome Extensions page (`chrome://extensions`). The maximum length is 75 characters. */
9253
9272
  name: string;
9273
+ /** A string that identifies the extension's version number. */
9254
9274
  version: string;
9255
9275
 
9256
9276
  // Recommended
9277
+ /** A string that defines the default language of an extension that supports multiple locales. Examples include "en" and "pt_BR". This key is required in localized extensions, and must not be used in extensions that aren't localized. */
9257
9278
  default_locale?: string | undefined;
9279
+ /** A string that describes the extension on both the Chrome Web Store and the user's extension management page. The maximum length is 132 characters. */
9258
9280
  description?: string | undefined;
9281
+ /** One or more icons that represent your extension. */
9259
9282
  icons?: ManifestIcons | undefined;
9260
9283
 
9261
9284
  // Optional
9262
- author?: {
9263
- email: string;
9264
- } | undefined;
9265
- background_page?: string | undefined;
9285
+ /** @deprecated As of February 2024, the `author` key is no longer supported by Chrome or the Chrome Web Store. If present, it's silently ignored. */
9286
+ author?: { email: string } | undefined;
9287
+ /** Defines overrides for selected Chrome settings. */
9266
9288
  chrome_settings_overrides?: {
9267
9289
  homepage?: string | undefined;
9268
9290
  search_provider?: SearchProvider | undefined;
9269
9291
  startup_pages?: string[] | undefined;
9270
9292
  } | undefined;
9271
- chrome_ui_overrides?: {
9272
- bookmarks_ui?: {
9273
- remove_bookmark_shortcut?: boolean | undefined;
9274
- remove_button?: boolean | undefined;
9275
- } | undefined;
9276
- } | undefined;
9293
+ /** Defines overrides for default Chrome pages. */
9277
9294
  chrome_url_overrides?: {
9278
9295
  bookmarks?: string | undefined;
9279
9296
  history?: string | undefined;
9280
9297
  newtab?: string | undefined;
9281
9298
  } | undefined;
9299
+ /** Defines keyboard shortcuts within the extension. */
9282
9300
  commands?: {
9283
9301
  [name: string]: {
9284
9302
  suggested_key?: {
@@ -9296,38 +9314,30 @@ export namespace Browser {
9296
9314
  matches?: string[] | undefined;
9297
9315
  permissions?: string[] | undefined;
9298
9316
  } | undefined;
9299
- content_scripts?:
9300
- | Array<{
9301
- matches?: string[] | undefined;
9302
- exclude_matches?: string[] | undefined;
9303
- css?: string[] | undefined;
9304
- js?: string[] | undefined;
9305
- run_at?: string | undefined;
9306
- all_frames?: boolean | undefined;
9307
- match_about_blank?: boolean | undefined;
9308
- include_globs?: string[] | undefined;
9309
- exclude_globs?: string[] | undefined;
9310
- }>
9311
- | undefined;
9312
9317
  converted_from_user_script?: boolean | undefined;
9318
+ /** Specifies a value for the Cross-Origin-Embedder-Policy HTTP header, which configures embedding of cross-origin resources in an extension page. */
9319
+ cross_origin_embedder_policy?: { value: string } | undefined;
9320
+ /** Specifies a value for the Cross-Origin-Opener-Policy HTTP header, which lets you ensure that a top-level extension page doesn't share a browsing context group with cross-origin documents. */
9321
+ cross_origin_opener_policy?: { value: string } | undefined;
9313
9322
  current_locale?: string | undefined;
9323
+ /** Defines static rules for the declarativeNetRequest API, which allows blocking and modifying of network requests. */
9324
+ declarative_net_request?: { rule_resources?: declarativeNetRequest.Ruleset[] } | undefined;
9325
+ /** Defines pages that use the DevTools APIs. */
9314
9326
  devtools_page?: string | undefined;
9315
9327
  event_rules?:
9316
9328
  | Array<{
9317
9329
  event?: string | undefined;
9318
- actions?:
9319
- | Array<{
9320
- type: string;
9321
- }>
9322
- | undefined;
9330
+ actions?: Array<{ type: string }> | undefined;
9323
9331
  conditions?: Browser.declarativeContent.PageStateMatcherProperties[] | undefined;
9324
9332
  }>
9325
9333
  | undefined;
9334
+ /** Specifies what other pages and extensions can connect to your extensions. */
9326
9335
  externally_connectable?: {
9327
9336
  ids?: string[] | undefined;
9328
9337
  matches?: string[] | undefined;
9329
9338
  accepts_tls_channel_id?: boolean | undefined;
9330
9339
  } | undefined;
9340
+ /** Provides access to the fileBrowserHandler API, which lets extensions access the ChromeOS file browser. */
9331
9341
  file_browser_handlers?:
9332
9342
  | Array<{
9333
9343
  id?: string | undefined;
@@ -9335,35 +9345,44 @@ export namespace Browser {
9335
9345
  file_filters?: string[] | undefined;
9336
9346
  }>
9337
9347
  | undefined;
9348
+ /** Allows access to the fileSystemProvider API, which lets extensions create file systems that ChromeOS can use. */
9338
9349
  file_system_provider_capabilities?: {
9350
+ /** Whether configuring via onConfigureRequested is supported. By default: false. */
9339
9351
  configurable?: boolean | undefined;
9352
+ /** Whether setting watchers and notifying about changes is supported. By default: false. */
9340
9353
  watchable?: boolean | undefined;
9354
+ /** Whether multiple (more than one) mounted file systems are supported. By default: false. */
9341
9355
  multiple_mounts?: boolean | undefined;
9342
- source?: string | undefined;
9356
+ /** Files app uses above information in order to render related UI elements appropriately. For example, if `configurable` is set to true, then a menu item for configuring volumes will be rendered. Similarly, if `multiple_mounts` is set to true, then Files app will allow to add more than one mount points from the UI. If `watchable` is false, then a refresh button will be rendered. Note, that if possible you should add support for watchers, so changes on the file system can be reflected immediately and automatically. */
9357
+ source: "file" | "device" | "network";
9343
9358
  } | undefined;
9359
+ /** string specifying a URL for the extension's homepage. If this is undefined, the homepage defaults to the extension's Chrome Web Store page. This field is particularly useful if you host the extension on your own site. */
9344
9360
  homepage_url?: string | undefined;
9361
+ /** Allows resources to be imported into the extension. */
9345
9362
  import?:
9346
9363
  | Array<{
9347
9364
  id: string;
9348
9365
  minimum_version?: string | undefined;
9349
9366
  }>
9350
9367
  | undefined;
9351
- export?: {
9352
- whitelist?: string[] | undefined;
9353
- } | undefined;
9354
- incognito?: string | undefined;
9368
+ /** Allows resources to be exported from the extension. */
9369
+ export?: { allowlist?: string[] | undefined } | undefined;
9370
+ /** Defines how the extension behaves in incognito mode. */
9371
+ incognito?: "spanning" | "split" | "not_allowed" | undefined;
9372
+ /** Allows the use of the Input Method Editor API. */
9355
9373
  input_components?:
9356
9374
  | Array<{
9357
- name?: string | undefined;
9358
- type?: string | undefined;
9375
+ name: string;
9359
9376
  id?: string | undefined;
9360
- description?: string | undefined;
9361
9377
  language?: string[] | string | undefined;
9362
- layouts?: string[] | undefined;
9363
- indicator?: string | undefined;
9378
+ layouts?: string[] | string | undefined;
9379
+ input_view?: string | undefined;
9380
+ options_page?: string | undefined;
9364
9381
  }>
9365
9382
  | undefined;
9383
+ /** Specifies your extension's ID for various development use cases. */
9366
9384
  key?: string | undefined;
9385
+ /** Defines the oldest Chrome version that can install your extension. The value must be a substring of an existing Chrome browser version string, such as "107" or "107.0.5304.87". Users with versions of Chrome older than the minimum version see a "Not compatible" warning in the Chrome Web Store, and are unable to install your extension. If you add this to an existing extension, users whose Chrome version is older won't receive automatic updates to your extension. This includes business users in ephemeral mode. */
9367
9386
  minimum_chrome_version?: string | undefined;
9368
9387
  nacl_modules?:
9369
9388
  | Array<{
@@ -9371,53 +9390,39 @@ export namespace Browser {
9371
9390
  mime_type: string;
9372
9391
  }>
9373
9392
  | undefined;
9393
+ /** Allows the use of an OAuth 2.0 security ID. The value of this key must be an object with "client_id" and "scopes" properties. */
9374
9394
  oauth2?: {
9375
9395
  client_id: string;
9376
9396
  scopes?: string[] | undefined;
9377
9397
  } | undefined;
9378
9398
  offline_enabled?: boolean | undefined;
9379
- omnibox?: {
9380
- keyword: string;
9381
- } | undefined;
9399
+ /** Allows the extension to register a keyword in Chrome's address bar. */
9400
+ omnibox?: { keyword: string } | undefined;
9401
+ /** Specifies a path to an options.html file for the extension to use as an options page. */
9382
9402
  options_page?: string | undefined;
9403
+ /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */
9383
9404
  options_ui?: {
9384
- page?: string | undefined;
9385
- chrome_style?: boolean | undefined;
9386
- open_in_tab?: boolean | undefined;
9405
+ /** Path to the options page, relative to the extension's root. */
9406
+ page: string;
9407
+ /** Specify as `false` to declare an embedded options page. If `true`, the extension's options page will be opened in a new tab rather than embedded in `chrome://extensions`. */
9408
+ open_in_tab: boolean;
9387
9409
  } | undefined;
9388
- platforms?:
9389
- | Array<{
9390
- nacl_arch?: string | undefined;
9391
- sub_package_path: string;
9392
- }>
9393
- | undefined;
9394
- plugins?:
9395
- | Array<{
9396
- path: string;
9397
- }>
9398
- | undefined;
9410
+ /** Lists technologies required to use the extension. */
9399
9411
  requirements?: {
9400
- "3D"?: {
9401
- features?: string[] | undefined;
9402
- } | undefined;
9403
- plugins?: {
9404
- npapi?: boolean | undefined;
9405
- } | undefined;
9412
+ "3D"?: { features?: string[] | undefined } | undefined;
9413
+ /** @deprecated NPAPI Plugin support for extensions has been discontinued as of Chrome version 45 */
9414
+ plugins?: { npapi?: boolean | undefined } | undefined;
9406
9415
  } | undefined;
9416
+ /** Defines a set of extension pages that don't have access to extension APIs or direct access to non-sandboxed pages. */
9407
9417
  sandbox?: {
9408
9418
  pages: string[];
9409
9419
  content_security_policy?: string | undefined;
9410
9420
  } | undefined;
9421
+ /** A string containing a shortened version of the extension's name to be used when character space is limited. The maximum length is 12 characters. If this is undefined, a truncated version of the "name" key displays instead. */
9411
9422
  short_name?: string | undefined;
9412
- spellcheck?: {
9413
- dictionary_language?: string | undefined;
9414
- dictionary_locale?: string | undefined;
9415
- dictionary_format?: string | undefined;
9416
- dictionary_path?: string | undefined;
9417
- } | undefined;
9418
- storage?: {
9419
- managed_schema: string;
9420
- } | undefined;
9423
+ /** Declares a JSON schema for the managed storage area. */
9424
+ storage?: { managed_schema: string } | undefined;
9425
+ /** Registers the extension as a text to speech engine. */
9421
9426
  tts_engine?: {
9422
9427
  voices: Array<{
9423
9428
  voice_name: string;
@@ -9426,13 +9431,14 @@ export namespace Browser {
9426
9431
  event_types?: string[] | undefined;
9427
9432
  }>;
9428
9433
  } | undefined;
9434
+ /** A string containing the URL of the extension's updates page. Use this key if you're hosting your extension outside the Chrome Web Store. */
9429
9435
  update_url?: string | undefined;
9436
+ /** A string describing the extension's version. Examples include "1.0 beta" and "build rc2". If this is unspecified, the "version" value displays on the extension management page instead. */
9430
9437
  version_name?: string | undefined;
9431
9438
  [key: string]: any;
9432
9439
  }
9433
9440
 
9434
9441
  export interface ManifestV2 extends ManifestBase {
9435
- // Required
9436
9442
  manifest_version: 2;
9437
9443
 
9438
9444
  // Pick one (or none)
@@ -9447,24 +9453,50 @@ export namespace Browser {
9447
9453
  persistent?: boolean | undefined;
9448
9454
  }
9449
9455
  | undefined;
9456
+ /** Specifies JavaScript or CSS files to be used when the user opens certain web pages. */
9457
+ content_scripts?:
9458
+ | Array<{
9459
+ matches?: string[] | undefined;
9460
+ exclude_matches?: string[] | undefined;
9461
+ css?: string[] | undefined;
9462
+ js?: string[] | undefined;
9463
+ run_at?: string | undefined;
9464
+ all_frames?: boolean | undefined;
9465
+ match_about_blank?: boolean | undefined;
9466
+ include_globs?: string[] | undefined;
9467
+ exclude_globs?: string[] | undefined;
9468
+ }>
9469
+ | undefined;
9470
+ /** Defines restrictions on the scripts, styles, and other resources an extension can use. */
9450
9471
  content_security_policy?: string | undefined;
9472
+ /** Declares optional permissions for your extension. */
9451
9473
  optional_permissions?: (ManifestOptionalPermission | string)[] | undefined;
9474
+ /** Enables use of particular extension APIs. */
9452
9475
  permissions?: (ManifestPermission | string)[] | undefined;
9476
+ platforms?:
9477
+ | Array<{
9478
+ nacl_arch?: string | undefined;
9479
+ sub_package_path: string;
9480
+ }>
9481
+ | undefined;
9482
+ /** Defines files within the extension that can be accessed by web pages or other extensions. */
9453
9483
  web_accessible_resources?: string[] | undefined;
9454
9484
  }
9455
9485
 
9456
9486
  export interface ManifestV3 extends ManifestBase {
9457
- // Required
9458
9487
  manifest_version: 3;
9459
9488
 
9460
9489
  // Optional
9490
+ /** Defines the appearance and behavior of the extension's icon in the Google Toolbar. */
9461
9491
  action?: ManifestAction | undefined;
9492
+ /** Specifies the JavaScript file containing the extension's service worker, which acts as an event handler. */
9462
9493
  background?:
9463
9494
  | {
9464
9495
  service_worker: string;
9465
- type?: "module"; // If the service worker uses ES modules
9496
+ type?: "module";
9466
9497
  }
9467
9498
  | undefined;
9499
+ /** Specifies JavaScript or CSS files to be used when the user opens certain web pages. */
9468
9500
  content_scripts?:
9469
9501
  | Array<{
9470
9502
  matches?: string[] | undefined;
@@ -9479,14 +9511,35 @@ export namespace Browser {
9479
9511
  world?: "ISOLATED" | "MAIN" | undefined;
9480
9512
  }>
9481
9513
  | undefined;
9514
+ /** Defines restrictions on the scripts, styles, and other resources an extension can use. */
9482
9515
  content_security_policy?: {
9483
9516
  extension_pages?: string;
9484
9517
  sandbox?: string;
9485
- };
9518
+ } | undefined;
9519
+ /** Specifies file types for ChromeOS extensions to handle. */
9520
+ file_handlers?:
9521
+ | Array<{
9522
+ /** Specifies an HTML file to show when a file is opened. The file must be within your extension. Processing the file, whether it's displayed or used in some other way, is done with JavaScript using appropriate web platform APIs. This code must be in a separate JavaScript file included via a `<script>` tag. */
9523
+ action: string;
9524
+ /** A user friendly description of the action. */
9525
+ name: string;
9526
+ /** The file types that can be processed by the page specified in "action". The items in the dictionary are a key/value pair where the key is a MIME type and the value is an array of file extensions. Only known MIME types are allowed for the key. Custom file types are allowed but the key for a custom type must be a known MIME type, and the mapping between the MIME type and the custom file type must be supported by the underlying operating system. */
9527
+ accept: { [mime_type: string]: string[] };
9528
+ /** Specifies whether multiple files should be opened in a single client or multiple clients. The default value is "single-client". */
9529
+ launch_type?: "multiple-clients" | "single-client" | undefined;
9530
+ }>
9531
+ | undefined;
9532
+ /** Lists the web pages your extension is allowed to interact with, defined using URL match patterns. User permission for these sites is requested at install time. */
9486
9533
  host_permissions?: string[] | undefined;
9534
+ /** Declares optional permissions for your extension. */
9487
9535
  optional_permissions?: ManifestOptionalPermission[] | undefined;
9536
+ /** Declares optional host permissions for your extension. */
9488
9537
  optional_host_permissions?: string[] | undefined;
9538
+ /** Enables use of particular extension APIs. */
9489
9539
  permissions?: ManifestPermission[] | undefined;
9540
+ /** Identifies an HTML file to display in a sidePanel. */
9541
+ side_panel?: { default_path: string } | undefined;
9542
+ /** Defines files within the extension that can be accessed by web pages or other extensions. */
9490
9543
  web_accessible_resources?:
9491
9544
  | Array<
9492
9545
  & {
@@ -12144,7 +12197,7 @@ export namespace Browser {
12144
12197
  * Called when the list of {@link TtsVoice} that would be returned by getVoices has changed.
12145
12198
  * @since Chrome 124
12146
12199
  */
12147
- const onVoicesChanged: Browser.events.Event<() => void>;
12200
+ export const onVoicesChanged: Browser.events.Event<() => void>;
12148
12201
  }
12149
12202
 
12150
12203
  ////////////////////
@@ -13096,7 +13149,7 @@ export namespace Browser {
13096
13149
  EXTRA_HEADERS = "extraHeaders",
13097
13150
  }
13098
13151
 
13099
- /** @since Chrome 44 */
13152
+ /** @since Chrome 79 */
13100
13153
  export enum OnErrorOccurredOptions {
13101
13154
  /** Specifies that headers can violate Cross-Origin Resource Sharing (CORS). */
13102
13155
  EXTRA_HEADERS = "extraHeaders",
@@ -13288,14 +13341,14 @@ export namespace Browser {
13288
13341
  extends SetPartial<WebRequestDetails, "documentId" | "documentLifecycle" | "frameType">
13289
13342
  {
13290
13343
  /** Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. */
13291
- requestBody: {
13344
+ requestBody?: {
13292
13345
  /** Errors when obtaining request body data. */
13293
13346
  error?: string;
13294
13347
  /** If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': \['value1', 'value2'\]}. */
13295
13348
  formData?: { [key: string]: FormDataItem[] };
13296
13349
  /** If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array. */
13297
13350
  raw?: UploadData[];
13298
- } | undefined;
13351
+ };
13299
13352
  }
13300
13353
 
13301
13354
  export interface OnBeforeSendHeadersDetails extends WebRequestDetails {
@@ -14347,7 +14400,7 @@ export namespace Browser {
14347
14400
  * The headers provided by a hypothetical response if the request does not get blocked or redirected before it is sent. Represented as an object which maps a header name to a list of string values. If not specified, the hypothetical response would return empty response headers, which can match rules which match on the non-existence of headers. E.g. `{"content-type": ["text/html; charset=utf-8", "multipart/form-data"]}`
14348
14401
  * @since Chrome 129
14349
14402
  */
14350
- responseHeaders?: { [name: string]: unknown };
14403
+ responseHeaders?: { [name: string]: string[] };
14351
14404
  /** The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. Default is -1, meaning that the request isn't related to a tab. */
14352
14405
  tabId?: number;
14353
14406
  /**
@@ -14685,13 +14738,13 @@ export namespace Browser {
14685
14738
  * Fired when the extension's side panel is closed.
14686
14739
  * @since Chrome 142
14687
14740
  */
14688
- const onClosed: events.Event<(info: PanelClosedInfo) => void>;
14741
+ export const onClosed: events.Event<(info: PanelClosedInfo) => void>;
14689
14742
 
14690
14743
  /**
14691
14744
  * Fired when the extension's side panel is opened.
14692
14745
  * @since Chrome 141
14693
14746
  */
14694
- const onOpened: events.Event<(info: PanelOpenedInfo) => void>;
14747
+ export const onOpened: events.Event<(info: PanelOpenedInfo) => void>;
14695
14748
  }
14696
14749
 
14697
14750
  ////////////////////
@@ -14797,7 +14850,7 @@ export namespace Browser {
14797
14850
  /** Specifies wildcard patterns for pages this user script will be injected into. */
14798
14851
  includeGlobs?: string[] | undefined;
14799
14852
  /** The list of ScriptSource objects defining sources of scripts to be injected into matching pages. This property must be specified for {@link register}, and when specified it must be a non-empty array.*/
14800
- js: ScriptSource[];
14853
+ js?: ScriptSource[] | undefined;
14801
14854
  /** 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 {@link register}. */
14802
14855
  matches?: string[] | undefined;
14803
14856
  /** Specifies when JavaScript files are injected into the web page. The preferred and default value is `document_idle` */