Modulepreload Referrer Header Fix
- Category
- Miscellaneous
- Type
- Chromium catches up
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
WPT details: Covered by Web Platform Tests: * modulepreload-cross-origin-referrerpolicy.sub.html * modulepreload-inline-referrerpolicy.html * modulepreload-referrer-check.html * modulepreload-referrerpolicy.html These tests verify that modulepreload requests include the correct referrer and respect referrer policies. They already pass in Safari/Firefox, and now pass in Chromium after this change.
Summary
Modulepreload and dynamic imports now correctly send the page’s referrer header when fetching scripts, aligning Chrome with the HTML specification.
Motivation
This change adds the referrer header to modulepreload requests in Chrome, fixing an inconsistency where these requests weren't sending referrer information (unlike other script loading methods like <script> tags and dynamic imports). This: 1) Aligns with the HTML spec, which requires using the client's referrer for module fetches 2) Ensures servers relying on referrer data for security or analytics receive consistent information 3) Improves cross-browser compatibility and matches web developer expectations
Standards & signals
- Specification: https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload:script-fetch-options
- Firefox: Shipped/Shipping
- Safari: Shipped/Shipping
- Web developers: No signals
- Tracking bug: https://crbug.com/441933555
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=modulepreload-referrer-header-fix
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Modulepreload%20Referrer%20Header%20Fix
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Modulepreload%20Referrer%20Header%20Fix
- Baseline status: https://webstatus.dev/?q=Modulepreload%20Referrer%20Header%20Fix