updateEnabledRulesets method

Future<void> updateEnabledRulesets(
  1. UpdateRulesetOptions options
)

Updates the set of enabled static rulesets for the extension. The rulesets with IDs listed in options.disableRulesetIds are first removed, and then the rulesets listed in options.enableRulesetIds are added.
Note that the set of enabled static rulesets is persisted across sessions but not across extension updates, i.e. the rule_resources manifest key will determine the set of enabled static rulesets on each extension update. |callback|: Called once the update is complete. In case of an error, runtime.lastError will be set and no change will be made to set of enabled rulesets. This can happen for multiple reasons, such as invalid ruleset IDs, rule count limit exceeded, or internal errors.

Implementation

Future<void> updateEnabledRulesets(UpdateRulesetOptions options) async {
  await promiseToFuture<void>(
      $js.chrome.declarativeNetRequest.updateEnabledRulesets(options.toJS));
}