W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

Re: [whatwg] URL: .origin

From: Adam Barth <w3c@adambarth.com>
Date: Wed, 19 Sep 2012 13:13:24 -0700
Message-ID: <CAJE5ia_N-MGqwF-NAUdMWraPcB1niwgmpTcKRqx-HtGH2bXWpA@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: WHATWG <whatwg@whatwg.org>
On Wed, Sep 19, 2012 at 11:04 AM, Anne van Kesteren <annevk@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);


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?

Received on Wednesday, 19 September 2012 20:14:29 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC