Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

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…

Read the release notes

referrerpolicy

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 referrerpolicy attribute sets, per element, how much of your URL is sent: all of it, only the origin, or nothing. It overrides the page-wide policy.

Applies to: <a>, <area>, <img>, <iframe>, <script> and <link>. Forms have no referrerpolicy; use rel="noreferrer" on <form>.

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.

ValueSame-origin requestCross-origin requestDowngrade
no-referrerNothingNothingNothing
originOriginOriginOrigin
strict-originOriginOriginNothing
same-originFull URLNothingNothing
origin-when-cross-originFull URLOriginOrigin
strict-origin-when-cross-origin (default)Full URLOriginNothing
no-referrer-when-downgradeFull URLFull URLNothing
unsafe-urlFull URLFull URLFull 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

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.

Page-wide policy with overrides

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.

Related

Which to choose

  • Most sites — nothing; the default is sensible.
  • Pages with sensitive URLs — <meta name="referrer" content="same-origin"> or no-referrer.
  • One sensitive link or embed — referrerpolicy on that element.
  • All new-tab links — VB's data-link-privacy="strict".
↑