Giter Site home page Giter Site logo

Comments (5)

jhnns avatar jhnns commented on May 13, 2024

Mhmm ... that's tricky, because googleapis.com is listed at publicsuffix, since the "user controlled" part of the URL is placed before googleapis.com. Same with blogspot.com.

That's why parseDomain() thinks it's a TLD although it's technically not a TLD. I probably used the term TLD in a wrong way, since a TLD is always the last portion of the URL (like uk in .co.uk). However, most users care more about the "user controlled" part which can be very subjective depending on your use-case.

Browser vendors, however, use publicsuffix as source to determine whether the entered string is a URL or a search keyword and even for restricting cookie access.

Honestly, I don't know how to proceed. Can we define an expected behavior? Maybe publicsuffix is the wrong source, maybe we should leverage DNS?

from parse-domain.

amitmtrn avatar amitmtrn commented on May 13, 2024

That's interesting, I didn't know the concept of public suffix. I used this module to separate the domain name and use whois to check who own this domain. I think that maybe it would be best to add the domain LTD and the domain publicsuffix.

for example:
something.blogspot.com whould be parse to

{
domain: blogspot,
subdomain: something,
LTD: com,
publicsuffix: blogspot.com 
}

from parse-domain.

hongkongkiwi avatar hongkongkiwi commented on May 13, 2024

Seems I am having the same issue as above #6. It would be great to seperate out publicsuffix, because honestly that's just a guess and we will never catch them all. Where as tld is very clear, there can only be a finite number of tld's and in my case I'm most interested in the tld, domain, subdomain breakdown.

from parse-domain.

jhnns avatar jhnns commented on May 13, 2024

Well, as far as I can tell, is the TLD just the last portion of the URL. I don't know if there is a rule that separates the .co.uk case from the blogspot.com. That's why publicsuffix.com calls itself a "A list of effective TLDs".

However, since browser vendors use this list even for restricting cookie access, it's not just an arbitrary list. But I have to admit that it's somewhat surprising...

I'm thinking about using DNS resolution to distinct between co.uk and blogspot.com. Former returns Can't find co.uk: No answer while the latter returns a IP.

from parse-domain.

jhnns avatar jhnns commented on May 13, 2024

parse-domain excludes private domains by default now. Shipped with 1.0.0.

from parse-domain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.