Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions types/chrome/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13952,6 +13952,34 @@ declare namespace chrome {
*/
excludedTabIds?: number[] | undefined;

/**
* The rule will only match network requests when the associated top-level frame's domain matches one from the list of `topDomains`. If the list is omitted, the rule is applied to requests associated with all top-level frame domains. An empty list is not allowed.
*
* Notes:
* - Sub-domains like "a.example.com" are also allowed.
* - The entries must consist of only ascii characters.
* - Use punycode encoding for internationalized domains.
* - Sub-domains of the listed domains are also matched.
* - For requests with no associated top-level frame (e.g. ServiceWorker initiated requests, the request initiator's domain is considered instead.
* @since Chrome 141
*/
topDomains?: string[] | undefined;

/**
* The rule will not match network requests when the associated top-level frame's domain
* matches one from the list of excludedTopDomains. If the list is empty or omitted,
* The rule will not match network requests when the associated top-level frame's domain matches one from the list of `excludedTopDomains`. If the list is empty or omitted, no domains are excluded. This takes precedence over `topDomains`.
*
* Notes:
* - Sub-domains like "a.example.com" are also allowed.
* - The entries must consist of only ascii characters.
* - Use punycode encoding for internationalized domains.
* - Sub-domains of the listed domains are also excluded.
* - For requests with no associated top-level frame (e.g. ServiceWorker initiated requests, the request initiator's domain is considered instead.
* @since Chrome 141
*/
excludedTopDomains?: string[] | undefined;

/** Whether the `urlFilter` or `regexFilter` (whichever is specified) is case sensitive. Default is false. */
isUrlFilterCaseSensitive?: boolean | undefined;

Expand Down
2 changes: 2 additions & 0 deletions types/chrome/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4149,6 +4149,8 @@ async function testDeclarativeNetRequest() {
domainType: "firstParty",
excludedResourceTypes: [chrome.declarativeNetRequest.ResourceType.IMAGE, "object"],
excludedRequestMethods: [chrome.declarativeNetRequest.RequestMethod.POST, "get"],
topDomains: ["example.com", "example.net"],
excludedTopDomains: ["example.com", "example.org"],
},
};

Expand Down