@types/chrome 0.1.12 → 0.1.13

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 +367 -423
  3. chrome/package.json +2 -2
chrome/index.d.ts CHANGED
@@ -153,7 +153,7 @@ declare namespace chrome {
153
153
  export namespace action {
154
154
  export interface BadgeColorDetails {
155
155
  /** 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`. */
156
- color: string | ColorArray;
156
+ color: string | extensionTypes.ColorArray;
157
157
  /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
158
158
  tabId?: number | undefined;
159
159
  }
@@ -165,8 +165,6 @@ declare namespace chrome {
165
165
  tabId?: number | undefined;
166
166
  }
167
167
 
168
- export type ColorArray = [number, number, number, number];
169
-
170
168
  export interface TitleDetails {
171
169
  /** The string the action should display when moused over. */
172
170
  title: string;
@@ -241,8 +239,11 @@ declare namespace chrome {
241
239
  *
242
240
  * Can return its result via Promise.
243
241
  */
244
- export function getBadgeBackgroundColor(details: TabDetails): Promise<ColorArray>;
245
- export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
242
+ export function getBadgeBackgroundColor(details: TabDetails): Promise<extensionTypes.ColorArray>;
243
+ export function getBadgeBackgroundColor(
244
+ details: TabDetails,
245
+ callback: (result: extensionTypes.ColorArray) => void,
246
+ ): void;
246
247
 
247
248
  /**
248
249
  * Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned. If {@link declarativeNetRequest.ExtensionActionOptions.displayActionCountAsBadgeText displayActionCountAsBadgeText} is enabled, a placeholder text will be returned unless the {@link runtime.ManifestPermissions declarativeNetRequestFeedback} permission is present or tab-specific badge text was provided.
@@ -258,8 +259,11 @@ declare namespace chrome {
258
259
  * Can return its result via Promise.
259
260
  * @since Chrome 110
260
261
  */
261
- export function getBadgeTextColor(details: TabDetails): Promise<ColorArray>;
262
- export function getBadgeTextColor(details: TabDetails, callback: (result: ColorArray) => void): void;
262
+ export function getBadgeTextColor(details: TabDetails): Promise<extensionTypes.ColorArray>;
263
+ export function getBadgeTextColor(
264
+ details: TabDetails,
265
+ callback: (result: extensionTypes.ColorArray) => void,
266
+ ): void;
263
267
 
264
268
  /**
265
269
  * Gets the html document set as the popup for this action.
@@ -864,7 +868,7 @@ declare namespace chrome {
864
868
  export namespace browserAction {
865
869
  export interface BadgeBackgroundColorDetails {
866
870
  /** 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. */
867
- color: string | ColorArray;
871
+ color: string | extensionTypes.ColorArray;
868
872
  /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
869
873
  tabId?: number | undefined;
870
874
  }
@@ -876,8 +880,6 @@ declare namespace chrome {
876
880
  tabId?: number | undefined;
877
881
  }
878
882
 
879
- export type ColorArray = [number, number, number, number];
880
-
881
883
  export interface TitleDetails {
882
884
  /** The string the browser action should display when moused over. */
883
885
  title: string;
@@ -1005,13 +1007,16 @@ declare namespace chrome {
1005
1007
  * @since Chrome 19
1006
1008
  * Gets the background color of the browser action.
1007
1009
  */
1008
- export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
1010
+ export function getBadgeBackgroundColor(
1011
+ details: TabDetails,
1012
+ callback: (result: extensionTypes.ColorArray) => void,
1013
+ ): void;
1009
1014
  /**
1010
1015
  * @since Chrome 19
1011
1016
  * Gets the background color of the browser action.
1012
1017
  * @return The `getBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only).
1013
1018
  */
1014
- export function getBadgeBackgroundColor(details: TabDetails): Promise<ColorArray>;
1019
+ export function getBadgeBackgroundColor(details: TabDetails): Promise<extensionTypes.ColorArray>;
1015
1020
  /**
1016
1021
  * @since Chrome 19
1017
1022
  * Gets the html document set as the popup for this browser action.
@@ -2819,6 +2824,11 @@ declare namespace chrome {
2819
2824
  onHidden: events.Event<() => void>;
2820
2825
  /** Fired upon a search action (start of a new search, search result navigation, or search being canceled). */
2821
2826
  onSearch: events.Event<(action: string, queryString?: string) => void>;
2827
+ /**
2828
+ * Shows the panel by activating the corresponding tab.
2829
+ * @since Chrome 140
2830
+ */
2831
+ show(): void;
2822
2832
  }
2823
2833
 
2824
2834
  /** A button created by the extension. */
@@ -4473,6 +4483,9 @@ declare namespace chrome {
4473
4483
  ////////////////////
4474
4484
  /** The `chrome.extensionTypes` API contains type declarations for Chrome extensions. */
4475
4485
  export namespace extensionTypes {
4486
+ /** @since Chrome 139 */
4487
+ export type ColorArray = [number, number, number, number];
4488
+
4476
4489
  /**
4477
4490
  * The origin of injected CSS.
4478
4491
  * @since Chrome 66
@@ -6748,35 +6761,32 @@ declare namespace chrome {
6748
6761
  * @since Chrome 44
6749
6762
  */
6750
6763
  export namespace instanceID {
6751
- export interface TokenRefreshEvent extends chrome.events.Event<() => void> {}
6752
-
6753
6764
  /**
6754
6765
  * Resets the app instance identifier and revokes all tokens associated with it.
6755
6766
  *
6756
- * The `deleteID()` method doesn't return any value, but can be used with a callback or asynchronously,
6757
- * with a Promise (MV3 only).
6767
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6758
6768
  */
6759
6769
  export function deleteID(): Promise<void>;
6760
6770
  export function deleteID(callback: () => void): void;
6761
6771
 
6772
+ /** Parameters for {@link deleteToken}. */
6762
6773
  interface DeleteTokenParams {
6763
6774
  /**
6764
- * Identifies the entity that is authorized to access resources associated with this Instance ID.
6765
- * It can be a project ID from Google developer console.
6775
+ * The authorized entity that is used to obtain the token.
6776
+ * @since Chrome 46
6766
6777
  */
6767
6778
  authorizedEntity: string;
6768
6779
  /**
6769
- * Identifies authorized actions that the authorized entity can take.
6770
- * In other words, the scope that is used to obtain the token.
6771
- * E.g. for sending GCM messages, `GCM` scope should be used.
6780
+ * The scope that is used to obtain the token.
6781
+ * @since Chrome 46
6772
6782
  */
6773
6783
  scope: string;
6774
6784
  }
6785
+
6775
6786
  /**
6776
- * Revoked a granted token.
6787
+ * Revokes a granted token.
6777
6788
  *
6778
- * The `deleteToken()` method doesn't return any value, but can be used with a callback or
6779
- * asynchronously, with a Promise (MV3 only).
6789
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6780
6790
  */
6781
6791
  export function deleteToken(deleteTokenParams: DeleteTokenParams): Promise<void>;
6782
6792
  export function deleteToken(
@@ -6787,8 +6797,8 @@ declare namespace chrome {
6787
6797
  /**
6788
6798
  * Retrieves the time when the InstanceID has been generated.
6789
6799
  *
6800
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6790
6801
  * @return The time when the Instance ID has been generated, represented in milliseconds since the epoch.
6791
- * It can return via a callback or asynchronously, with a Promise (MV3 only).
6792
6802
  */
6793
6803
  export function getCreationTime(): Promise<number>;
6794
6804
  export function getCreationTime(callback: (creationTime: number) => void): void;
@@ -6797,29 +6807,40 @@ declare namespace chrome {
6797
6807
  * Retrieves an identifier for the app instance.
6798
6808
  * The same ID will be returned as long as the application identity has not been revoked or expired.
6799
6809
  *
6800
- * @return An Instance ID assigned to the app instance. Can be returned by a callback or a Promise (MV3 only).
6810
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6811
+ * @return An Instance ID assigned to the app instance.
6801
6812
  */
6802
6813
  export function getID(): Promise<string>;
6803
6814
  export function getID(callback: (instanceID: string) => void): void;
6804
6815
 
6805
- interface GetTokenParams extends DeleteTokenParams {
6816
+ /** Parameters for {@link getToken}. */
6817
+ interface GetTokenParams {
6806
6818
  /**
6807
- * Allows including a small number of string key/value pairs that will be associated with the token
6808
- * and may be used in processing the request.
6809
- *
6810
- * @deprecated Since Chrome 89. `options` are deprecated and will be ignored.
6819
+ * Identifies the entity that is authorized to access resources associated with this Instance ID. It can be a project ID from Google developer console.
6820
+ * @since Chrome 46
6821
+ */
6822
+ authorizedEntity: string;
6823
+ /**
6824
+ * Allows including a small number of string key/value pairs that will be associated with the token and may be used in processing the request.
6825
+ * @deprecated since Chrome 89. `options` are deprecated and will be ignored.
6811
6826
  */
6812
6827
  options?: { [key: string]: string };
6828
+ /**
6829
+ * Identifies authorized actions that the authorized entity can take. E.g. for sending GCM messages, `GCM` scope should be used.
6830
+ * @since Chrome 46
6831
+ */
6832
+ scope: string;
6813
6833
  }
6814
6834
  /**
6815
6835
  * Return a token that allows the authorized entity to access the service defined by scope.
6816
6836
  *
6817
- * @return A token assigned by the requested service. Can be returned by a callback or a Promise (MV3 only).
6837
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6838
+ * @return A token assigned by the requested service.
6818
6839
  */
6819
6840
  export function getToken(getTokenParams: GetTokenParams): Promise<string>;
6820
6841
  export function getToken(getTokenParams: GetTokenParams, callback: (token: string) => void): void;
6821
6842
 
6822
- export var onTokenRefresh: TokenRefreshEvent;
6843
+ export const onTokenRefresh: events.Event<() => void>;
6823
6844
  }
6824
6845
 
6825
6846
  ////////////////////
@@ -7375,23 +7396,23 @@ declare namespace chrome {
7375
7396
  export enum Reason {
7376
7397
  /** A reason used for testing purposes only. */
7377
7398
  TESTING = "TESTING",
7378
- /** The offscreen document is responsible for playing audio. */
7399
+ /** Specifies that the offscreen document is responsible for playing audio. */
7379
7400
  AUDIO_PLAYBACK = "AUDIO_PLAYBACK",
7380
- /** The offscreen document needs to embed and script an iframe in order to modify the iframe's content. */
7401
+ /** Specifies that the offscreen document needs to embed and script an iframe in order to modify the iframe's content. */
7381
7402
  IFRAME_SCRIPTING = "IFRAME_SCRIPTING",
7382
- /** The offscreen document needs to embed an iframe and scrape its DOM to extract information. */
7403
+ /** Specifies that the offscreen document needs to embed an iframe and scrape its DOM to extract information. */
7383
7404
  DOM_SCRAPING = "DOM_SCRAPING",
7384
- /** The offscreen document needs to interact with Blob objects (including URL.createObjectURL()). */
7405
+ /** Specifies that the offscreen document needs to interact with Blob objects (including `URL.createObjectURL()`). */
7385
7406
  BLOBS = "BLOBS",
7386
- /** The offscreen document needs to use the DOMParser API. */
7407
+ /** Specifies that the offscreen document needs to use the DOMParser API. */
7387
7408
  DOM_PARSER = "DOM_PARSER",
7388
- /** The offscreen document needs to interact with media streams from user media (e.g. getUserMedia()). */
7409
+ /** Specifies that the offscreen document needs to interact with media streams from user media (e.g. `getUserMedia()`). */
7389
7410
  USER_MEDIA = "USER_MEDIA",
7390
- /** The offscreen document needs to interact with media streams from display media (e.g. getDisplayMedia()). */
7411
+ /** Specifies that the offscreen document needs to interact with media streams from display media (e.g. `getDisplayMedia()`). */
7391
7412
  DISPLAY_MEDIA = "DISPLAY_MEDIA",
7392
- /** The offscreen document needs to use WebRTC APIs. */
7413
+ /** Specifies that the offscreen document needs to use WebRTC APIs. */
7393
7414
  WEB_RTC = "WEB_RTC",
7394
- /** The offscreen document needs to interact with the clipboard APIs(e.g. Navigator.clipboard). */
7415
+ /** Specifies that the offscreen document needs to interact with the Clipboard API. */
7395
7416
  CLIPBOARD = "CLIPBOARD",
7396
7417
  /** Specifies that the offscreen document needs access to localStorage. */
7397
7418
  LOCAL_STORAGE = "LOCAL_STORAGE",
@@ -7405,7 +7426,6 @@ declare namespace chrome {
7405
7426
  GEOLOCATION = "GEOLOCATION",
7406
7427
  }
7407
7428
 
7408
- /** The parameters describing the offscreen document to create. */
7409
7429
  export interface CreateParameters {
7410
7430
  /** The reason(s) the extension is creating the offscreen document. */
7411
7431
  reasons: `${Reason}`[];
@@ -7418,36 +7438,26 @@ declare namespace chrome {
7418
7438
  /**
7419
7439
  * Creates a new offscreen document for the extension.
7420
7440
  * @param parameters The parameters describing the offscreen document to create.
7421
- * @return The `createDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
7441
+ *
7442
+ * Can return its result via Promise in Manifest V3.
7422
7443
  */
7423
7444
  export function createDocument(parameters: CreateParameters): Promise<void>;
7424
- /**
7425
- * Creates a new offscreen document for the extension.
7426
- * @param parameters The parameters describing the offscreen document to create.
7427
- * @param callback Invoked when the offscreen document is created and has completed its initial page load.
7428
- */
7429
7445
  export function createDocument(parameters: CreateParameters, callback: () => void): void;
7430
7446
 
7431
7447
  /**
7432
7448
  * Closes the currently-open offscreen document for the extension.
7433
- * @return The `closeDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
7449
+ *
7450
+ * Can return its result via Promise in Manifest V3.
7434
7451
  */
7435
7452
  export function closeDocument(): Promise<void>;
7436
- /**
7437
- * Closes the currently-open offscreen document for the extension.
7438
- * @param callback Invoked when the offscreen document has been closed.
7439
- */
7440
7453
  export function closeDocument(callback: () => void): void;
7441
7454
 
7442
7455
  /**
7443
7456
  * Determines whether the extension has an active document.
7444
- * @return The `hasDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
7457
+ *
7458
+ * Can return its result via Promise in Manifest V3.
7445
7459
  */
7446
7460
  export function hasDocument(): Promise<boolean>;
7447
- /**
7448
- * Determines whether the extension has an active document.
7449
- * @param callback Invoked with the result of whether the extension has an active offscreen document.
7450
- */
7451
7461
  export function hasDocument(callback: (result: boolean) => void): void;
7452
7462
  }
7453
7463
 
@@ -7473,47 +7483,60 @@ declare namespace chrome {
7473
7483
  deletable?: boolean | undefined;
7474
7484
  }
7475
7485
 
7476
- export interface Suggestion {
7486
+ /** A suggest result. */
7487
+ export interface DefaultSuggestResult {
7477
7488
  /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. */
7478
7489
  description: string;
7479
7490
  }
7480
7491
 
7481
- /** The window disposition for the omnibox query. This is the recommended context to display results. */
7482
- export type OnInputEnteredDisposition = "currentTab" | "newForegroundTab" | "newBackgroundTab";
7483
-
7484
- export interface OmniboxInputEnteredEvent
7485
- extends chrome.events.Event<(text: string, disposition: OnInputEnteredDisposition) => void>
7486
- {}
7487
-
7488
- export interface OmniboxInputChangedEvent
7489
- extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void>
7490
- {}
7491
-
7492
- export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {}
7493
-
7494
- export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {}
7492
+ /**
7493
+ * The style type.
7494
+ * @since Chrome 44
7495
+ */
7496
+ export enum DescriptionStyleType {
7497
+ URL = "url",
7498
+ MATCH = "match",
7499
+ DIM = "dim",
7500
+ }
7495
7501
 
7496
- export interface OmniboxSuggestionDeletedEvent extends chrome.events.Event<(text: string) => void> {}
7502
+ /**
7503
+ * The window disposition for the omnibox query. This is the recommended context to display results. For example, if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should take place in a new selected tab.
7504
+ * @since Chrome 44
7505
+ */
7506
+ export enum OnInputEnteredDisposition {
7507
+ CURRENT_TAB = "currentTab",
7508
+ NEW_FOREGROUND_TAB = "newForegroundTab",
7509
+ NEW_BACKGROUND_TAB = "newBackgroundTab",
7510
+ }
7497
7511
 
7498
7512
  /**
7499
7513
  * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.
7514
+ *
7515
+ * Can return its result via Promise in Manifest V3 or later since Chrome 100
7500
7516
  * @param suggestion A partial SuggestResult object, without the 'content' parameter.
7501
7517
  */
7502
- export function setDefaultSuggestion(suggestion: Suggestion): void;
7518
+ export function setDefaultSuggestion(suggestion: DefaultSuggestResult): Promise<void>;
7519
+ export function setDefaultSuggestion(suggestion: DefaultSuggestResult, callback: () => void): void;
7503
7520
 
7504
7521
  /** User has accepted what is typed into the omnibox. */
7505
- export var onInputEntered: OmniboxInputEnteredEvent;
7522
+ export const onInputEntered: events.Event<(text: string, disposition: `${OnInputEnteredDisposition}`) => void>;
7523
+
7506
7524
  /** User has changed what is typed into the omnibox. */
7507
- export var onInputChanged: OmniboxInputChangedEvent;
7525
+ export const onInputChanged: events.Event<
7526
+ (text: string, suggest: (suggestResults: SuggestResult[]) => void) => void
7527
+ >;
7528
+
7508
7529
  /** User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events. */
7509
- export var onInputStarted: OmniboxInputStartedEvent;
7530
+ export const onInputStarted: events.Event<() => void>;
7531
+
7510
7532
  /** User has ended the keyword input session without accepting the input. */
7511
- export var onInputCancelled: OmniboxInputCancelledEvent;
7533
+ export const onInputCancelled: events.Event<() => void>;
7534
+
7512
7535
  /**
7513
7536
  * User has deleted a suggested result
7514
7537
  * @since Chrome 63
7515
7538
  */
7516
- export var onDeleteSuggestion: OmniboxSuggestionDeletedEvent;
7539
+ export const onDeleteSuggestion: events.Event<(text: string) => void>;
7517
7540
  }
7518
7541
 
7519
7542
  ////////////////////
@@ -8400,58 +8423,74 @@ declare namespace chrome {
8400
8423
  * Permissions: "proxy"
8401
8424
  */
8402
8425
  export namespace proxy {
8426
+ /** @since Chrome 54 */
8427
+ export enum Mode {
8428
+ /** Never use a proxy */
8429
+ DIRECT = "direct",
8430
+ /** Auto detect proxy settings */
8431
+ AUTO_DETECT = "auto_detect",
8432
+ /** Use specified PAC script */
8433
+ PAC_SCRIPT = "pac_script",
8434
+ /** Manually specify proxy servers */
8435
+ FIXED_SERVERS = "fixed_servers",
8436
+ /** Use system proxy settings */
8437
+ SYSTEM = "system",
8438
+ }
8439
+
8403
8440
  /** An object holding proxy auto-config information. Exactly one of the fields should be non-empty. */
8404
8441
  export interface PacScript {
8405
- /** Optional. URL of the PAC file to be used. */
8442
+ /** URL of the PAC file to be used. */
8406
8443
  url?: string | undefined;
8407
- /** Optional. If true, an invalid PAC script will prevent the network stack from falling back to direct connections. Defaults to false. */
8444
+ /** If true, an invalid PAC script will prevent the network stack from falling back to direct connections. Defaults to false. */
8408
8445
  mandatory?: boolean | undefined;
8409
- /** Optional. A PAC script. */
8446
+ /** A PAC script. */
8410
8447
  data?: string | undefined;
8411
8448
  }
8412
8449
 
8413
8450
  /** An object encapsulating a complete proxy configuration. */
8414
8451
  export interface ProxyConfig {
8415
- /** Optional. The proxy rules describing this configuration. Use this for 'fixed_servers' mode. */
8452
+ /** The proxy rules describing this configuration. Use this for 'fixed_servers' mode. */
8416
8453
  rules?: ProxyRules | undefined;
8417
- /** Optional. The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */
8454
+ /** The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */
8418
8455
  pacScript?: PacScript | undefined;
8419
- /**
8420
- * 'direct' = Never use a proxy
8421
- * 'auto_detect' = Auto detect proxy settings
8422
- * 'pac_script' = Use specified PAC script
8423
- * 'fixed_servers' = Manually specify proxy servers
8424
- * 'system' = Use system proxy settings
8425
- */
8426
- mode: string;
8456
+ mode: `${Mode}`;
8427
8457
  }
8428
8458
 
8429
8459
  /** An object encapsulating a single proxy server's specification. */
8430
8460
  export interface ProxyServer {
8431
- /** The URI of the proxy server. This must be an ASCII hostname (in Punycode format). IDNA is not supported, yet. */
8461
+ /** The hostname or IP address of the proxy server. Hostnames must be in ASCII (in Punycode format). IDNA is not supported, yet. */
8432
8462
  host: string;
8433
- /** Optional. The scheme (protocol) of the proxy server itself. Defaults to 'http'. */
8434
- scheme?: string | undefined;
8435
- /** Optional. The port of the proxy server. Defaults to a port that depends on the scheme. */
8463
+ /** The scheme (protocol) of the proxy server itself. Defaults to 'http'. */
8464
+ scheme?: `${Scheme}` | undefined;
8465
+ /** The port of the proxy server. Defaults to a port that depends on the scheme. */
8436
8466
  port?: number | undefined;
8437
8467
  }
8438
8468
 
8439
8469
  /** An object encapsulating the set of proxy rules for all protocols. Use either 'singleProxy' or (a subset of) 'proxyForHttp', 'proxyForHttps', 'proxyForFtp' and 'fallbackProxy'. */
8440
8470
  export interface ProxyRules {
8441
- /** Optional. The proxy server to be used for FTP requests. */
8471
+ /** The proxy server to be used for FTP requests. */
8442
8472
  proxyForFtp?: ProxyServer | undefined;
8443
- /** Optional. The proxy server to be used for HTTP requests. */
8473
+ /** The proxy server to be used for HTTP requests. */
8444
8474
  proxyForHttp?: ProxyServer | undefined;
8445
- /** Optional. The proxy server to be used for everything else or if any of the specific proxyFor... is not specified. */
8475
+ /** The proxy server to be used for everything else or if any of the specific proxyFor... is not specified. */
8446
8476
  fallbackProxy?: ProxyServer | undefined;
8447
- /** Optional. The proxy server to be used for all per-URL requests (that is http, https, and ftp). */
8477
+ /** The proxy server to be used for all per-URL requests (that is http, https, and ftp). */
8448
8478
  singleProxy?: ProxyServer | undefined;
8449
- /** Optional. The proxy server to be used for HTTPS requests. */
8479
+ /** The proxy server to be used for HTTPS requests. */
8450
8480
  proxyForHttps?: ProxyServer | undefined;
8451
- /** Optional. List of servers to connect to without a proxy server. */
8481
+ /** List of servers to connect to without a proxy server. */
8452
8482
  bypassList?: string[] | undefined;
8453
8483
  }
8454
8484
 
8485
+ /** @since Chrome 54 */
8486
+ export enum Scheme {
8487
+ HTTP = "http",
8488
+ HTTPS = "https",
8489
+ QUIC = "quic",
8490
+ SOCKS4 = "socks4",
8491
+ SOCKS5 = "socks5",
8492
+ }
8493
+
8455
8494
  export interface ErrorDetails {
8456
8495
  /** Additional details about the error such as a JavaScript runtime error. */
8457
8496
  details: string;
@@ -8461,11 +8500,11 @@ declare namespace chrome {
8461
8500
  fatal: boolean;
8462
8501
  }
8463
8502
 
8464
- export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {}
8503
+ /** Proxy settings to be used. The value of this setting is a ProxyConfig object. */
8504
+ export const settings: types.ChromeSetting<ProxyConfig>;
8465
8505
 
8466
- export var settings: chrome.types.ChromeSetting<ProxyConfig>;
8467
8506
  /** Notifies about proxy errors. */
8468
- export var onProxyError: ProxyErrorEvent;
8507
+ export const onProxyError: events.Event<(details: ErrorDetails) => void>;
8469
8508
  }
8470
8509
 
8471
8510
  ////////////////////
@@ -11109,6 +11148,11 @@ declare namespace chrome {
11109
11148
  autoDiscardable?: boolean | undefined;
11110
11149
  /** Whether the tabs are pinned. */
11111
11150
  pinned?: boolean | undefined;
11151
+ /**
11152
+ * The ID of the Split View that the tabs are in, or `tabs.SPLIT_VIEW_ID_NONE` for tabs that aren't in a Split View.
11153
+ * @since Chrome 140
11154
+ */
11155
+ splitViewId?: number | undefined;
11112
11156
  /**
11113
11157
  * Whether the tabs are audible.
11114
11158
  * @since Chrome 45
@@ -11172,6 +11216,11 @@ declare namespace chrome {
11172
11216
  mutedInfo?: MutedInfo;
11173
11217
  /** The tab's new pinned state. */
11174
11218
  pinned?: boolean;
11219
+ /**
11220
+ * The tab's new Split View.
11221
+ * @since Chrome 140
11222
+ */
11223
+ splitViewId?: number;
11175
11224
  /** The tab's loading status. */
11176
11225
  status?: `${TabStatus}`;
11177
11226
  /**
@@ -13528,39 +13577,40 @@ declare namespace chrome {
13528
13577
  }
13529
13578
 
13530
13579
  export interface RequestDetails {
13531
- /** The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens.
13532
- * If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame.
13533
- * Frame IDs are unique within a tab.
13580
+ /**
13581
+ * The unique identifier for the frame's document, if this request is for a frame.
13582
+ * @since Chrome 106
13583
+ */
13584
+ documentId?: string | undefined;
13585
+ /**
13586
+ * The lifecycle of the frame's document, if this request is for a frame.
13587
+ * @since Chrome 106
13534
13588
  */
13589
+ documentLifecycle?: extensionTypes.DocumentLifecycle | undefined;
13590
+ /** The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. */
13535
13591
  frameId: number;
13536
-
13537
- /** The origin where the request was initiated.
13538
- * This does not change through redirects.
13539
- * If this is an opaque origin, the string 'null' will be used.
13592
+ /**
13593
+ * The type of the frame, if this request is for a frame.
13594
+ * @since Chrome 106
13540
13595
  */
13596
+ frameType?: extensionTypes.FrameType | undefined;
13597
+ /** The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used. */
13541
13598
  initiator?: string | undefined;
13542
-
13543
13599
  /** Standard HTTP method. */
13544
13600
  method: string;
13545
-
13546
- /** ID of frame that wraps the frame which sent the request.
13547
- * Set to -1 if no parent frame exists.
13548
- */
13549
- partentFrameId: number;
13550
-
13551
- /** The ID of the request.
13552
- * Request IDs are unique within a browser session.
13601
+ /**
13602
+ * The unique identifier for the frame's parent document, if this request is for a frame and has a parent.
13603
+ * @since Chrome 106
13553
13604
  */
13605
+ parentDocumentId?: string | undefined;
13606
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
13607
+ parentFrameId: number;
13608
+ /** The ID of the request. Request IDs are unique within a browser session. */
13554
13609
  requestId: string;
13555
-
13556
- /** The ID of the tab in which the request takes place.
13557
- * Set to -1 if the request isn't related to a tab.
13558
- */
13610
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
13559
13611
  tabId: number;
13560
-
13561
13612
  /** The resource type of the request. */
13562
13613
  type: `${ResourceType}`;
13563
-
13564
13614
  /** The URL of the request. */
13565
13615
  url: string;
13566
13616
  }
@@ -13568,38 +13618,27 @@ declare namespace chrome {
13568
13618
  export interface Rule {
13569
13619
  /** The action to take if this rule is matched. */
13570
13620
  action: RuleAction;
13571
-
13572
13621
  /** The condition under which this rule is triggered. */
13573
13622
  condition: RuleCondition;
13574
-
13575
- /** An id which uniquely identifies a rule.
13576
- * Mandatory and should be >= 1.
13577
- */
13623
+ /** An id which uniquely identifies a rule. Mandatory and should be >= 1. */
13578
13624
  id: number;
13579
-
13580
- /** Rule priority.
13581
- * Defaults to 1.
13582
- * When specified, should be >= 1.
13583
- */
13625
+ /** Rule priority. Defaults to 1. When specified, should be >= 1. */
13584
13626
  priority?: number | undefined;
13585
13627
  }
13586
13628
 
13587
13629
  export interface RuleAction {
13588
- /** Describes how the redirect should be performed.
13589
- * Only valid for redirect rules.
13590
- */
13630
+ /** Describes how the redirect should be performed. Only valid for redirect rules. */
13591
13631
  redirect?: Redirect | undefined;
13592
-
13593
- /** The request headers to modify for the request.
13594
- * Only valid if RuleActionType is "modifyHeaders".
13632
+ /**
13633
+ * The request headers to modify for the request. Only valid if RuleActionType is "modifyHeaders".
13634
+ * @since Chrome 86
13595
13635
  */
13596
13636
  requestHeaders?: ModifyHeaderInfo[] | undefined;
13597
-
13598
- /** The response headers to modify for the request.
13599
- * Only valid if RuleActionType is "modifyHeaders".
13637
+ /**
13638
+ * The response headers to modify for the request. Only valid if RuleActionType is "modifyHeaders".
13639
+ * @since Chrome 86
13600
13640
  */
13601
13641
  responseHeaders?: ModifyHeaderInfo[] | undefined;
13602
-
13603
13642
  /** The type of action to perform. */
13604
13643
  type: `${RuleActionType}`;
13605
13644
  }
@@ -13612,37 +13651,19 @@ declare namespace chrome {
13612
13651
  domainType?: `${DomainType}` | undefined;
13613
13652
 
13614
13653
  /**
13615
- * @deprecated since Chrome 101. Use initiatorDomains instead.
13616
-
13617
- * The rule will only match network requests originating from the list of domains.
13618
- * If the list is omitted, the rule is applied to requests from all domains.
13619
- * An empty list is not allowed.
13620
- *
13621
- * Notes:
13622
- * Sub-domains like "a.example.com" are also allowed.
13623
- * The entries must consist of only ascii characters.
13624
- * Use punycode encoding for internationalized domains.
13625
- * This matches against the request initiator and not the request url.
13626
- */
13654
+ * The rule will only match network requests originating from the list of `domains`.
13655
+ * @deprecated since Chrome 101. Use {@link initiatorDomains} instead
13656
+ */
13627
13657
  domains?: string[] | undefined;
13628
13658
 
13629
13659
  /**
13630
- * @deprecated since Chrome 101. Use excludedInitiatorDomains instead
13631
- *
13632
- * The rule will not match network requests originating from the list of excludedDomains.
13633
- * If the list is empty or omitted, no domains are excluded.
13634
- * This takes precedence over domains.
13635
- *
13636
- * Notes:
13637
- * Sub-domains like "a.example.com" are also allowed.
13638
- * The entries must consist of only ascii characters.
13639
- * Use punycode encoding for internationalized domains.
13640
- * This matches against the request initiator and not the request url.
13660
+ * The rule will not match network requests originating from the list of `excludedDomains`.
13661
+ * @deprecated since Chrome 101. Use {@link excludedInitiatorDomains} instead
13641
13662
  */
13642
13663
  excludedDomains?: string[] | undefined;
13643
13664
 
13644
13665
  /**
13645
- * The rule will only match network requests originating from the list of initiatorDomains.
13666
+ * The rule will only match network requests originating from the list of `initiatorDomains`.
13646
13667
  * If the list is omitted, the rule is applied to requests from all domains.
13647
13668
  * An empty list is not allowed.
13648
13669
  *
@@ -13651,24 +13672,26 @@ declare namespace chrome {
13651
13672
  * The entries must consist of only ascii characters.
13652
13673
  * Use punycode encoding for internationalized domains.
13653
13674
  * This matches against the request initiator and not the request url.
13675
+ * @since Chrome 101
13654
13676
  */
13655
13677
  initiatorDomains?: string[] | undefined;
13656
13678
 
13657
13679
  /**
13658
- * The rule will not match network requests originating from the list of excludedInitiatorDomains.
13680
+ * The rule will not match network requests originating from the list of `excludedInitiatorDomains`.
13659
13681
  * If the list is empty or omitted, no domains are excluded.
13660
- * This takes precedence over initiatorDomains.
13682
+ * This takes precedence over `initiatorDomains`.
13661
13683
  *
13662
13684
  * Notes:
13663
13685
  * Sub-domains like "a.example.com" are also allowed.
13664
13686
  * The entries must consist of only ascii characters.
13665
13687
  * Use punycode encoding for internationalized domains.
13666
13688
  * This matches against the request initiator and not the request url.
13689
+ * @since Chrome 101
13667
13690
  */
13668
13691
  excludedInitiatorDomains?: string[] | undefined;
13669
13692
 
13670
13693
  /**
13671
- * The rule will only match network requests when the domain matches one from the list of requestDomains.
13694
+ * The rule will only match network requests when the domain matches one from the list of `requestDomains`.
13672
13695
  * If the list is omitted, the rule is applied to requests from all domains.
13673
13696
  * An empty list is not allowed.
13674
13697
  *
@@ -13676,71 +13699,72 @@ declare namespace chrome {
13676
13699
  * Sub-domains like "a.example.com" are also allowed.
13677
13700
  * The entries must consist of only ascii characters.
13678
13701
  * Use punycode encoding for internationalized domains.
13702
+ * @since Chrome 101
13679
13703
  */
13680
13704
  requestDomains?: string[] | undefined;
13681
13705
 
13682
13706
  /**
13683
- * The rule will not match network requests when the domains matches one from the list of excludedRequestDomains.
13707
+ * The rule will not match network requests when the domains matches one from the list of `excludedRequestDomains`.
13684
13708
  * If the list is empty or omitted, no domains are excluded.
13685
- * This takes precedence over requestDomains.
13709
+ * This takes precedence over `requestDomains`.
13686
13710
  *
13687
13711
  * Notes:
13688
13712
  * Sub-domains like "a.example.com" are also allowed.
13689
13713
  * The entries must consist of only ascii characters.
13690
13714
  * Use punycode encoding for internationalized domains.
13715
+ * @since Chrome 101
13691
13716
  */
13692
13717
  excludedRequestDomains?: string[] | undefined;
13693
13718
 
13694
13719
  /**
13695
13720
  * List of request methods which the rule won't match.
13696
- * Only one of requestMethods and excludedRequestMethods should be specified.
13721
+ * Only one of `requestMethods` and `excludedRequestMethods` should be specified.
13697
13722
  * If neither of them is specified, all request methods are matched.
13723
+ * @since Chrome 91
13698
13724
  */
13699
13725
  excludedRequestMethods?: `${RequestMethod}`[] | undefined;
13700
13726
 
13701
13727
  /**
13702
13728
  * List of resource types which the rule won't match.
13703
- * Only one of {@link chrome.declarativeNetRequest.RuleCondition.resourceTypes}
13704
- * and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
13729
+ * Only one of `resourceTypes` and `excludedResourceTypes` should be specified.
13705
13730
  * If neither of them is specified, all resource types except "main_frame" are blocked.
13706
13731
  */
13707
13732
  excludedResourceTypes?: `${ResourceType}`[] | undefined;
13708
13733
 
13709
13734
  /**
13710
- * List of {@link chrome.tabs.Tab.id} which the rule should not match.
13711
- * An ID of {@link chrome.tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
13735
+ * List of {@link tabs.Tab.id} which the rule should not match.
13736
+ * An ID of {@link tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
13712
13737
  * Only supported for session-scoped rules.
13738
+ * @since Chrome 92
13713
13739
  */
13714
13740
  excludedTabIds?: number[] | undefined;
13715
13741
 
13716
- /**
13717
- * Whether the urlFilter or regexFilter (whichever is specified) is case sensitive.
13718
- * @default false Before Chrome 118 the default was true.
13719
- */
13742
+ /** Whether the `urlFilter` or `regexFilter` (whichever is specified) is case sensitive. Default is false. */
13720
13743
  isUrlFilterCaseSensitive?: boolean | undefined;
13721
13744
 
13722
13745
  /**
13723
13746
  * Regular expression to match against the network request url.
13724
13747
  * This follows the RE2 syntax.
13725
13748
  *
13726
- * Note: Only one of urlFilter or regexFilter can be specified.
13749
+ * Note: Only one of `urlFilter` or `regexFilter` can be specified.
13727
13750
  *
13728
- * Note: The regexFilter must be composed of only ASCII characters.
13751
+ * Note: The `regexFilter` must be composed of only ASCII characters.
13729
13752
  * This is matched against a url where the host is encoded in the punycode format (in case of internationalized domains) and any other non-ascii characters are url encoded in utf-8.
13730
13753
  */
13731
13754
  regexFilter?: string | undefined;
13732
13755
 
13733
13756
  /**
13734
13757
  * List of HTTP request methods which the rule can match. An empty list is not allowed.
13735
- * Note: Specifying a {@link chrome.declarativeNetRequest.RuleCondition.requestMethods} rule condition will also exclude non-HTTP(s) requests,
13736
- * whereas specifying {@link chrome.declarativeNetRequest.RuleCondition.excludedRequestMethods} will not.
13758
+ *
13759
+ * Note: Specifying a `requestMethods` rule condition will also exclude non-HTTP(s) requests, whereas specifying `excludedRequestMethods` will not.
13737
13760
  */
13738
13761
  requestMethods?: `${RequestMethod}`[] | undefined;
13739
13762
 
13740
13763
  /**
13741
- * List of {@link chrome.tabs.Tab.id} which the rule should not match.
13742
- * An ID of {@link chrome.tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
13764
+ * List of {@link tabs.Tab.id} which the rule should not match.
13765
+ * An ID of {@link tabs.TAB_ID_NONE} matches requests which don't originate from a tab.
13743
13766
  * An empty list is not allowed. Only supported for session-scoped rules.
13767
+ * @since Chrome 92
13744
13768
  */
13745
13769
  tabIds?: number[] | undefined;
13746
13770
 
@@ -13757,17 +13781,17 @@ declare namespace chrome {
13757
13781
  * '^' : Separator character: This matches anything except a letter, a digit or one of the following: _ - . %.
13758
13782
  * This can also match the end of the URL.
13759
13783
  *
13760
- * Therefore urlFilter is composed of the following parts: (optional Left/Domain name anchor) + pattern + (optional Right anchor).
13784
+ * Therefore `urlFilter` is composed of the following parts: (optional Left/Domain name anchor) + pattern + (optional Right anchor).
13761
13785
  *
13762
13786
  * If omitted, all urls are matched. An empty string is not allowed.
13763
13787
  *
13764
13788
  * A pattern beginning with || is not allowed. Use instead.
13765
13789
  *
13766
- * Note: Only one of urlFilter or regexFilter can be specified.
13790
+ * Note: Only one of `urlFilter` or `regexFilter` can be specified.
13767
13791
  *
13768
- * Note: The urlFilter must be composed of only ASCII characters.
13792
+ * Note: The `urlFilter` must be composed of only ASCII characters.
13769
13793
  * This is matched against a url where the host is encoded in the punycode format (in case of internationalized domains) and any other non-ascii characters are url encoded in utf-8.
13770
- * For example, when the request url is http://abc.рф?q=ф, the urlFilter will be matched against the url http://abc.xn--p1ai/?q=%D1%84.
13794
+ * For example, when the request url is http://abc.рф?q=ф, the `urlFilter` will be matched against the url http://abc.xn--p1ai/?q=%D1%84.
13771
13795
  */
13772
13796
  urlFilter?: string | undefined;
13773
13797
 
@@ -13775,7 +13799,7 @@ declare namespace chrome {
13775
13799
  * List of resource types which the rule can match.
13776
13800
  * An empty list is not allowed.
13777
13801
  *
13778
- * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
13802
+ * Note: this must be specified for `allowAllRequests` rules and may only include the `sub_frame` and `main_frame` resource types.
13779
13803
  */
13780
13804
  resourceTypes?: `${ResourceType}`[] | undefined;
13781
13805
 
@@ -13795,32 +13819,22 @@ declare namespace chrome {
13795
13819
  export interface MatchedRule {
13796
13820
  /** A matching rule's ID. */
13797
13821
  ruleId: number;
13798
-
13799
- /** ID of the Ruleset this rule belongs to.
13800
- * For a rule originating from the set of dynamic rules, this will be equal to DYNAMIC_RULESET_ID.
13801
- */
13822
+ /** ID of the {@link Ruleset} this rule belongs to. For a rule originating from the set of dynamic rules, this will be equal to {@link DYNAMIC_RULESET_ID}. */
13802
13823
  rulesetId: string;
13803
13824
  }
13804
13825
 
13805
13826
  export interface MatchedRuleInfo {
13806
13827
  rule: MatchedRule;
13807
-
13808
13828
  /** The tabId of the tab from which the request originated if the tab is still active. Else -1. */
13809
13829
  tabId: number;
13810
-
13811
- /** The time the rule was matched.
13812
- * Timestamps will correspond to the Javascript convention for times, i.e. number of milliseconds since the epoch.
13813
- */
13830
+ /** The time the rule was matched. Timestamps will correspond to the Javascript convention for times, i.e. number of milliseconds since the epoch. */
13814
13831
  timeStamp: number;
13815
13832
  }
13816
13833
 
13817
13834
  export interface MatchedRulesFilter {
13818
13835
  /** If specified, only matches rules after the given timestamp. */
13819
13836
  minTimeStamp?: number | undefined;
13820
-
13821
- /** If specified, only matches rules for the given tab.
13822
- * Matches rules not associated with any active tab if set to -1.
13823
- */
13837
+ /** If specified, only matches rules for the given tab. Matches rules not associated with any active tab if set to -1. */
13824
13838
  tabId?: number | undefined;
13825
13839
  }
13826
13840
 
@@ -13842,142 +13856,122 @@ declare namespace chrome {
13842
13856
  values?: string[];
13843
13857
  }
13844
13858
 
13859
+ /** @since Chrome 86 */
13845
13860
  export interface ModifyHeaderInfo {
13846
13861
  /** The name of the header to be modified. */
13847
13862
  header: string;
13848
-
13849
13863
  /** The operation to be performed on a header. */
13850
13864
  operation: `${HeaderOperation}`;
13851
-
13852
- /** The new value for the header.
13853
- * Must be specified for append and set operations.
13854
- */
13865
+ /** The new value for the header. Must be specified for `append` and `set` operations. */
13855
13866
  value?: string | undefined;
13856
13867
  }
13857
13868
 
13858
13869
  export interface QueryKeyValue {
13859
13870
  key: string;
13871
+ /**
13872
+ * If true, the query key is replaced only if it's already present. Otherwise, the key is also added if it's missing. Defaults to false.
13873
+ * @since Chrome 94
13874
+ */
13875
+ replaceOnly?: boolean | undefined;
13860
13876
  value: string;
13861
13877
  }
13862
13878
 
13863
13879
  export interface QueryTransform {
13864
13880
  /** The list of query key-value pairs to be added or replaced. */
13865
13881
  addOrReplaceParams?: QueryKeyValue[] | undefined;
13866
-
13867
13882
  /** The list of query keys to be removed. */
13868
13883
  removeParams?: string[] | undefined;
13869
13884
  }
13870
13885
 
13871
13886
  export interface URLTransform {
13872
- /** The new fragment for the request.
13873
- * Should be either empty, in which case the existing fragment is cleared; or should begin with '#'.
13874
- */
13887
+ /** The new fragment for the request. Should be either empty, in which case the existing fragment is cleared; or should begin with '#'. */
13875
13888
  fragment?: string | undefined;
13876
-
13877
13889
  /** The new host for the request. */
13878
13890
  host?: string | undefined;
13879
-
13880
13891
  /** The new password for the request. */
13881
13892
  password?: string | undefined;
13882
-
13883
- /** The new path for the request.
13884
- * If empty, the existing path is cleared.
13885
- */
13893
+ /** The new path for the request. If empty, the existing path is cleared. */
13886
13894
  path?: string | undefined;
13887
-
13888
- /** The new port for the request.
13889
- * If empty, the existing port is cleared.
13890
- */
13895
+ /** The new port for the request. If empty, the existing port is cleared. */
13891
13896
  port?: string | undefined;
13892
-
13893
- /** The new query for the request.
13894
- * Should be either empty, in which case the existing query is cleared; or should begin with '?'.
13895
- */
13897
+ /** The new query for the request. Should be either empty, in which case the existing query is cleared; or should begin with '?'. */
13896
13898
  query?: string | undefined;
13897
-
13898
13899
  /** Add, remove or replace query key-value pairs. */
13899
13900
  queryTransform?: QueryTransform | undefined;
13900
-
13901
- /** The new scheme for the request.
13902
- * Allowed values are "http", "https", "ftp" and "chrome-extension".
13903
- */
13901
+ /** The new scheme for the request. Allowed values are "http", "https", "ftp" and "chrome-extension". */
13904
13902
  scheme?: string | undefined;
13905
-
13906
13903
  /** The new username for the request. */
13907
13904
  username?: string | undefined;
13908
13905
  }
13909
13906
 
13907
+ /** @since Chrome 87 */
13910
13908
  export interface RegexOptions {
13911
- /** Whether the regex specified is case sensitive.
13912
- * Default is true.
13913
- */
13909
+ /** Whether the `regex` specified is case sensitive. Default is true. */
13914
13910
  isCaseSensitive?: boolean | undefined;
13915
-
13916
13911
  /** The regular expression to check. */
13917
13912
  regex: string;
13918
-
13919
- /** Whether the regex specified requires capturing.
13920
- * Capturing is only required for redirect rules which specify a regexSubstitution action.
13921
- * The default is false.
13922
- */
13913
+ /** Whether the `regex` specified requires capturing. Capturing is only required for redirect rules which specify a `regexSubstitution` action. The default is false. */
13923
13914
  requireCapturing?: boolean | undefined;
13924
13915
  }
13925
13916
 
13917
+ /** @since Chrome 87 */
13926
13918
  export interface IsRegexSupportedResult {
13927
13919
  isSupported: boolean;
13928
-
13929
- /** Specifies the reason why the regular expression is not supported.
13930
- * Only provided if isSupported is false.
13931
- */
13932
- reason?: `${UnsupportedRegexReason}` | undefined;
13920
+ /** Specifies the reason why the regular expression is not supported. Only provided if `isSupported` is false. */
13921
+ reason?: `${UnsupportedRegexReason}`;
13933
13922
  }
13934
13923
 
13924
+ /** @since Chrome 89 */
13935
13925
  export interface TabActionCountUpdate {
13936
- /** The amount to increment the tab's action count by.
13937
- * Negative values will decrement the count
13938
- */
13926
+ /** The amount to increment the tab's action count by. Negative values will decrement the count. */
13939
13927
  increment: number;
13940
-
13941
13928
  /** The tab for which to update the action count. */
13942
13929
  tabId: number;
13943
13930
  }
13944
13931
 
13932
+ /** @since Chrome 88 */
13945
13933
  export interface ExtensionActionOptions {
13946
- /** Whether to automatically display the action count for a page as the extension's badge text.
13934
+ /**
13935
+ * Whether to automatically display the action count for a page as the extension's badge text.
13947
13936
  * This preference is persisted across sessions.
13948
13937
  */
13949
13938
  displayActionCountAsBadgeText?: boolean | undefined;
13950
-
13951
13939
  /** Details of how the tab's action count should be adjusted. */
13952
13940
  tabUpdate?: TabActionCountUpdate | undefined;
13953
13941
  }
13954
13942
 
13943
+ /** @since Chrome 111 */
13944
+ export interface GetDisabledRuleIdsOptions {
13945
+ /** The id corresponding to a static {@link Ruleset}. */
13946
+ rulesetId: string;
13947
+ }
13948
+
13949
+ /** @since Chrome 111 */
13950
+ export interface GetRulesFilter {
13951
+ /** If specified, only rules with matching IDs are included. */
13952
+ ruleIds?: number[] | undefined;
13953
+ }
13954
+
13955
13955
  export interface Redirect {
13956
- /** Path relative to the extension directory.
13957
- * Should start with '/'.
13958
- */
13956
+ /** Path relative to the extension directory. Should start with '/'. */
13959
13957
  extensionPath?: string | undefined;
13960
-
13961
- /** Substitution pattern for rules which specify a regexFilter.
13962
- * The first match of regexFilter within the url will be replaced with this pattern.
13963
- * Within regexSubstitution, backslash-escaped digits (\1 to \9) can be used to insert the corresponding capture groups.
13958
+ /**
13959
+ * Substitution pattern for rules which specify a `regexFilter`.
13960
+ * The first match of `regexFilter` within the url will be replaced with this pattern.
13961
+ * Within `regexSubstitution`, backslash-escaped digits (\1 to \9) can be used to insert the corresponding capture groups.
13964
13962
  * \0 refers to the entire matching text.
13965
13963
  */
13966
13964
  regexSubstitution?: string | undefined;
13967
-
13968
13965
  /** Url transformations to perform. */
13969
13966
  transform?: URLTransform | undefined;
13970
-
13971
- /** The redirect url.
13972
- * Redirects to JavaScript urls are not allowed.
13973
- */
13967
+ /** The redirect url. Redirects to JavaScript urls are not allowed. */
13974
13968
  url?: string | undefined;
13975
13969
  }
13976
13970
 
13971
+ /** @since Chrome 87 */
13977
13972
  export interface UpdateRuleOptions {
13978
13973
  /** Rules to add. */
13979
13974
  addRules?: Rule[] | undefined;
13980
-
13981
13975
  /**
13982
13976
  * IDs of the rules to remove.
13983
13977
  * Any invalid IDs will be ignored.
@@ -13985,41 +13979,35 @@ declare namespace chrome {
13985
13979
  removeRuleIds?: number[] | undefined;
13986
13980
  }
13987
13981
 
13982
+ /** @since Chrome 111 */
13988
13983
  export interface UpdateStaticRulesOptions {
13989
- /** Set of ids corresponding to rules in the Ruleset to disable. */
13984
+ /** Set of ids corresponding to rules in the {@link Ruleset} to disable. */
13990
13985
  disableRuleIds?: number[];
13991
-
13992
- /** Set of ids corresponding to rules in the Ruleset to enable. */
13986
+ /** Set of ids corresponding to rules in the {@link Ruleset} to enable. */
13993
13987
  enableRuleIds?: number[];
13994
-
13995
- /** The id corresponding to a static Ruleset. */
13988
+ /** The id corresponding to a static {@link Ruleset}. */
13996
13989
  rulesetId: string;
13997
13990
  }
13998
13991
 
13992
+ /** @since Chrome 87 */
13999
13993
  export interface UpdateRulesetOptions {
14000
- /** The set of ids corresponding to a static Ruleset that should be disabled. */
13994
+ /** The set of ids corresponding to a static {@link Ruleset} that should be disabled. */
14001
13995
  disableRulesetIds?: string[] | undefined;
14002
-
14003
- /** The set of ids corresponding to a static Ruleset that should be enabled. */
13996
+ /** The set of ids corresponding to a static {@link Ruleset} that should be enabled. */
14004
13997
  enableRulesetIds?: string[] | undefined;
14005
13998
  }
14006
13999
 
14007
14000
  export interface MatchedRuleInfoDebug {
14008
14001
  /** Details about the request for which the rule was matched. */
14009
14002
  request: RequestDetails;
14010
-
14011
14003
  rule: MatchedRule;
14012
14004
  }
14013
14005
 
14014
14006
  export interface Ruleset {
14015
14007
  /** Whether the ruleset is enabled by default. */
14016
14008
  enabled: boolean;
14017
-
14018
- /** A non-empty string uniquely identifying the ruleset.
14019
- * IDs beginning with '_' are reserved for internal use.
14020
- */
14009
+ /** A non-empty string uniquely identifying the ruleset. IDs beginning with '_' are reserved for internal use. */
14021
14010
  id: string;
14022
-
14023
14011
  /** The path of the JSON ruleset relative to the extension directory. */
14024
14012
  path: string;
14025
14013
  }
@@ -14054,112 +14042,96 @@ declare namespace chrome {
14054
14042
  url: string;
14055
14043
  }
14056
14044
 
14057
- /** Returns the number of static rules an extension can enable before the global static rule limit is reached. */
14058
- export function getAvailableStaticRuleCount(callback: (count: number) => void): void;
14059
-
14060
14045
  /**
14061
14046
  * Returns the number of static rules an extension can enable before the global static rule limit is reached.
14062
- * @return The `getAvailableStaticRuleCount` method provides its result via callback or returned as a `Promise` (MV3 only).
14047
+ *
14048
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14049
+ * @since Chrome 89
14063
14050
  */
14064
14051
  export function getAvailableStaticRuleCount(): Promise<number>;
14052
+ export function getAvailableStaticRuleCount(callback: (count: number) => void): void;
14065
14053
 
14066
- /** Returns the current set of dynamic rules for the extension.
14054
+ /**
14055
+ * Returns the list of static rules in the given {@link Ruleset} that are currently disabled.
14067
14056
  *
14068
- * @param callback Called with the set of dynamic rules.
14069
- * An error might be raised in case of transient internal errors.
14057
+ * Can return its result via Promise in Manifest V3.
14058
+ * @param options Specifies the ruleset to query.
14059
+ * @since Chrome 111
14070
14060
  */
14071
- export function getDynamicRules(callback: (rules: Rule[]) => void): void;
14061
+ export function getDisabledRuleIds(options: GetDisabledRuleIdsOptions): Promise<number[]>;
14062
+ export function getDisabledRuleIds(
14063
+ options: GetDisabledRuleIdsOptions,
14064
+ callback: (disabledRuleIds: number[]) => void,
14065
+ ): void;
14072
14066
 
14073
14067
  /**
14074
- * Returns the current set of dynamic rules for the extension.
14075
- * @return The `getDynamicRules` method provides its result via callback or returned as a `Promise` (MV3 only).
14076
- */
14077
- export function getDynamicRules(): Promise<Rule[]>;
14078
-
14079
- /** Returns the ids for the current set of enabled static rulesets.
14068
+ * Returns the current set of dynamic rules for the extension. Callers can optionally filter the list of fetched rules by specifying a `filter`.
14080
14069
  *
14081
- * @param callback Called with a list of ids, where each id corresponds to an enabled static Ruleset. */
14082
- export function getEnabledRulesets(callback: (rulesetIds: string[]) => void): void;
14070
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14071
+ * @param filter An object to filter the list of fetched rules.
14072
+ */
14073
+ export function getDynamicRules(filter?: GetRulesFilter): Promise<Rule[]>;
14074
+ export function getDynamicRules(callback: (rules: Rule[]) => void): void;
14075
+ export function getDynamicRules(filter: GetRulesFilter | undefined, callback: (rules: Rule[]) => void): void;
14083
14076
 
14084
14077
  /**
14085
14078
  * Returns the ids for the current set of enabled static rulesets.
14086
- * @return The `getEnabledRulesets` method provides its result via callback or returned as a `Promise` (MV3 only).
14079
+ *
14080
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14087
14081
  */
14088
14082
  export function getEnabledRulesets(): Promise<string[]>;
14083
+ export function getEnabledRulesets(callback: (rulesetIds: string[]) => void): void;
14089
14084
 
14090
- /** Returns all rules matched for the extension.
14091
- * Callers can optionally filter the list of matched rules by specifying a filter.
14092
- * This method is only available to extensions with the declarativeNetRequestFeedback permission or having the activeTab permission granted for the tabId specified in filter.
14093
- * Note: Rules not associated with an active document that were matched more than five minutes ago will not be returned.
14085
+ /**
14086
+ * Returns all rules matched for the extension. Callers can optionally filter the list of matched rules by specifying a `filter`. This method is only available to extensions with the `"declarativeNetRequestFeedback"` permission or having the `"activeTab"` permission granted for the `tabId` specified in `filter`. Note: Rules not associated with an active document that were matched more than five minutes ago will not be returned.
14094
14087
  *
14088
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14095
14089
  * @param filter An object to filter the list of matched rules.
14096
- * @param callback Called once the list of matched rules has been fetched.
14097
- * In case of an error, runtime.lastError will be set and no rules will be returned.
14098
- * This can happen for multiple reasons, such as insufficient permissions, or exceeding the quota.
14099
14090
  */
14091
+ export function getMatchedRules(filter?: MatchedRulesFilter): Promise<RulesMatchedDetails>;
14092
+ export function getMatchedRules(callback: (details: RulesMatchedDetails) => void): void;
14100
14093
  export function getMatchedRules(
14101
14094
  filter: MatchedRulesFilter | undefined,
14102
14095
  callback: (details: RulesMatchedDetails) => void,
14103
14096
  ): void;
14104
14097
 
14105
14098
  /**
14106
- * Returns all rules matched for the extension.
14107
- * Callers can optionally filter the list of matched rules by specifying a filter.
14108
- * This method is only available to extensions with the declarativeNetRequestFeedback permission or having the activeTab permission granted for the tabId specified in filter.
14109
- * Note: Rules not associated with an active document that were matched more than five minutes ago will not be returned.
14110
- *
14111
- * @param filter An object to filter the list of matched rules.
14112
- * @return The `getMatchedRules` method provides its result via callback or returned as a `Promise` (MV3 only).
14113
- */
14114
- export function getMatchedRules(filter: MatchedRulesFilter | undefined): Promise<RulesMatchedDetails>;
14115
-
14116
- export function getMatchedRules(callback: (details: RulesMatchedDetails) => void): void;
14117
-
14118
- export function getMatchedRules(): Promise<RulesMatchedDetails>;
14119
-
14120
- /** Returns the current set of session scoped rules for the extension.
14099
+ * Returns the current set of session scoped rules for the extension. Callers can optionally filter the list of fetched rules by specifying a `filter`.
14121
14100
  *
14122
- * @param callback Called with the set of session scoped rules.
14101
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14102
+ * @param filter An object to filter the list of fetched rules.
14103
+ * @since Chrome 90
14123
14104
  */
14105
+ export function getSessionRules(filter?: GetRulesFilter): Promise<Rule[]>;
14124
14106
  export function getSessionRules(callback: (rules: Rule[]) => void): void;
14107
+ export function getSessionRules(filter: GetRulesFilter | undefined, callback: (rules: Rule[]) => void): void;
14125
14108
 
14126
14109
  /**
14127
- * Returns the current set of session scoped rules for the extension.
14128
- *
14129
- * @return The `getSessionRules` method provides its result via callback or returned as a `Promise` (MV3 only).
14130
- */
14131
- export function getSessionRules(): Promise<Rule[]>;
14132
-
14133
- /** Checks if the given regular expression will be supported as a regexFilter rule condition.
14110
+ * Checks if the given regular expression will be supported as a `regexFilter` rule condition.
14134
14111
  *
14112
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14135
14113
  * @param regexOptions The regular expression to check.
14136
- * @param callback Called with details consisting of whether the regular expression is supported and the
14137
- * reason if not.
14114
+ * @since Chrome 87
14138
14115
  */
14116
+ export function isRegexSupported(regexOptions: RegexOptions): Promise<IsRegexSupportedResult>;
14139
14117
  export function isRegexSupported(
14140
14118
  regexOptions: RegexOptions,
14141
14119
  callback: (result: IsRegexSupportedResult) => void,
14142
14120
  ): void;
14143
14121
 
14144
- /** Checks if the given regular expression will be supported as a regexFilter rule condition.
14145
- *
14146
- * @param regexOptions The regular expression to check.
14147
- * @return The `isRegexSupported` method provides its result via callback or returned as a `Promise` (MV3 only).
14148
- */
14149
- export function isRegexSupported(regexOptions: RegexOptions): Promise<IsRegexSupportedResult>;
14150
-
14151
- /** Configures if the action count for tabs should be displayed as the extension action's badge text and provides a way for that action count to be incremented. */
14152
- export function setExtensionActionOptions(options: ExtensionActionOptions, callback: () => void): void;
14153
-
14154
14122
  /**
14155
14123
  * Configures if the action count for tabs should be displayed as the extension action's badge text and provides a way for that action count to be incremented.
14156
- * @return The `setExtensionActionOptions` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
14124
+ *
14125
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14126
+ * @since Chrome 88
14157
14127
  */
14158
14128
  export function setExtensionActionOptions(options: ExtensionActionOptions): Promise<void>;
14129
+ export function setExtensionActionOptions(options: ExtensionActionOptions, callback: () => void): void;
14159
14130
 
14160
14131
  /**
14161
14132
  * Checks if any of the extension's declarativeNetRequest rules would match a hypothetical request. Note: Only available for unpacked extensions as this is only intended to be used during extension development.
14162
- * @param request
14133
+ *
14134
+ * Can return its result via Promise in Manifest V3.
14163
14135
  * @since Chrome 103
14164
14136
  */
14165
14137
  export function testMatchOutcome(request: TestMatchRequestDetails): Promise<TestMatchOutcomeResult>;
@@ -14168,101 +14140,52 @@ declare namespace chrome {
14168
14140
  callback: (result: TestMatchOutcomeResult) => void,
14169
14141
  ): void;
14170
14142
 
14171
- /** Modifies the current set of dynamic rules for the extension.
14172
- * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
14173
- *
14174
- * Notes:
14175
- * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
14176
- * These rules are persisted across browser sessions and across extension updates.
14177
- * Static rules specified as part of the extension package can not be removed using this function.
14178
- * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
14179
- *
14180
- * @param callback Called once the update is complete or has failed.
14181
- * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
14182
- * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, internal errors, and others.
14183
- */
14184
- export function updateDynamicRules(options: UpdateRuleOptions, callback: () => void): void;
14185
-
14186
- /** Modifies the current set of dynamic rules for the extension.
14187
- * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
14143
+ /**
14144
+ * Modifies the current set of dynamic rules for the extension. The rules with IDs listed in `options.removeRuleIds` are first removed, and then the rules given in `options.addRules` are added. Notes:
14188
14145
  *
14189
- * Notes:
14190
- * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
14191
- * These rules are persisted across browser sessions and across extension updates.
14192
- * Static rules specified as part of the extension package can not be removed using this function.
14193
- * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
14146
+ * * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
14147
+ * * These rules are persisted across browser sessions and across extension updates.
14148
+ * * Static rules specified as part of the extension package can not be removed using this function.
14149
+ * * {@link MAX_NUMBER_OF_DYNAMIC_RULES} is the maximum number of dynamic rules an extension can add. The number of [unsafe rules](https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#safe_rules) must not exceed {@link MAX_NUMBER_OF_UNSAFE_DYNAMIC_RULES}.
14194
14150
  *
14195
- * @return The `updateDynamicRules` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
14196
- * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
14197
- * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, internal errors, and others.
14151
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14198
14152
  */
14199
14153
  export function updateDynamicRules(options: UpdateRuleOptions): Promise<void>;
14154
+ export function updateDynamicRules(options: UpdateRuleOptions, callback: () => void): void;
14200
14155
 
14201
- /** Updates the set of enabled static rulesets for the extension.
14202
- * The rulesets with IDs listed in options.disableRulesetIds are first removed, and then the rulesets listed in options.enableRulesetIds are added.
14203
- *
14204
- * Note that the set of enabled static rulesets is persisted across sessions but not across extension updates, i.e. the rule_resources manifest key will determine the set of enabled static rulesets on each extension update.
14205
- *
14206
- * @param callback Called once the update is complete.
14207
- * In case of an error, runtime.lastError will be set and no change will be made to set of enabled rulesets.
14208
- * This can happen for multiple reasons, such as invalid ruleset IDs, rule count limit exceeded, or internal errors.
14209
- */
14210
- export function updateEnabledRulesets(options: UpdateRulesetOptions, callback: () => void): void;
14211
-
14212
- /** Updates the set of enabled static rulesets for the extension.
14213
- * The rulesets with IDs listed in options.disableRulesetIds are first removed, and then the rulesets listed in options.enableRulesetIds are added.
14214
- *
14215
- * Note that the set of enabled static rulesets is persisted across sessions but not across extension updates, i.e. the rule_resources manifest key will determine the set of enabled static rulesets on each extension update.
14156
+ /**
14157
+ * Updates the set of enabled static rulesets for the extension. The rulesets with IDs listed in `options.disableRulesetIds` are first removed, and then the rulesets listed in `options.enableRulesetIds` are added.
14158
+ * Note that the set of enabled static rulesets is persisted across sessions but not across extension updates, i.e. the `rule_resources` manifest key will determine the set of enabled static rulesets on each extension update.
14216
14159
  *
14217
- * @return The `updateEnabledRulesets` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
14218
- * In case of an error, runtime.lastError will be set and no change will be made to set of enabled rulesets.
14219
- * This can happen for multiple reasons, such as invalid ruleset IDs, rule count limit exceeded, or internal errors.
14160
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14220
14161
  */
14221
14162
  export function updateEnabledRulesets(options: UpdateRulesetOptions): Promise<void>;
14163
+ export function updateEnabledRulesets(options: UpdateRulesetOptions, callback: () => void): void;
14222
14164
 
14223
- /** Modifies the current set of session scoped rules for the extension.
14224
- * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
14225
- *
14226
- * Notes:
14227
- * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
14228
- * These rules are not persisted across sessions and are backed in memory.
14229
- * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
14230
- *
14231
- * @param callback Called once the update is complete or has failed.
14232
- * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
14233
- * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, and others.
14234
- */
14235
- export function updateSessionRules(options: UpdateRuleOptions, callback: () => void): void;
14236
-
14237
- /** Modifies the current set of session scoped rules for the extension.
14238
- * The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added.
14165
+ /**
14166
+ * Modifies the current set of session scoped rules for the extension. The rules with IDs listed in `options.removeRuleIds` are first removed, and then the rules given in `options.addRules` are added. Notes:
14239
14167
  *
14240
- * Notes:
14241
- * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
14242
- * These rules are not persisted across sessions and are backed in memory.
14243
- * MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES is the maximum number of combined dynamic and session rules an extension can add.
14168
+ * * This update happens as a single atomic operation: either all specified rules are added and removed, or an error is returned.
14169
+ * * These rules are not persisted across sessions and are backed in memory.
14170
+ * * {@link MAX_NUMBER_OF_SESSION_RULES} is the maximum number of session rules an extension can add.
14244
14171
  *
14245
- * @return The `updateSessionRules` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
14246
- * In case of an error, runtime.lastError will be set and no change will be made to the rule set.
14247
- * This can happen for multiple reasons, such as invalid rule format, duplicate rule ID, rule count limit exceeded, and others.
14172
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
14173
+ * @since Chrome 90
14248
14174
  */
14249
14175
  export function updateSessionRules(options: UpdateRuleOptions): Promise<void>;
14176
+ export function updateSessionRules(options: UpdateRuleOptions, callback: () => void): void;
14250
14177
 
14251
- /** Disables and enables individual static rules in a Ruleset.
14252
- * Changes to rules belonging to a disabled Ruleset will take effect the next time that it becomes enabled.
14178
+ /**
14179
+ * Disables and enables individual static rules in a {@link Ruleset}. Changes to rules belonging to a disabled {@link Ruleset} will take effect the next time that it becomes enabled.
14253
14180
  *
14254
- * @return The `updateStaticRules` method either calls a provided callback if its finished or returns as a `Promise` (MV3 only).
14181
+ * Can return its result via Promise in Manifest V3.
14255
14182
  * @since Chrome 111
14256
14183
  */
14257
14184
  export function updateStaticRules(options: UpdateStaticRulesOptions): Promise<void>;
14258
14185
  export function updateStaticRules(options: UpdateStaticRulesOptions, callback?: () => void): void;
14259
14186
 
14260
- /** The rule that has been matched along with information about the associated request. */
14261
- export interface RuleMatchedDebugEvent extends chrome.events.Event<(info: MatchedRuleInfoDebug) => void> {}
14262
-
14263
- /** Fired when a rule is matched with a request.
14264
- * Only available for unpacked extensions with the declarativeNetRequestFeedback permission as this is intended to be used for debugging purposes only. */
14265
- export var onRuleMatchedDebug: RuleMatchedDebugEvent;
14187
+ /** Fired when a rule is matched with a request. Only available for unpacked extensions with the `declarativeNetRequestFeedback` permission as this is intended to be used for debugging purposes only. */
14188
+ export const onRuleMatchedDebug: events.Event<(info: MatchedRuleInfoDebug) => void>;
14266
14189
  }
14267
14190
 
14268
14191
  ////////////////////
@@ -14313,6 +14236,11 @@ declare namespace chrome {
14313
14236
  openPanelOnActionClick?: boolean;
14314
14237
  }
14315
14238
 
14239
+ /** @since Chrome 140 */
14240
+ export interface PanelLayout {
14241
+ side: `${Side}`;
14242
+ }
14243
+
14316
14244
  export interface PanelOptions {
14317
14245
  /** Whether the side panel should be enabled. This is optional. The default value is true. */
14318
14246
  enabled?: boolean;
@@ -14326,11 +14254,27 @@ declare namespace chrome {
14326
14254
  tabId?: number;
14327
14255
  }
14328
14256
 
14257
+ /**
14258
+ * Defines the possible alignment for the side panel in the browser UI.
14259
+ * @since Chrome 140
14260
+ */
14261
+ export enum Side {
14262
+ LEFT = "left",
14263
+ RIGHT = "right",
14264
+ }
14265
+
14329
14266
  export interface SidePanel {
14330
14267
  /** Developer specified path for side panel display. */
14331
14268
  default_path: string;
14332
14269
  }
14333
14270
 
14271
+ /**
14272
+ * Returns the side panel's current layout.
14273
+ * @since Chrome 140
14274
+ */
14275
+ export function getLayout(): Promise<PanelLayout>;
14276
+ export function getLayout(callback: (layout: PanelLayout) => void): void;
14277
+
14334
14278
  /**
14335
14279
  * Returns the active panel configuration.
14336
14280
  * Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility.