content=no-referrer 和 rel=noreferrer 有什么区别
What is the difference between content=no-referrer and rel=noreferrer
<meta name="referrer" content="no-referrer">
<a href="http://example.com" rel="noreferrer">
以上两种说法有什么区别?
The Referrer-Policy HTTP header controls how much referrer information (sent via the Referer header) should be included with requests.
no-referrer
The Referer header will be omitted entirely. No referrer information is sent along with requests.
The noreferrer keyword for the rel attribute of the <a>
, <area>
, and <form>
elements instructs the browser, when navigating to the target resource, to omit the Referer header and otherwise leak no referrer information — and additionally to behave as if the noopener keyword were also specified.
Link types:
noreferrer Prevents the browser, when navigating to another page, to send this page address, or any other value, as referrer via the Referer: HTTP header.
(In Firefox, before Firefox 37, this worked only in links found in pages. Links clicked in the UI, like "Open in a new tab" via the contextual menu, ignored this).
<meta name="referrer" content="no-referrer">
<a href="http://example.com" rel="noreferrer">
以上两种说法有什么区别?
The Referrer-Policy HTTP header controls how much referrer information (sent via the Referer header) should be included with requests.
no-referrer
The Referer header will be omitted entirely. No referrer information is sent along with requests.
The noreferrer keyword for the rel attribute of the
<a>
,<area>
, and<form>
elements instructs the browser, when navigating to the target resource, to omit the Referer header and otherwise leak no referrer information — and additionally to behave as if the noopener keyword were also specified.
Link types:
noreferrer Prevents the browser, when navigating to another page, to send this page address, or any other value, as referrer via the Referer: HTTP header. (In Firefox, before Firefox 37, this worked only in links found in pages. Links clicked in the UI, like "Open in a new tab" via the contextual menu, ignored this).