Updates the extension's set of static rulesets. The rulesets with IDs listed in options.disableRulesetIds
are first deactivated, and then the rulesets listed in options.enableRulesetIds
are activated. Note that the set of enabled static rulesets persists across sessions but not across extension updates, i.e. the declarative_net_request.rule_resources
manifest key determines the set of enabled static rulesets on each extension update.
On this page
declarativeNetRequest.updateEnabledRulesets
Syntax
let updatedRulesets = browser.declarativeNetRequest.updateEnabledRulesets(
options // object
);
Parameters
-
options
-
An object detailing the rulesets to activate or deactivate in the extension's static rulesets.
disableRulesetIds
Optional-
An array of
string
. IDs of static Rulesets to deactivated. enableRulesetIds
Optional-
An array of
string
. IDs of static Rulesets to activated.
Return value
A Promise
If the request was successful, the promise is fulfilled with no arguments. If the request fails, the promise is rejected with an error message.
Examples
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
updateEnabledRulesets |
84 | 84 | No | ? | 70 | 15 | ? | ? | No | ? | 15 | ? |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/updateEnabledRulesets