declarative_net_request

Type Object
Mandatory No
Manifest version 2
Example

json

"declarative_net_request" : {
  "rule_resources" : [{
    "id": "ruleset",
    "enabled": true,
    "path": "rules.json"
  }]
}

Specify static rulesets for use with declarativeNetRequest. See Permissions for more information on permission requirements.

Syntax

The "declarative_net_request" key is an object that must contain the "rule_resources" property, an array that must include at least one object with these properties:

Name Type Description
"id" String A non-empty string uniquely identifying the ruleset. IDs beginning with '_' are reserved for internal use.
"enabled" Boolean Whether the ruleset is enabled by default. The declarativeNetRequest.updateEnabledRulesets method can be used to enable or disable a ruleset at runtime.
"path" String The path of the JSON ruleset relative to the extension directory. See the Rules section of the declarativeNetRequest API for information on the content of the ruleset JSON file.

Example

json

"declarative_net_request" : {
  "rule_resources" : [{
    "id": "ruleset_1",
    "enabled": true,
    "path": "rules_1.json"
  }, {
    "id": "ruleset_2",
    "enabled": false,
    "path": "rules_2.json"
  }]
}

Example extensions

Browser compatibility

BCD tables only load in the browser