Skip to content
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

Treating domains with long TLDs as search queries #3268

Closed
bomb20 opened this issue Mar 16, 2019 · 4 comments
Closed

Treating domains with long TLDs as search queries #3268

bomb20 opened this issue Mar 16, 2019 · 4 comments

Comments

@bomb20
Copy link

bomb20 commented Mar 16, 2019

Entering a domain name with a long tld (such as .social or .space) opens the search engine searching for that domain instead of opening it.

@gdh1995
Copy link
Contributor

gdh1995 commented Mar 22, 2019

(In short) it's too hard to do so prefectly.

Chrome uses a long list of public top-level domains to decide whether a string is a hostname or just search query, and the list is in https://cs.chromium.org/chromium/src/net/base/registry_controlled_domains/effective_tld_names.dat?dr=C&g=0, which is a copy of https://www.google.com/url?q=https://publicsuffix.org/list/public_suffix_list.dat .

I think this list is so long that we should not pack it into Vimium. Instead, I suggest that Vimium searches the domain list cache for your "domain name" query, and if finding any match, treates it as a valid domain.

Here's what I've done in my customized Vimium (
https://github.com/gdh1995/vimium-c/blob/3a342ea0d2bea5070a2d1737df7da332c90567bf/background/utils.ts#L242-L245):

checkInDomain_ (host: string, port?: string | null): 0 | 1 | 2 {
    const domain = port && this.domains_[host + port] || this.domains_[host];
    return domain ? domain.https ? 2 : 1 : 0;
  },

@philc
Copy link
Owner

philc commented Nov 17, 2023

I think two reasonable options are:

  1. expand the tolerance of the regexp in Vimium by interpreting more than 3 chars past the last period as a TLD. I'm not sure how common it is for a query containing a period to be a search rather than a URL. Although I remember being annoyed on occasion with Firefox back when they had this same simple domain-detection logic in their URL search bar.

  2. hardcode a list of the TLDs. @gdh1995, the list that you linked to is indeed massive. I think we can provide a good user experience by using this much shorter list, and refreshing it every few years.

@leoheitmannruiz
Copy link
Contributor

Option 2 seems, to me, like the better of the two.

I expect it to result in less unexpected behavior and in case it does fail, the query will simply be searched for and the user can select the first result. On the other hand, if option 1 fails, the user is stuck in the "Hmm. We’re having trouble finding that site." and can't leave, using Vimium, which I personally find quite bothering.

Also, how would you benefit from the long list? It seems it contains a ton of second-level domains (not sure if that is what they're called).

@philc philc closed this as completed in 5360591 Dec 10, 2023
@leoheitmannruiz
Copy link
Contributor

Hey @philc, sorry for bothering.
Can you please issue a release of Vimium to the Firefox add-on site? The last release (7 Nov 2023) was before this was implemented and I'd love to be able to open all URLs. Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants