New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails for country specific TLDs #3
Comments
This is a tricky one, may leave this for a separate "heavyweight" version. |
This is a pretty big deal. |
👍 Most browsers uses the list at http://publicsuffix.org/ |
New to this project, but quite interested so thought I'd contribute some thoughts. waawii: Thanks for the publicsuffix.org link. nelix: The simple approach of including all relevant TLDs would add 94KB, if we converted publicsuffix to a Javascript array. That's only 29KB after gzip, but it does somewhat weaken the lightweight aspect. The first optimization that comes to mind would be to store the TLDs in a hierarchy, but the space saving is probably not too significant (will report back on this if I get a spare half hour). |
I have a solution that only works for the current url, not any arbitrary url. It exploits the fact that browsers can't set cookies for TLDs. I try to set a cookie until I can and that's the https://gist.github.com/3043239 It only works for the current url because of course you can't set cookies for third party domains so you can't use this method. |
+1 |
https://github.com/oncletom/tld.js Handful API to do stuff with domain names and URIs: validity, public etc. Its main purpose is to check if a domain name is valid upon. 2 constraints: an up-to-date TLDs database |
Hey, Is there a generic solution for this issue?
outputs: |
That's the expected result, I don't see |
Hmm.. How is .co.il not in the public suffix list and .co.uk, for example, is? Both are second level domains, what's the difference? |
Sorry, you are right, I just realize there is this entry: |
@websanova, are you planning to handle this issue? do you care to integrate your library with tld.js or publicsuffixlist.js (from the earlier comments), they both handle the country specific tlds? Thanks for the wonderful url parser library.. |
I'm currently preoccupied with work and a side project now so don't have
|
Added support for this. Comes in two versions now |
The text was updated successfully, but these errors were encountered: