feat: add excludeUrls and modify urls in WebRequestFilter for better URL filtering (#44692)

* feat: add excludeUrls to web request filter

* refactor: add deprecated field

* test: update tests

* lint: newline

* docs: improve API doc

* fix: add is filter defined property to match all urls

* refactor: remove includeUrls

* refactor: remove typescript binding

* refactor: all_url

* refactor: remove isDefined methods

* refactor: remove comment

* fix: logic

* docs: add to breaking changes
This commit is contained in:
Alice Zhao 2025-02-17 12:40:47 -08:00 committed by GitHub
commit 02be7c1185
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 150 additions and 32 deletions

View file

@ -63,6 +63,22 @@ webContents.on('console-message', ({ level, message, lineNumber, sourceId, frame
Additionally, `level` is now a string with possible values of `info`, `warning`, `error`, and `debug`.
### Behavior Changed: `urls` property of `WebRequestFilter`.
Previously, an empty urls array was interpreted as including all URLs. To explicitly include all URLs, developers should now use the `<all_urls>` pattern, which is a [designated URL pattern](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns#all_urls) that matches every possible URL. This change clarifies the intent and ensures more predictable behavior.
```js
// Deprecated
const deprecatedFilter = {
urls: []
}
// Replace with
const newFilter = {
urls: ['<all_urls>']
}
```
### Deprecated: `systemPreferences.isAeroGlassEnabled()`
The `systemPreferences.isAeroGlassEnabled()` function has been deprecated without replacement.