Some memos about Referrer-Policy #31
Labels
category:memo
just note something down
language:English
blog written by Engish
tag:back end
topic about back end
tag:browser
something about browser
tag:front end
topic about front end
tag:html
something about html
tag:javascript
something about javascript
tag:native code
something about native code, not framework or syntactic sugar
The
Referrer-Policy
HTTP header controls how much referrer information (sent with the Referer header) should be included with requests. It is often used to collect the information about the origin of the current request and here I note some memo about it.●values
The valid values of
Referre-Policy
areno-referrer
,no-referrer-when-downgrade
,origin
,origin-when-cross-origin
,same-origin
,strict-origin
,strict-origin-when-cross-origin
, andunsafe-url
.no-referrer
no-referrer-when-downgrade
origin
origin-when-cross-origin
same-origin
strict-origin
strict-origin-when-cross-origin (default)
unsafe-url
●how to get it?
You may use the code below to get the value.
While in
javascript
, the spelling is correct so the code is like this,●how to set it in HTML ?
set it with a meta element
set it with referrerpolicy attribute
You can specify the referrerpolicy attribute on
<a>
,<area>
,<img>
,<iframe>
,<script>
, or<link>
elements to set referrer policies for individual requestsset it with rel attribute
Alternatively, you can set a noreferrer linke relation on an
<a>
,<area>
, or<link>
elementsFor more information ,see the ref link here.
The text was updated successfully, but these errors were encountered: