v145 · Origin API · Security
Cross-Origin Safety Checker
Enter two URLs and discover whether they share the same origin, the same site, or are fully cross-origin — using the Chrome 145 Origin API with isSameOrigin() and isSameSite().
Requires Chrome 145+. In older browsers the Origin constructor is unavailable.
Try a preset
origin vs site
// Same-origin: scheme + host + port are ALL identical
new Origin("https://example.com").isSameOrigin(
new Origin("https://example.com") // true
);
new Origin("https://example.com").isSameOrigin(
new Origin("https://sub.example.com") // false — host differs
);
new Origin("https://example.com").isSameOrigin(
new Origin("https://example.com:8080") // false — port differs
);
// Same-site: eTLD+1 matches and scheme matches
// sub.example.com and other.example.com are same-site
new Origin("https://sub.example.com").isSameSite(
new Origin("https://other.example.com") // true
);
// http and https are NOT same-site (scheme must match)
new Origin("http://example.com").isSameSite(
new Origin("https://example.com") // false
);
see also
- Origin Object Explorer — inspect all properties of an Origin object
- Introducing the Origin API overview
- ChromeStatus entry