[whatwg] URL: .origin
Adam Barth
w3c at adambarth.com
Wed Sep 19 13:13:24 PDT 2012
On Wed, Sep 19, 2012 at 11:04 AM, Anne van Kesteren <annevk at annevk.nl> wrote:
> Why does the .origin member of URL (and presumably soon Location,
> HTMLAnchorElement etc.) return the Unicode serialization? .href,
> .hostname, all return the ASCII version of the domain name. Should we
> not just be consistent here?
My intent was to make it play nice with postMessage:
foo.postMessage("hi there", location.origin);
or
window.addEventListener("message", function(e) {
if (e.origin != location.origin)
return; // Some other origin is trying to confuse us!
...
}, false);
Does postMessage use the Unicode serialization or the ASCII serialization?
Adam
More information about the whatwg
mailing list