@types/chrome 0.0.290 → 0.0.291

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 +86 -26
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (http://developer.chrome.com/e
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 06 Jan 2025 08:02:47 GMT
11
+ * Last updated: Wed, 08 Jan 2025 18:02:30 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
@@ -3487,15 +3487,15 @@ declare namespace chrome {
3487
3487
  id: string;
3488
3488
  /**
3489
3489
  * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are hardware-backed.
3490
- * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 and ECDSA with namedCurve P-256 can be generated. Each key can be used for signing data at most once.
3491
- * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface.
3490
+ * Only non-extractable keys can be generated. The supported key types are RSASSA-PKCS1-V1_5 and RSA-OAEP (on Chrome versions 134+) with `modulusLength` up to 2048 and ECDSA with `namedCurve` P-256. Each RSASSA-PKCS1-V1_5 and ECDSA key can be used for signing data at most once, unless the extension is allowlisted through the KeyPermissions policy, in which case the key can be used indefinitely. RSA-OAEP keys are supported since Chrome version 134 and can be used by extensions allowlisted through that same policy to unwrap other keys.
3491
+ * Keys generated on a specific `Token` cannot be used with any other Tokens, nor can they be used with `window.crypto.subtle`. Equally, `Key` objects created with `window.crypto.subtle` cannot be used with this interface.
3492
3492
  */
3493
3493
  subtleCrypto: SubtleCrypto;
3494
3494
  /**
3495
3495
  * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are software-backed.
3496
3496
  * Protection of the keys, and thus implementation of the non-extractable property, is done in software, so the keys are less protected than hardware-backed keys.
3497
- * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 can be generated. Each key can be used for signing data at most once.
3498
- * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface.
3497
+ * Only non-extractable keys can be generated. The supported key types are RSASSA-PKCS1-V1_5 and RSA-OAEP (on Chrome versions 134+) with `modulusLength` up to 2048. Each RSASSA-PKCS1-V1_5 key can be used for signing data at most once, unless the extension is allowlisted through the KeyPermissions policy, in which case the key can be used indefinitely. RSA-OAEP keys are supported since Chrome version 134 and can be used by extensions allowlisted through that same policy to unwrap other keys.
3498
+ * Keys generated on a specific `Token` cannot be used with any other Tokens, nor can they be used with `window.crypto.subtle`. Equally, `Key` objects created with `window.crypto.subtle` cannot be used with this interface.
3499
3499
  * @since Chrome 97
3500
3500
  */
3501
3501
  softwareBackedSubtleCrypto: SubtleCrypto;
@@ -8345,7 +8345,7 @@ declare namespace chrome {
8345
8345
  export function connectNative(application: string): Port;
8346
8346
  /**
8347
8347
  * Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.
8348
- * @since MV3
8348
+ * @deprecated Background pages do not exist in MV3 extensions.
8349
8349
  */
8350
8350
  export function getBackgroundPage(): Promise<Window>;
8351
8351
  /** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */
@@ -12797,37 +12797,74 @@ declare namespace chrome {
12797
12797
 
12798
12798
  export namespace declarativeNetRequest {
12799
12799
  /** Ruleset ID for the dynamic rules added by the extension. */
12800
- export const DYNAMIC_RULESET_ID: string;
12800
+ export const DYNAMIC_RULESET_ID: "_dynamic";
12801
12801
 
12802
- /** Time interval within which MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL getMatchedRules calls can be made, specified in minutes.
12803
- * Additional calls will fail immediately and set runtime.lastError.
12804
- * Note: getMatchedRules calls associated with a user gesture are exempt from the quota.
12802
+ /**
12803
+ * Time interval within which `MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL getMatchedRules` calls can be made, specified in minutes.
12804
+ * Additional calls will fail immediately and set {@link runtime.lastError}.
12805
+ * Note: `getMatchedRules` calls associated with a user gesture are exempt from the quota.
12805
12806
  */
12806
- export const GETMATCHEDRULES_QUOTA_INTERVAL: number;
12807
+ export const GETMATCHEDRULES_QUOTA_INTERVAL: 10;
12807
12808
 
12808
- /** The minimum number of static rules guaranteed to an extension across its enabled static rulesets.
12809
+ /**
12810
+ * The minimum number of static rules guaranteed to an extension across its enabled static rulesets.
12809
12811
  * Any rules above this limit will count towards the global rule limit.
12812
+ * @since Chrome 89
12810
12813
  */
12811
- export const GUARANTEED_MINIMUM_STATIC_RULES: number;
12814
+ export const GUARANTEED_MINIMUM_STATIC_RULES: 30000;
12815
+
12816
+ /** The number of times `getMatchedRules` can be called within a period of `GETMATCHEDRULES_QUOTA_INTERVAL`. */
12817
+ export const MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL: 20;
12812
12818
 
12813
- /** The number of times getMatchedRules can be called within a period of GETMATCHEDRULES_QUOTA_INTERVAL. */
12814
- export const MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL: number;
12819
+ /** The maximum number of dynamic rules that an extension can add. */
12820
+ export const MAX_NUMBER_OF_DYNAMIC_RULES: 30000;
12821
+
12822
+ /**
12823
+ * The maximum number of static `Rulesets` an extension can enable at any one time.
12824
+ * @since Chrome 94
12825
+ */
12826
+ export const MAX_NUMBER_OF_ENABLED_STATIC_RULESETS: 50;
12815
12827
 
12816
12828
  /** The maximum number of combined dynamic and session scoped rules an extension can add. */
12817
- export const MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES: number;
12829
+ export const MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES: 5000;
12818
12830
 
12819
- /** The maximum number of regular expression rules that an extension can add.
12831
+ /**
12832
+ * The maximum number of regular expression rules that an extension can add.
12820
12833
  * This limit is evaluated separately for the set of dynamic rules and those specified in the rule resources file.
12821
12834
  */
12822
- export const MAX_NUMBER_OF_REGEX_RULES: number;
12835
+ export const MAX_NUMBER_OF_REGEX_RULES: 1000;
12823
12836
 
12824
- /** The maximum number of static Rulesets an extension can specify as part of the "rule_resources" manifest key. */
12825
- export const MAX_NUMBER_OF_STATIC_RULESETS: number;
12837
+ /**
12838
+ * The maximum number of session scoped rules that an extension can add.
12839
+ * @since Chrome 120
12840
+ */
12841
+ export const MAX_NUMBER_OF_SESSION_RULES: 5000;
12842
+
12843
+ /** The maximum number of static `Rulesets` an extension can specify as part of the `"rule_resources"` manifest key. */
12844
+ export const MAX_NUMBER_OF_STATIC_RULESETS: 100;
12845
+
12846
+ /**
12847
+ * The maximum number of "unsafe" dynamic rules that an extension can add.
12848
+ * @since Chrome 120
12849
+ */
12850
+ export const MAX_NUMBER_OF_UNSAFE_DYNAMIC_RULES: 5000;
12826
12851
 
12827
- /** Ruleset ID for the session-scoped rules added by the extension. */
12828
- export const SESSION_RULESET_ID: string;
12852
+ /**
12853
+ * The maximum number of "unsafe" session scoped rules that an extension can add.
12854
+ * @since Chrome 120
12855
+ */
12856
+ export const MAX_NUMBER_OF_UNSAFE_SESSION_RULES: 5000;
12829
12857
 
12830
- /** This describes the HTTP request method of a network request. */
12858
+ /**
12859
+ * Ruleset ID for the session-scoped rules added by the extension.
12860
+ * @since Chrome 90
12861
+ */
12862
+ export const SESSION_RULESET_ID: "_session";
12863
+
12864
+ /**
12865
+ * This describes the HTTP request method of a network request.
12866
+ * @since Chrome 91
12867
+ */
12831
12868
  export enum RequestMethod {
12832
12869
  CONNECT = "connect",
12833
12870
  DELETE = "delete",
@@ -12837,6 +12874,7 @@ declare namespace chrome {
12837
12874
  PATCH = "patch",
12838
12875
  POST = "post",
12839
12876
  PUT = "put",
12877
+ OTHER = "other",
12840
12878
  }
12841
12879
 
12842
12880
  /** This describes the resource type of the network request. */
@@ -12853,37 +12891,59 @@ declare namespace chrome {
12853
12891
  CSP_REPORT = "csp_report",
12854
12892
  MEDIA = "media",
12855
12893
  WEBSOCKET = "websocket",
12894
+ WEBTRANSPORT = "webtransport",
12895
+ WEBBUNDLE = "webbundle",
12856
12896
  OTHER = "other",
12857
12897
  }
12858
12898
 
12859
12899
  /** Describes the kind of action to take if a given RuleCondition matches. */
12860
12900
  export enum RuleActionType {
12901
+ /** Block the network request. */
12861
12902
  BLOCK = "block",
12903
+ /** Redirect the network request. */
12862
12904
  REDIRECT = "redirect",
12905
+ /** Allow the network request. The request won't be intercepted if there is an allow rule which matches it. */
12863
12906
  ALLOW = "allow",
12907
+ /** Upgrade the network request url's scheme to https if the request is http or ftp. */
12864
12908
  UPGRADE_SCHEME = "upgradeScheme",
12909
+ /** Modify request/response headers from the network request. */
12865
12910
  MODIFY_HEADERS = "modifyHeaders",
12911
+ /** Allow all requests within a frame hierarchy, including the frame request itself. */
12866
12912
  ALLOW_ALL_REQUESTS = "allowAllRequests",
12867
12913
  }
12868
12914
 
12869
- /** Describes the reason why a given regular expression isn't supported. */
12915
+ /**
12916
+ * Describes the reason why a given regular expression isn't supported.
12917
+ * @since Chrome 87
12918
+ */
12870
12919
  export enum UnsupportedRegexReason {
12920
+ /** The regular expression is syntactically incorrect, or uses features not available in the RE2 syntax. */
12871
12921
  SYNTAX_ERROR = "syntaxError",
12922
+ /** The regular expression exceeds the memory limit. */
12872
12923
  MEMORY_LIMIT_EXCEEDED = "memoryLimitExceeded",
12873
12924
  }
12874
12925
 
12875
- /** TThis describes whether the request is first or third party to the frame in which it originated.
12926
+ /**
12927
+ * This describes whether the request is first or third party to the frame in which it originated.
12876
12928
  * A request is said to be first party if it has the same domain (eTLD+1) as the frame in which the request originated.
12877
12929
  */
12878
12930
  export enum DomainType {
12931
+ /** The network request is first party to the frame in which it originated. */
12879
12932
  FIRST_PARTY = "firstParty",
12933
+ /* The network request is third party to the frame in which it originated. */
12880
12934
  THIRD_PARTY = "thirdParty",
12881
12935
  }
12882
12936
 
12883
- /** This describes the possible operations for a "modifyHeaders" rule. */
12937
+ /**
12938
+ * This describes the possible operations for a "modifyHeaders" rule.
12939
+ * @since Chrome 86
12940
+ */
12884
12941
  export enum HeaderOperation {
12942
+ /** Adds a new entry for the specified header. This operation is not supported for request headers. */
12885
12943
  APPEND = "append",
12944
+ /** Sets a new value for the specified header, removing any existing headers with the same name. */
12886
12945
  SET = "set",
12946
+ /** Removes all entries for the specified header. */
12887
12947
  REMOVE = "remove",
12888
12948
  }
12889
12949
 
@@ -13752,7 +13812,7 @@ declare namespace chrome {
13752
13812
  id: string;
13753
13813
  /** Specifies wildcard patterns for pages this user script will be injected into. */
13754
13814
  includeGlobs?: string[];
13755
- /** The list of ScriptSource objects defining sources of scripts to be injected into matching pages. */
13815
+ /** The list of ScriptSource objects defining sources of scripts to be injected into matching pages. This property must be specified for {@link register}, and when specified it must be a non-empty array.*/
13756
13816
  js: ScriptSource[];
13757
13817
  /** Specifies which pages this user script will be injected into. See Match Patterns for more details on the syntax of these strings. This property must be specified for ${ref:register}. */
13758
13818
  matches?: string[];
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.290",
3
+ "version": "0.0.291",
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": "57db3a57f8b9ab022dab39d5b98c70ae66ae04896cff31262c908ab55f02df12",
97
+ "typesPublisherContentHash": "dbf0463e5c551f12fa07437137f3aaf7830c2e455201602adbe89debf1dcf956",
98
98
  "typeScriptVersion": "5.0"
99
99
  }