HTML <img> referrerpolicy eigenschap

Definitie en gebruik

referrerpolicy De eigenschap bepaalt de referentie-informatie die moet worden gebruikt bij het ophalen van het beeld.

Voorbeeld

Voor het beeld instellen referrerpolicy:

<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 referrer 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