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
Handle "::" in URLs specially #544
Comments
Ok I've looked into this and it seems that double colon after scheme is allowed by the generic URI syntax.:
i.e. the colon is explicitly allowed there. That being the case, I think we might still consider checking if there's actually some sort of handler registered for a given scheme. It seems QDesktopServices is missing some getUrlHandlers method to retreive a list of all handlers which are registered with the DE (where does that specifically happen actually?). We could then combine the list with any scheme handlers registered explicitly with qutebrowser (see #540) and search for a prefix in the URI. Everything else would then be treated as a search query with the default engine. That precludes of course the possibility to have users register scheme handlers dynamically if a yet unknown URI is entered. If that's planned, we might just stick with the slight annoyance of having to type the default search engine upfront if searching for a x::y string. Regarding #542, I still think that any named search engines should be a user setting, and if that case occurs well I have to give the default engine an explicit name. |
Either way, it seems to be hard to get a list of the supported schemes. I vaguely remember OtterBrowser/otter-browser wanted to do something similiar but I don't think they got anywhere. I wonder if it's a good idea to just never treat URLs with Are there any common cases of protocols using a |
I wonder if it's a good idea to just never treat URLs with `scheme::foo` as URL. This could be added easily to `utils.urlutils:_has_explicit_scheme` (which already rejects `scheme: foo` as a valid URL).
Are there any common cases of protocols using a `scheme::foobar` URL? I'll ask if someone knows more in `#whatwg` on Freenode.
I know of none. We could of course just start treating everything which has a colon after the first colon as a search string and see if that troubles anyone at some point. Should not be a problem to fall back to the behavior as it is now by removing that check again. If you don't get an answer from the #whatwg people I suggest we just give it a try. In that case we might want to merge #542 after all. I think not having those hardcoded searchengine aliases is actually better, following the principle of least surprise.
|
Closes qutebrowser#544. We might also merge qutebrowser#542 now.
Split from #542. /cc @flvi0
QUrl parses
foo::bar
as a valid URL withfoo
as scheme and:bar
as path. I'm not sure if this is something sensible to do according to the URL standard. I guessqutebrowser.urlutils.is_url
should handle this as a special case, and maybe a Qt bug should be submitted if this is invalid according to RFC3986 and the WHATWG living URL standard?The text was updated successfully, but these errors were encountered: