@types/chrome 0.2.2 → 0.2.4

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 +92 -39
  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: Wed, 01 Jul 2026 21:01:32 GMT
11
+ * Last updated: Fri, 31 Jul 2026 19:30:21 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
@@ -179,14 +179,25 @@ declare namespace chrome {
179
179
  popup: string;
180
180
  }
181
181
 
182
- interface TabIconDetails {
183
- /** 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}' */
184
- path?: string | { [index: number]: string } | undefined;
185
- /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
186
- tabId?: number | undefined;
187
- /** 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}' */
188
- imageData?: ImageData | { [index: number]: ImageData } | undefined;
189
- }
182
+ type TabIconDetails =
183
+ & {
184
+ /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
185
+ tabId?: number | null | undefined;
186
+ }
187
+ & (
188
+ | {
189
+ /** Either an ImageData object or a dictionary {size -> ImageData} representing an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is 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}' */
190
+ imageData: ImageData | { [index: number]: ImageData };
191
+ /** Either a relative image path or a dictionary {size -> relative image path} pointing to an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is 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}' */
192
+ path?: string | { [index: string]: string } | undefined;
193
+ }
194
+ | {
195
+ /** Either an ImageData object or a dictionary {size -> ImageData} representing an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is 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}' */
196
+ imageData?: ImageData | { [index: number]: ImageData } | undefined;
197
+ /** Either a relative image path or a dictionary {size -> relative image path} pointing to an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is 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}' */
198
+ path: string | { [index: string]: string };
199
+ }
200
+ );
190
201
 
191
202
  /** @since Chrome 99 */
