declarativeNetRequest.updateEnabledRulesets

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.

Syntax

js
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

BCD tables only load in the browser