Comments (5)
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.
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.
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.
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.
parse-domain excludes private domains by default now. Shipped with 1.0.0
.
from parse-domain.
Related Issues (20)
- v3.x no longer works with require HOT 1
- Problem with IP dependency? HOT 2
- string ends with dot is recognized as valid domain HOT 1
- result.domain not correct HOT 2
- Underscores in subdomains? HOT 5
- Domain is incorrectly splitting for gov.uk domain HOT 1
- No type property on parseResult HOT 2
- `.com.ru` isn't picked up as a top level domain in the ICANN form HOT 3
- False negative cases with new support for invalid IPV6 URLs HOT 2
- LABEL_INVALID_CHARACTER for a legitimate URL HOT 2
- Bad export directive since 42f54e8010c077c5375f0c96ab35a12bad35d3f4 (Jan 23) HOT 4
- No subdomain detected for withgoogle.com HOT 2
- Support for TypeScript on Node HOT 3
- wrong setting HOT 7
- Wrong top level domain detection based on the public suffix list HOT 1
- Cannot use library in Typescript CJS workspace HOT 3
- Error when update version (Webpack)
- How to use require instead of import? HOT 7
- Missing top level domains that got added past last publish date. HOT 2
- Leading dots lead to INVALID even with lax validation e.g .reflectoring.io
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-domain.