192
203
  interface OpenPopupOptions {
@@ -1060,7 +1071,10 @@ declare namespace chrome {
1060
1071
 
1061
1072
  /** A set of data types. Missing data types are interpreted as `false`. */
1062
1073
  interface DataTypeSet {
1063
- /** Websites' WebSQL data. */
1074
+ /**
1075
+ * Websites' WebSQL data.
1076
+ * @deprecated since Chrome 139. Support for WebSQL has been removed. This data type will be ignored.
1077
+ */
1064
1078
  webSQL?: boolean | undefined;
1065
1079
  /** Websites' IndexedDB data. */
1066
1080
  indexedDB?: boolean | undefined;
@@ -1082,7 +1096,10 @@ declare namespace chrome {
1082
1096
  cache?: boolean | undefined;
1083
1097
  /** Cache storage. */
1084
1098
  cacheStorage?: boolean | undefined;
1085
- /** Websites' appcaches. */
1099
+ /**
1100
+ * Websites' appcaches.
1101
+ * @deprecated since Chrome 98. Support for appcache has been removed. This data type will be ignored.
1102
+ */
1086
1103
  appcache?: boolean | undefined;
1087
1104
  /** Websites' file systems. */
1088
1105
  fileSystems?: boolean | undefined;
@@ -1181,6 +1198,7 @@ declare namespace chrome {
1181
1198
  * Clears websites' WebSQL data.
1182
1199
  *
1183
1200
  * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1201
+ * @deprecated since Chrome 139. Support for WebSQL has been removed. This function has no effect.
1184
1202
  */
1185
1203
  function removeWebSQL(options: RemovalOptions): Promise<void>;
1186
1204
  function removeWebSQL(options: RemovalOptions, callback: () => void): void;
@@ -1189,6 +1207,7 @@ declare namespace chrome {
1189
1207
  * Clears websites' appcache data.
1190
1208
  *
1191
1209
  * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1210
+ * @deprecated since Chrome 98. Support for appcache has been removed. This function has no effect.
1192
1211
  */
1193
1212
  function removeAppcache(options: RemovalOptions): Promise<void>;
1194
1213
  function removeAppcache(options: RemovalOptions, callback: () => void): void;
@@ -2493,7 +2512,7 @@ declare namespace chrome {
2493
2512
  *
2494
2513
  * Permissions: "declarativeWebRequest"
2495
2514
  *
2496
- * MV2 only
2515
+ * Beta and MV2 only
2497
2516
  * @deprecated Check out the {@link declarativeNetRequest} API instead
2498
2517
  */
2499
2518
  export namespace declarativeWebRequest {
@@ -2548,9 +2567,9 @@ declare namespace chrome {
2548
2567
  /** Matches if the MIME media type of a response (from the HTTP Content-Type header) is not contained in the list. */
2549
2568
  excludeContentType?: string[] | undefined;
2550
2569
  /** Matches if none of the request headers is matched by any of the HeaderFilters. */
2551
- excludeResponseHeaders?: HeaderFilter[] | undefined;
2570
+ excludeRequestHeaders?: HeaderFilter[] | undefined;
2552
2571
  /** Matches if none of the response headers is matched by any of the HeaderFilters. */
2553
- excludeResponseHeader?: HeaderFilter[] | undefined;
2572
+ excludeResponseHeaders?: HeaderFilter[] | undefined;
2554
2573
  /**
2555
2574
  * Matches if the conditions of the UrlFilter are fulfilled for the 'first party' URL of the request. The 'first party' URL of a request, when present, can be different from the request's target URL, and describes what is considered 'first party' for the sake of third-party checks for cookies.
2556
2575
  * @deprecated since Chrome 82
@@ -2617,7 +2636,7 @@ declare namespace chrome {
2617
2636
  /** Edits one or more cookies of response. Note that it is preferred to use the Cookies API because this is computationally less expensive. */
2618
2637
  interface EditResponseCookie {
2619
2638
  /** Filter for cookies that will be modified. All empty entries are ignored. */
2620
- filter: ResponseCookie;
2639
+ filter: FilterResponseCookie;
2621
2640
  /** Attributes that shall be overridden in cookies that matched the filter. Attributes that are set to an empty string are removed. */
2622
2641
  modification: ResponseCookie;
2623
2642
  }
@@ -2661,7 +2680,7 @@ declare namespace chrome {
2661
2680
  /** Existence of the Secure cookie attribute. */
2662
2681
  secure?: string | undefined;
2663
2682
  /** Filters session cookies. Session cookies have no lifetime specified in any of 'max-age' or 'expires' attributes. */
2664
- session?: boolean | undefined;
2683
+ sessionCookie?: boolean | undefined;
2665
2684
  /** Value of a cookie, may be padded in double-quotes. */
2666
2685
  value?: string | undefined;
2667
2686
  }
@@ -7230,7 +7249,7 @@ declare namespace chrome {
7230
7249
  enum ExtensionType {
7231
7250
  EXTENSION = "extension",
7232
7251
  HOSTED_APP = "hosted_app",
7233
- PACKAGE_APP = "package_app",
7252
+ PACKAGED_APP = "packaged_app",
7234
7253
  LEGACY_PACKAGED_APP = "legacy_packaged_app",
7235
7254
  THEME = "theme",
7236
7255
  LOGIN_SCREEN_EXTENSION = "login_screen_extension",
@@ -9165,9 +9184,11 @@ declare namespace chrome {
9165
9184
  }
9166
9185
 
9167
9186
  interface ManifestAction {
9168
- default_icon?: ManifestIcons | undefined;
9187
+ default_icon?: ManifestIcons | string | undefined;
9169
9188
  default_title?: string | undefined;
9170
9189
  default_popup?: string | undefined;
9190
+ /** @default 'enabled' */
9191
+ default_state?: "enabled" | "disabled";
9171
9192
  }
9172
9193
 
9173
9194
  /** Source: https://developer.chrome.com/docs/extensions/reference/permissions-list */
@@ -9273,22 +9294,37 @@ declare namespace chrome {
9273
9294
  | "webAuthenticationProxy"
9274
9295
  >;
9275
9296
 
9297
+ /** A search engine. */
9276
9298
  interface SearchProvider {
9299
+ /** Name of the search engine displayed to user. This is required if you don't set `prepopulated_id`. */
9277
9300
  name?: string | undefined;
9301
+ /** An omnibox keyword for the search engine. This is required if you don't set `prepopulated_id`. */
9278
9302
  keyword?: string | undefined;
9303
+ /** An icon URL for the search engine. This is required if you don't set `prepopulated_id`. */
9279
9304
  favicon_url?: string | undefined;
9305
+ /** The search URL the search engine uses. */
9280
9306
  search_url: string;
9307
+ /** The encoding used for search terms. This is required if you don't set `prepopulated_id`. */
9281
9308
  encoding?: string | undefined;
9309
+ /** The URL the search engine uses for suggestions. If this isn't used, the engine doesn't support suggestions. */
9282
9310
  suggest_url?: string | undefined;
9283
9311
  instant_url?: string | undefined;
9312
+ /** The URL the search engine uses for image search. If this isn't used, the engine doesn't support image search. */
9284
9313
  image_url?: string | undefined;
9314
+ /** The post parameters for `search_url`. */
9285
9315
  search_url_post_params?: string | undefined;
9316
+ /** The post parameters for `suggest_url`. */
9286
9317
  suggest_url_post_params?: string | undefined;
9318
+ /** The post parameters for `instant_url`. */
9287
9319
  instant_url_post_params?: string | undefined;
9320
+ /** The post parameters for `image_url`. */
9288
9321
  image_url_post_params?: string | undefined;
9322
+ /** A list of URL patterns that can be used in addition to `search_url`. */
9289
9323
  alternate_urls?: string[] | undefined;
9324
+ /** An ID for Chrome's built-in search engine. */
9290
9325
  prepopulated_id?: number | undefined;
9291
- is_default?: boolean | undefined;
9326
+ /** Specifies whether the search provider should be default. */
9327
+ is_default: boolean;
9292
9328
  }
9293
9329
 
9294
9330
  interface ManifestBase {
@@ -9313,8 +9349,10 @@ declare namespace chrome {
9313
9349
  author?: { email: string } | undefined;
9314
9350
  /** Defines overrides for selected Chrome settings. */
9315
9351
  chrome_settings_overrides?: {
9352
+ /** The new value for the homepage. */
9316
9353
  homepage?: string | undefined;
9317
9354
  search_provider?: SearchProvider | undefined;
9355
+ /** An array of length one containing a URL to be used as the startup page. */
9318
9356
  startup_pages?: string[] | undefined;
9319
9357
  } | undefined;
9320
9358
  /** Defines overrides for default Chrome pages. */
@@ -9326,13 +9364,16 @@ declare namespace chrome {
9326
9364
  /** Defines keyboard shortcuts within the extension. */
9327
9365
  commands?: {
9328
9366
  [name: string]: {
9329
- suggested_key?: {
9330
- default?: string | undefined;
9331
- windows?: string | undefined;
9332
- mac?: string | undefined;
9333
- chromeos?: string | undefined;
9334
- linux?: string | undefined;
9335
- } | undefined;
9367
+ suggested_key?:
9368
+ | {
9369
+ default?: string | undefined;
9370
+ windows?: string | undefined;
9371
+ mac?: string | undefined;
9372
+ chromeos?: string | undefined;
9373
+ linux?: string | undefined;
9374
+ }
9375
+ | string
9376
+ | undefined;
9336
9377
  description?: string | undefined;
9337
9378
  global?: boolean | undefined;
9338
9379
  };
@@ -9348,7 +9389,7 @@ declare namespace chrome {
9348
9389
  cross_origin_opener_policy?: { value: string } | undefined;
9349
9390
  current_locale?: string | undefined;
9350
9391
  /** Defines static rules for the declarativeNetRequest API, which allows blocking and modifying of network requests. */
9351
- declarative_net_request?: { rule_resources?: declarativeNetRequest.Ruleset[] } | undefined;
9392
+ declarative_net_request?: { rule_resources: declarativeNetRequest.Ruleset[] } | undefined;
9352
9393
  /** Defines pages that use the DevTools APIs. */
9353
9394
  devtools_page?: string | undefined;
9354
9395
  event_rules?:
@@ -9420,20 +9461,13 @@ declare namespace chrome {
9420
9461
  /** 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. */
9421
9462
  oauth2?: {
9422
9463
  client_id: string;
9423
- scopes?: string[] | undefined;
9464
+ scopes: string[];
9424
9465
  } | undefined;
9425
9466
  offline_enabled?: boolean | undefined;
9426
9467
  /** Allows the extension to register a keyword in Chrome's address bar. */
9427
9468
  omnibox?: { keyword: string } | undefined;
9428
9469
  /** Specifies a path to an options.html file for the extension to use as an options page. */
9429
9470
  options_page?: string | undefined;
9430
- /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */
9431
- options_ui?: {
9432
- /** Path to the options page, relative to the extension's root. */
9433
- page: string;
9434
- /** 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`. */
9435
- open_in_tab: boolean;
9436
- } | undefined;
9437
9471
  /** Lists technologies required to use the extension. */
9438
9472
  requirements?: {
9439
9473
  "3D"?: { features?: string[] | undefined } | undefined;
@@ -9469,8 +9503,8 @@ declare namespace chrome {
9469
9503
  manifest_version: 2;
9470
9504
 
9471
9505
  // Pick one (or none)
9472
- browser_action?: ManifestAction | undefined;
9473
- page_action?: ManifestAction | undefined;
9506
+ browser_action?: Omit<ManifestAction, "default_state"> | undefined;
9507
+ page_action?: Omit<ManifestAction, "default_state"> | undefined;
9474
9508
 
9475
9509
  // Optional
9476
9510
  background?:
@@ -9496,6 +9530,15 @@ declare namespace chrome {
9496
9530
  | undefined;
9497
9531
  /** Defines restrictions on the scripts, styles, and other resources an extension can use. */
9498
9532
  content_security_policy?: string | undefined;
9533
+ /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */
9534
+ options_ui?: {
9535
+ /** Path to the options page, relative to the extension's root. */
9536
+ page: string;
9537
+ /** If `true`, a Chrome user agent stylesheet will be applied to your options page. Defaults to `false`. */
9538
+ chrome_style?: boolean | undefined;
9539
+ /** 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`. */
9540
+ open_in_tab?: boolean | undefined;
9541
+ } | undefined;
9499
9542
  /** Declares optional permissions for your extension. */
9500
9543
  optional_permissions?: (ManifestOptionalPermission | string)[] | undefined;
9501
9544
  /** Enables use of particular extension APIs. */
@@ -9559,6 +9602,13 @@ declare namespace chrome {
9559
9602
  | undefined;
9560
9603
  /** 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. */
9561
9604
  host_permissions?: string[] | undefined;
9605
+ /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */
9606
+ options_ui?: {
9607
+ /** Specifies the path to the options page, relative to the extension's root. */
9608
+ page: string;
9609
+ /** Indicates whether the extension's options page will be opened in a new tab. If set to `false`, the extension's options page is embedded in `chrome://extensions` rather than opened in a new tab. */
9610
+ open_in_tab?: boolean | undefined;
9611
+ } | undefined;
9562
9612
  /** Declares optional permissions for your extension. */
9563
9613
  optional_permissions?: ManifestOptionalPermission[] | undefined;
9564
9614
  /** Declares optional host permissions for your extension. */
@@ -11145,7 +11195,7 @@ declare namespace chrome {
11145
11195
  * The last time the tab became active in its window as the number of milliseconds since epoch.
11146
11196
  * @since Chrome 121
11147
11197
  */
11148
- lastAccessed?: number | undefined;
11198
+ lastAccessed: number;
11149
11199
  }
11150
11200
 
11151
11201
  /** The tab's loading status. */
@@ -11715,8 +11765,11 @@ declare namespace chrome {
11715
11765
  function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
11716
11766
  function insertCSS(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise<void>;
11717
11767
  function insertCSS(details: extensionTypes.InjectDetails, callback: () => void): void;
11718
- function insertCSS(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise<void>;
11719
- function insertCSS(tabId: number, details: extensionTypes.InjectDetails, callback: () => void): void;
11768
+ function insertCSS(
11769
+ tabId: number | undefined,
11770
+ details: extensionTypes.InjectDetails,
11771
+ callback: () => void,
11772
+ ): void;
11720
11773
 
11721
11774
  /**
11722
11775
  * Highlights the given tabs and focuses on the first of group. Will appear to do nothing if the specified tab is currently active.
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
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": "0d223956ef9cea82c44d7fd4098f895ea9af206ae06ba356723fa7280327552c",
97
+ "typesPublisherContentHash": "95d0e80767c8eccf24fb23319a9a50f80476549772d641082f1d22a6a2df3825",
98
98
  "typeScriptVersion": "5.6"
99
99
  }