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

Re: [whatwg] proposal for a location.domain property

From: Adam Barth <w3c@adambarth.com>
Date: Thu, 24 May 2012 10:56:56 -0700
Message-ID: <CAJE5ia9mko8jvFe3OynWnJ-L-k=RO0kN_5pZVu2iXZ2GHrEbhg@mail.gmail.com>
To: "Hallvord R. M. Steen" <hallvord@opera.com>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>
IMHO, we should be moving away from using the public suffix list in
the platform rather than adding more APIs that interact with it.


On Thu, May 24, 2012 at 8:35 AM, Hallvord R. M. Steen
<hallvord@opera.com> wrote:
> Many browser engines use lists of top-level domains to be able to determine
> what a server's "base domain" is. For some use cases it would be interesting
> to have this information available to scripts. I list some use cases I can
> think of below:
> 1) Determining in a simple and fool-proof manner that a page is from a given
> domain. For example, if a script that might run on *.example.com,
> *.example.co.uk etc can do
> if(location.domain.indexOf('example.'==0) to check whether it runs on an
> *.example.* site (and not get a false positive match on example.exmple.com).
> 2) Checking what the shortest possible string for document.domain is.
> 3) Set cookies for all servers in a domain easily from JS without specific
> string operations on the hostname
> Thoughts?
> --
> Hallvord R. M. Steen
> Core tester, Opera Software
Received on Thursday, 24 May 2012 17:58:04 UTC

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