Details describing how a redirect should be performed. Only valid for redirect rules.
On this page
declarativeNetRequest.Redirect
Type
Values of this type are objects. They contain these properties:
extensionPathOptional-
A
string. The path relative to the extension directory. Should start with '/'. regexSubstitutionOptional-
A
string. The substitution pattern for rules that specify aregexFilter. The first match ofregexFilterwithin the URL is replaced with this pattern. WithinregexSubstitution, backslash-escaped digits (\1to\9) are used to insert the corresponding capture groups.\0refers to the entire matching text. transformOptional-
declarativeNetRequest.URLTransform. The URL transformations to perform. urlOptional-
A
string. The redirect URL. Redirects to JavaScript URLs are not allowed.
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
Redirect |
84 | 84 | No | ? | 70 | 15.4 | ? | ? | No | ? | 15.4 | ? |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/Redirect