Skip to content

Commit 7ecae94

Browse files
authored
🤖 Merge PR DefinitelyTyped#74432 [chrome] update since Chrome 145 by @erwanjugand
1 parent 27f6141 commit 7ecae94

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

types/chrome/index.d.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,16 @@ declare namespace chrome {
692692

693693
/** @deprecated Bookmark write operations are no longer limited by Chrome. */
694694
export const MAX_WRITE_OPERATIONS_PER_HOUR: 1000000;
695+
695696
/** @deprecated Bookmark write operations are no longer limited by Chrome. */
696697
export const MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: 1000000;
697698

699+
/**
700+
* The `id` associated with the root level node.
701+
* @since Chrome 145
702+
*/
703+
export const ROOT_NODE_ID = "0";
704+
698705
/**
699706
* Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
700707
*
@@ -11047,6 +11054,11 @@ declare namespace chrome {
1104711054
height?: number | undefined;
1104811055
/** The session ID used to uniquely identify a tab obtained from the {@link sessions} API. */
1104911056
sessionId?: string | undefined;
11057+
/**
11058+
* The ID of the Split View that the tab belongs to.
11059+
* @since Chrome 145
11060+
*/
11061+
splitViewId?: number | undefined;
1105011062
/**
1105111063
* The ID of the group that the tab belongs to.
1105211064
* @since Chrome 88
@@ -11118,6 +11130,12 @@ declare namespace chrome {
1111811130
*/
1111911131
export const MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND = 2;
1112011132

11133+
/**
11134+
* An ID that represents the absence of a split tab.
11135+
* @since Chrome 145
11136+
*/
11137+
export const SPLIT_VIEW_ID_NONE: -1;
11138+
1112111139
/**
1112211140
* An ID that represents the absence of a browser tab.
1112311141
* @since Chrome 46
@@ -14083,6 +14101,30 @@ declare namespace chrome {
1408314101
responseHeaders?: HeaderInfo[];
1408414102
}
1408514103

14104+
/** @since Chrome 145 */
14105+
export enum RuleConditionKeys {
14106+
URL_FILTER = "urlFilter",
14107+
REGEX_FILTER = "regexFilter",
14108+
IS_URL_FILTER_CASE_SENSITIVE = "isUrlFilterCaseSensitive",
14109+
INITIATOR_DOMAINS = "initiatorDomains",
14110+
EXCLUDED_INITIATOR_DOMAINS = "excludedInitiatorDomains",
14111+
REQUEST_DOMAINS = "requestDomains",
14112+
EXCLUDED_REQUEST_DOMAINS = "excludedRequestDomains",
14113+
TOP_DOMAINS = "topDomains",
14114+
EXCLUDED_TOP_DOMAINS = "excludedTopDomains",
14115+
DOMAINS = "domains",
14116+
EXCLUDED_DOMAINS = "excludedDomains",
14117+
RESOURCE_TYPES = "resourceTypes",
14118+
EXCLUDED_RESOURCE_TYPES = "excludedResourceTypes",
14119+
REQUEST_METHODS = "requestMethods",
14120+
EXCLUDED_REQUEST_METHODS = "excludedRequestMethods",
14121+
DOMAIN_TYPE = "domainType",
14122+
TAB_IDS = "tabIds",
14123+
EXCLUDED_TAB_IDS = "excludedTabIds",
14124+
RESPONSE_HEADERS = "responseHeaders",
14125+
EXCLUDED_RESPONSE_HEADERS = "excludedResponseHeaders",
14126+
}
14127+
1408614128
export interface MatchedRule {
1408714129
/** A matching rule's ID. */
1408814130
ruleId: number;
@@ -14303,6 +14345,11 @@ declare namespace chrome {
1430314345
responseHeaders?: { [name: string]: unknown };
1430414346
/** The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. Default is -1, meaning that the request isn't related to a tab. */
1430514347
tabId?: number;
14348+
/**
14349+
* The associated top-level frame URL (if any) for the request.
14350+
* @since Chrome 145
14351+
*/
14352+
topUrl?: string;
1430614353
/** The resource type of the hypothetical request. */
1430714354
type: `${ResourceType}`;
1430814355
/** The URL of the hypothetical request. */

types/chrome/test/index.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function testBookmarks() {
2626

2727
chrome.bookmarks.MAX_WRITE_OPERATIONS_PER_HOUR === 1000000;
2828

29+
chrome.bookmarks.ROOT_NODE_ID === "0";
30+
2931
const bookmarkDetails: chrome.bookmarks.CreateDetails = {
3032
index: 0,
3133
parentId: "1",
@@ -3214,6 +3216,8 @@ async function testTabs() {
32143216
chrome.tabs.MutedInfoReason.EXTENSION === "extension";
32153217
chrome.tabs.MutedInfoReason.USER === "user";
32163218

3219+
chrome.tabs.SPLIT_VIEW_ID_NONE === -1;
3220+
32173221
chrome.tabs.TAB_ID_NONE === -1;
32183222

32193223
chrome.tabs.TAB_INDEX_NONE === -1;
@@ -4021,6 +4025,27 @@ async function testDeclarativeNetRequest() {
40214025
chrome.declarativeNetRequest.RuleActionType.REDIRECT === "redirect";
40224026
chrome.declarativeNetRequest.RuleActionType.UPGRADE_SCHEME === "upgradeScheme";
40234027

4028+
chrome.declarativeNetRequest.RuleConditionKeys.DOMAINS === "domains";
4029+
chrome.declarativeNetRequest.RuleConditionKeys.DOMAIN_TYPE === "domainType";
4030+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_DOMAINS === "excludedDomains";
4031+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_INITIATOR_DOMAINS === "excludedInitiatorDomains";
4032+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_REQUEST_DOMAINS === "excludedRequestDomains";
4033+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_REQUEST_METHODS === "excludedRequestMethods";
4034+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_RESOURCE_TYPES === "excludedResourceTypes";
4035+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_RESPONSE_HEADERS === "excludedResponseHeaders";
4036+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_TAB_IDS === "excludedTabIds";
4037+
chrome.declarativeNetRequest.RuleConditionKeys.EXCLUDED_TOP_DOMAINS === "excludedTopDomains";
4038+
chrome.declarativeNetRequest.RuleConditionKeys.INITIATOR_DOMAINS === "initiatorDomains";
4039+
chrome.declarativeNetRequest.RuleConditionKeys.IS_URL_FILTER_CASE_SENSITIVE === "isUrlFilterCaseSensitive";
4040+
chrome.declarativeNetRequest.RuleConditionKeys.REGEX_FILTER === "regexFilter";
4041+
chrome.declarativeNetRequest.RuleConditionKeys.REQUEST_DOMAINS === "requestDomains";
4042+
chrome.declarativeNetRequest.RuleConditionKeys.REQUEST_METHODS === "requestMethods";
4043+
chrome.declarativeNetRequest.RuleConditionKeys.RESOURCE_TYPES === "resourceTypes";
4044+
chrome.declarativeNetRequest.RuleConditionKeys.RESPONSE_HEADERS === "responseHeaders";
4045+
chrome.declarativeNetRequest.RuleConditionKeys.TAB_IDS === "tabIds";
4046+
chrome.declarativeNetRequest.RuleConditionKeys.TOP_DOMAINS === "topDomains";
4047+
chrome.declarativeNetRequest.RuleConditionKeys.URL_FILTER === "urlFilter";
4048+
40244049
chrome.declarativeNetRequest.SESSION_RULESET_ID === "_session";
40254050

40264051
chrome.declarativeNetRequest.UnsupportedRegexReason.MEMORY_LIMIT_EXCEEDED === "memoryLimitExceeded";
@@ -4131,6 +4156,7 @@ async function testDeclarativeNetRequest() {
41314156
tabId: 1,
41324157
initiator: "https://example.com",
41334158
method: "get",
4159+
topUrl: "https://example.com",
41344160
responseHeaders: {},
41354161
};
41364162

0 commit comments

Comments
 (0)