0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Sets how much of the current page's URL is sent as the Referer when an element fetches a resource or follows a link.
Overview
When a page loads an image or a user follows a link, the browser normally tells the destination where the request came from in the Referer header (and document.referrer). The referrerpolicyattribute sets, per element, how much of your URL is sent: all of it, only the origin, or nothing. It overrides the page-wide policy.
Each link opens a page that prints document.referrer: the full demo URL, just the origin, or nothing.
Values
"Downgrade" means an HTTPS page requesting an HTTP URL. An empty or invalid value means "no policy set here": the page-wide policy applies.
Value
Same-origin request
Cross-origin request
Downgrade
no-referrer
Nothing
Nothing
Nothing
origin
Origin
Origin
Origin
strict-origin
Origin
Origin
Nothing
same-origin
Full URL
Nothing
Nothing
origin-when-cross-origin
Full URL
Origin
Origin
strict-origin-when-cross-origin (default)
Full URL
Origin
Nothing
no-referrer-when-downgrade
Full URL
Full URL
Nothing
unsafe-url
Full URL
Full URL
Full URL
"Full URL" never includes the fragment or any username and password in the URL. With no policy anywhere, browsers use strict-origin-when-cross-origin.
Examples
Third-party images and embeds
Images and iframes
123456
<!-- The avatar host learns nothing about the page --><imgsrc="https://avatars.example.net/u/8812.png"alt="Ana Lima"referrerpolicy="no-referrer"><!-- A map embed sees only your origin, and nothing on a downgrade --><iframesrc="https://maps.example.com/embed?q=Leeds"title="Map of Leeds"referrerpolicy="strict-origin"loading="lazy"></iframe>
Links from a page with private URLs
Pages whose URLs carry tokens or personal data (password resets, search results, account pages) should not leak them to the next site.
<head><metaname="referrer"content="same-origin"></head><!-- This one link sends the origin to a partner --><ahref="https://partner.example.com/"referrerpolicy="strict-origin-when-cross-origin">Partner</a>
Order of precedence: the element's referrerpolicy (or rel="noreferrer"), then the document policy. The document policy comes from the Referrer-Policy HTTP header, and a later <meta name="referrer"> replaces it. Without either, the browser default applies.
In Vanilla Breeze
<youtube-player> loads its thumbnail with referrerPolicy = 'no-referrer' and its iframe with referrerpolicy="strict-origin-when-cross-origin" (src/web-components/youtube-player/logic.js).
<social-embed> frames use referrerpolicy="strict-origin" (src/web-components/social-embed/shared.js).
<html data-link-privacy="strict"> makes VB add rel="noreferrer" to target="_blank" links (src/utils/links-init.js); see rel.
<browser-window> passes referrerpolicy through to its iframe.
Security
The referrer is a privacy leak, not an authentication mechanism: never rely on it to check where a request came from, and never put secrets in URLs.
Stricter is safer. The default already hides paths from other sites; reach for looser policies only for a specific partner who needs them.
Browser support
The attribute: Chrome 51, Firefox 50, Safari 14. Default strict-origin-when-cross-origin: Chrome 85, Firefox 87, Safari 15. Browsers may send less than a policy allows: Firefox 92+ ignores unsafe-url, no-referrer-when-downgrade and origin-when-cross-origin for cross-site requests, and Safari does not honour them either, trimming cross-site referrers to the origin (MDN browser-compat-data, November 2026).
Gotchas
Loose policies are clamped cross-site. Do not build features that need a full cross-site referrer; pass the information in the URL instead.
Blanket no-referrer breaks referral analytics and some CSRF defences that check Referer on your own origin.
origin and unsafe-url leak on downgrade. Prefer the strict- variants.