This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
http://url.spec.whatwg.org/#dom-url-origin [[ Return the Unicode serialization of url's origin. ]] It looks like currently, location.origin gives the origin of the location.href URL. This can be different from the document's origin, e.g. if document.domain is set, or if the origin is inherited (e.g. about:blank or javascript: URL in an iframe). IIRC a use case for location.origin is checking e.origin in cross-document messaging. For that case it seems like you want the document's origin.
We should have document.origin for that. We could add it to the DOM. Adding Ian just in case he has a different opinion.
LGTM.
https://github.com/whatwg/dom/commit/0999d4d9acbe9cb178021b9f6ceba8cc72cc00fd
And serializing it is this commit because I'm an idiot: https://github.com/whatwg/dom/commit/b5dcd1560f4c19a70f2dfc7eb1e00289809554e2