declarativeNetRequest.updateStaticRules

Modifies the enabled state of rules in a static ruleset. The number of rules that can be disabled in a ruleset is limited to the value of MAX_NUMBER_OF_DISABLED_STATIC_RULES.

Rules can be enabled and disabled while the ruleset containing them is disabled. Any changes become effective when the ruleset is enabled.

Syntax

js
let staticRulesUpdated = browser.declarativeNetRequest.updateStaticRules(
    options                // object
);

Parameters

options

An object specifying a static ruleset and the rules to enable or disable in that ruleset.

rulesetId rulesetId

string The ID of the static ruleset to modify.

disableRuleIds Optional

An array of number. IDs of the rules to disable. Any invalid IDs are ignored.

enableRuleIds Optional

An array of number. IDs of the rules to enable. Any invalid IDs are ignored.

Return value

A Promise If the request is successful, the promise is fulfilled without arguments. If the request fails, the promise is rejected with an error message.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
updateStaticRules
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 128 (Release date: 2024-07-09)
footnote Full support
Opera – Full support
Opera 97 (Release date: 2023-03-22)
footnote Full support
Safari – No support
Safari
footnote
footnote See bug 261039
Firefox for Android – Full support
Firefox for Android 128 (Release date: 2024-07-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote
footnote See bug 261039

Legend

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

Full support
Full support
No support
No support
See implementation notes.