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:
extensionPath
Optional-
A
string
. The path relative to the extension directory. Should start with '/'. regexSubstitution
Optional-
A
string
. The substitution pattern for rules that specify aregexFilter
. The first match ofregexFilter
within the URL is replaced with this pattern. WithinregexSubstitution
, backslash-escaped digits (\1
to\9
) are used to insert the corresponding capture groups.\0
refers to the entire matching text. transform
Optional-
declarativeNetRequest.URLTransform
. The URL transformations to perform. url
Optional-
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