The Referrer-Policy
HTTP header governs which referrer information, sent in the Referer
header, should be included with requests made.
Header type | Response header |
---|---|
Forbidden header name | no |
Note that Referer
is actually a misspelling of the word "referrer". The Referrer-Policy
header does not share this misspelling.
Referrer-Policy: no-referrer Referrer-Policy: no-referrer-when-downgrade Referrer-Policy: origin Referrer-Policy: origin-when-cross-origin Referrer-Policy: same-origin Referrer-Policy: strict-origin Referrer-Policy: strict-origin-when-cross-origin Referrer-Policy: unsafe-url
Referer
header will be omitted entirely. No referrer information is sent along with requests.https://example.com/page.html
will send the referrer https://example.com/
.You can also set referrer policies in HTML documents. For example, by using a <meta>
element with a name of referrer
:
<meta name="referrer" content="origin">
Or by using the referrerpolicy
attribute on <a>
, <area>
, <img>
, <iframe>
, or <link>
elements:
<a href="http://example.com" referrerpolicy="origin">
Alternatively, a noreferrer
link relation on an a, area, or link element can be set:
<a href="http://example.com" rel="noreferrer">
CSS can fetch resources referenced from stylesheets. These resources are following a referrer policy as well.
External CSS stylesheets use the default policy (no-referrer-when-downgrade
) unless it's overwritten via an HTTP header that is set for a CSS stylesheet specifically.
For inline styles or styles created from APIs like HTMLElement.style
, the owner document's referrer policy is used.
Policy | Document | Navigation to | Referrer |
---|---|---|---|
no-referrer | https://example.com/page.html | any domain or path | no referrer |
no-referrer-when-downgrade | https://example.com/page.html | https://example.com/otherpage.html | https://example.com/page.html |
no-referrer-when-downgrade | https://example.com/page.html | https://mozilla.org | https://example.com/page.html |
no-referrer-when-downgrade | https://example.com/page.html | http://example.org | no referrer |
origin | https://example.com/page.html | any domain or path | https://example.com/ |
origin-when-cross-origin | https://example.com/page.html | https://example.com/otherpage.html | https://example.com/page.html |
origin-when-cross-origin | https://example.com/page.html | https://mozilla.org | https://example.com/ |
origin-when-cross-origin | https://example.com/page.html | http://example.com/page.html | https://example.com/ |
same-origin | https://example.com/page.html | https://example.com/otherpage.html | https://example.com/page.html |
same-origin | https://example.com/page.html | https://mozilla.org | no referrer |
strict-origin | https://example.com/page.html | https://mozilla.org | https://example.com/ |
strict-origin | https://example.com/page.html | http://example.org | no referrer |
strict-origin | http://example.com/page.html | any domain or path | http://example.com/ |
strict-origin-when-cross-origin | https://example.com/page.html | https://example.com/otherpage.html | https://example.com/page.html |
strict-origin-when-cross-origin | https://example.com/page.html | https://mozilla.org | https://example.com/ |
strict-origin-when-cross-origin | https://example.com/page.html | http://example.org | no referrer |
unsafe-url | https://example.com/page.html?q=123 | any domain or path | https://example.com/page.html?q=123 |
Specification | Status |
---|---|
Referrer Policy | Editor's draft |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 56 | No | 50 | No | 43 | 11.1 |
same-origin | 61 | No | 52 | No | 48 | 11.1 |
strict-origin | 61 | No | 52 | No | 48 | 11.1 |
strict-origin-when-cross-origin | 61 | No | 52 | No | 48 | 11.1 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 56 | 56 | No | 50 | 43 | No | 7.2 |
same-origin | 61 | 61 | No | 52 | 48 | No | 7.2 |
strict-origin | 61 | 61 | No | 52 | 48 | No | 7.2 |
strict-origin-when-cross-origin | 61 | 61 | No | 52 | 48 | No | 7.2 |
Note:
about:config
to allow users to set their default Referrer-Policy
— network.http.referer.userControlPolicy
.
network.http.referer.defaultPolicy
and network.http.referer.defaultPolicy.pbmode
.Possible values are:
no-referrer
same-origin
strict-origin-when-cross-origin
no-referrer-when-downgrade
(the default)Request.referrerPolicy
Content-Security-Policy
referrer
directive.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy