HTML <img> referrerpolicy Attribute
Definition and Usage
referrerpolicy
The attribute specifies the referral information to be used when fetching the image.
Example
Set referrerpolicy for the image:
<img src="https://example.com/images/myimage.jpg" alt="Some image" referrerpolicy="no-referrer">
Syntax
<img referrerpolicy="no-referrer|no-referrer-when-downgrade|origin|origin-when-cross-origin|unsafe-url">
Attribute Value
Value | Description |
---|---|
no-referrer | Do not send referer information. |
no-referrer-when-downgrade | Default. The Referer header is not sent to sources without HTTPS. |
origin | Send the origin of the document (protocol, host, and port). |
origin-when-cross-origin | For cross-origin requests: send only the protocol, host, and port. For same-origin requests: also include the path. |
unsafe-url | Send the source, path, and query string (but not including the fragment, password, or username). This value is considered insecure. |
Browser Support
The numbers in the table indicate the first browser version to fully support this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
51.0 | 79.0 | 50.0 | 11.1 | 38.0 |