declarativeNetRequest.HeaderInfo

The response header to match for the request, declared in the rule.condition.excludedResponseHeaders array or rule.condition.responseHeaders array. If specified, the array must be non-empty.

When used in the condition responseHeaders, the rule matches if the request matches this response header condition. When used in the condition excludedResponseHeaders, the rule does not match if the request matches this response header condition.

Each object describes one header to match or exclude. To check multiple headers, multiple objects can be specified in these arrays, or across multiple rules.

Note: Matching by headers is a relatively new feature. Make sure to feature-detect its availability before relying on it. While some browsers ignore the complete rule when an unrecognized condition is present, Chrome 121 until 127 applied the whole rule while ignoring the responseHeaders condition. This could result in matching more requests than intended, see Chromium issue 347186592.

Type

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

A string. The name of the header. This condition matches on the name only if both values and excludedValues are not specified.

values Optional

An array of string. If specified, this condition matches if the header's value matches at least one pattern in this list. This supports case-insensitive header value matching plus the following constructs:

  • '*' : Matches any number of characters.
  • '?' : Matches zero or one character(s).
  • '*' and '?' can be escaped with a backslash, e.g., '\*' and '\?'.
excludedValues Optional

An array of string. If specified, this condition is not matched if the header exists but its value contains at least one element in this list. This uses the same glob pattern syntax as values. If values and excludedValues are both matched, then excludedValues takes precedence.

Browser compatibility

webextensions.api.declarativeNetRequest.RuleCondition.responseHeaders

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
responseHeaders
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote Full support
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote Full support
Safari – No support
Safari
footnote
footnote See bug 275158
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote
footnote See bug 275158
excludedValues
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote
footnote From Chrome 121 until Chrome 127, this condition was recognized but not applied.
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote
footnote From Edge 121 until Edge 127, this condition was recognized but not applied.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote
footnote From Opera 107 until Opera 113, this condition was recognized but not applied.
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
header
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote
footnote From Chrome 121 until Chrome 127, this condition was recognized but not applied.
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote
footnote From Edge 121 until Edge 127, this condition was recognized but not applied.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote
footnote From Opera 107 until Opera 113, this condition was recognized but not applied.
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
values
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote
footnote From Chrome 121 until Chrome 127, this condition was recognized but not applied.
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote
footnote From Edge 121 until Edge 127, this condition was recognized but not applied.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote
footnote From Opera 107 until Opera 113, this condition was recognized but not applied.
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

webextensions.api.declarativeNetRequest.RuleCondition.excludedResponseHeaders

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
excludedResponseHeaders
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote Full support
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote Full support
Safari – No support
Safari
footnote
footnote See bug 275158
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote
footnote See bug 275158
excludedValues
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote
footnote From Chrome 121 until Chrome 127, this condition was recognized but not applied.
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote
footnote From Edge 121 until Edge 127, this condition was recognized but not applied.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote
footnote From Opera 107 until Opera 113, this condition was recognized but not applied.
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
header
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote
footnote From Chrome 121 until Chrome 127, this condition was recognized but not applied.
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote
footnote From Edge 121 until Edge 127, this condition was recognized but not applied.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote
footnote From Opera 107 until Opera 113, this condition was recognized but not applied.
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
values
Chrome – Full support
Chrome 128 (Release date: 2024-08-20)
footnote
footnote From Chrome 121 until Chrome 127, this condition was recognized but not applied.
Edge – Full support
Edge 128 (Release date: 2024-08-22)
footnote
footnote From Edge 121 until Edge 127, this condition was recognized but not applied.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 114 (Release date: 2024-09-25)
footnote
footnote From Opera 107 until Opera 113, this condition was recognized but not applied.
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.