declarativeNetRequest.getSessionRules

Returns the active set of session-scoped rules for the extension.

Syntax

js
let sessionRules = await browser.declarativeNetRequest.getSessionRules();

Parameters

filter Optional

An object to filter the list of returned rules.

ruleIds Optional

An array of integer. The IDs of the rules to return.

Return value

A Promise fulfilled with an array of declarativeNetRequest.Rule objects. If no rules are active, the object is empty. If the request fails, the promise is rejected with an error message

Examples

Example extensions

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getSessionRules
Chrome – Full support
Chrome 90 (Release date: 2021-04-13)
footnote Full support
Edge – Full support
Edge 90 (Release date: 2021-04-15)
footnote Full support
Firefox – Full support
Firefox 113 (Release date: 2023-05-09)
footnote Full support
Opera – Full support
Opera 76 (Release date: 2021-04-28)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Firefox for Android – Full support
Firefox for Android 113 (Release date: 2023-05-09)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
filter
Chrome – Full support
Chrome 111 (Release date: 2023-03-07)
footnote Full support
Edge – Full support
Edge 111 (Release date: 2023-03-13)
footnote Full support
Firefox – Full support
Firefox 127 (Release date: 2024-06-11)
footnote Full support
Opera – Full support
Opera 97 (Release date: 2023-03-22)
footnote Full support
Safari – Full support
Safari 18.5 (Release date: 2025-05-12)
footnote Full support
Firefox for Android – Full support
Firefox for Android 127 (Release date: 2024-06-11)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18.5 (Release date: 2025-05-12)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support