HTML <a> referrerpolicy-eigenschap
Definitie en gebruik
referrerpolicy
De eigenschap bepaalt de referrer-informatie die moet worden verzonden wanneer de gebruiker op een hyperlink klikt (referentie-informatie).
Voorbeeld
Referrerpolicy instellen voor koppeling:
<a href="https://www.codew3c.com" referrerpolicy="origin">
Syntaxis
<a referrerpolicy="no-referrer|no-referrer-when-downgrade|origin|origin-when-cross-origin|same-origin|strict-origin-when-cross-origin|unsafe-url">
Eigenschapswaarde
Waarde | Beschrijving |
---|---|
no-referrer | Geen referentie-informatie verzenden. |
no-referrer-when-downgrade | Standaard. Als het beveiligingsniveau van het protocol onveranderd blijft of hoger is (van HTTP naar HTTP, van HTTPS naar HTTPS, van HTTP naar HTTPS is ook mogelijk), worden de bron, het pad en de querystring verzonden. Geen inhoud wordt verzonden naar een lagere beveiligingsniveau (van HTTPS naar HTTP is niet toegestaan). |
origin | Send the document's origin (protocol, host, and port). |
origin-when-cross-origin | For cross-origin requests, send the document's origin. For same-origin requests, send the origin, path, and query string. |
same-origin | For same-origin requests, send reference page information. For cross-origin requests, do not send reference page information. |
strict-origin-when-cross-origin | If the protocol security level remains unchanged or higher (HTTP to HTTP, HTTPS to HTTPS, and HTTP to HTTPS are all possible), send the source. For less secure levels (from HTTPS to HTTP), do not send any content. |
unsafe-url | Send the source, path, and query string (not considering security). Use this value with caution! |
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 |