MDN self-hosted library · e01.org

declarativeNetRequest.Rule

The object describing the actions to take for matching requests. These can be specified in the static rule resources linked by the manifest.json's declarativenetrequest key, or more dynamically through the declarativeNetRequest.updateDynamicRules or declarativeNetRequest.updateSessionRules methods.

no runnable cells webextension-api-type upstream source

The object describing the actions to take for matching requests. These can be specified in the static rule resources linked by the manifest.json's declarative_net_request key, or more dynamically through the declarativeNetRequest.updateDynamicRules or declarativeNetRequest.updateSessionRules methods.

See Rules on the API overview page for more information about rules.

Type

Values of this type are objects. They contain these properties:

  • action
  • : declarativeNetRequest.RuleAction. The action to take if this rule is matched.
  • condition
  • : declarativeNetRequest.RuleCondition. The condition under which this rule is triggered.
  • id
  • : number. An ID that uniquely identifies a rule within a ruleset. Mandatory and should be >= 1.
  • priority
  • : number. Rule priority. Defaults to 1. When specified, should be >= 1. See Matching precedence for details on how priority affects which rules are applied.

h2

Browser compatibility