ladybird
ladybird copied to clipboard
LibWebView: Improved url sanitizing logic
When you search a simple word such as "hello" on the browser, it would assume it is a URL and say "cannot find url" when in fact it was supposed to redirect me to the default search engine.
I fixed this by simply checking whether or not the domain has a period. (White spaces are handled automatically)
I also changed the function so the default fallback would be format_search_engine rather than a url. I also think someone should fix the compute_url function in the LibURL file.
But yeah that's all, and it's my first commit here!!
This doesn't seem correct because if I try to enter a hostname that is setup in my hosts file (e.g. http://testing) then it redirects to a search engine. I agree that it doesn't handle single word queries well currently, but it'll probably take some more thought to get right. I think the if block above this one is the culprit for single standalone words having "https://" prepended.
Okay done! I believe that the issue would be fixed now.
Your new changes don't fix single-word inputs. Additionally, you'll want to rewrite your git history (i.e. a single commit per fix/feature) before pushing and make sure the messages are in an imperative mood.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!