Introducing the Origin API
- Category
- Security
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
WPT details: https://wpt.fyi/results/html/browsers/origin/?label=master&label=experimental&aligned
Summary
The [origin](https://datatracker.ietf.org/doc/rfc6454/) is a fundamental component of the web’s implementation, essential to both the security and privacy boundaries which user agents maintain. The concept is well-defined between HTML and URL, along with widely-used adjacent concepts like _site_. Origins, however, are not directly exposed to web developers. Though there are various origin getters on various objects, each of those returns the ASCII serialization of an origin, not the origin itself. This has a few negative implications. Practically, developers attempting to do same-origin or same-site comparisons when handling serialized origins often get things wrong in ways that lead to vulnerabilities. Philosophically, it seems like a missing security primitive that developers struggle to polyfill accurately. As early as Chrome 145, we plan to address this gap in the platform by introducing an Origin object that encapsulates the origin concept, and provides helpful methods for comparison, serialization, parsing, and so on.
Standards & signals
- Specification: https://github.com/whatwg/html/pull/11846
- Firefox: Positive
- Safari: Support — Tending towards positive.
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/434131026
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=html%2Fbrowsers%2Forigin
- 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+Introducing%20the%20Origin%20API
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Introducing%20the%20Origin%20API
- Baseline status: https://webstatus.dev/?q=Introducing%20the%20Origin%20API
Explainers: https://github.com/mikewest/origin-api