Project

General

Profile

Actions

Feature #938

closed

Text that is not recognizable as a URL triggers a search

Added by राही अखेराजोत 2 months ago. Updated 24 days ago.

Status:
Closed
Priority:
3.x
Assignee:
-
Start date:
11/29/2022
Due date:
% Done:

0%

Estimated time:

Description

When I entered this text (google.com/search/hello motto) in the search bar, privacy browser opened an unexpected page.


Files

Actions #1

Updated by Soren Stoutner 2 months ago

This is what it opened for me, which is exactly what I was expecting. What were you expecting it to do?

Actions #2

Updated by Soren Stoutner 2 months ago

  • Status changed from New to Feedback
Actions #3

Updated by राही अखेराजोत about 2 months ago

Expected page was https://google.com/search/hello%20motto

It is very disappointing that after typing such a lengthy url (such an exact location) in search bar, the browser searches it through the search engine.

Actions #4

Updated by Soren Stoutner about 2 months ago

  • Status changed from Feedback to Closed

"google.com/search/hello motto" is not a valid URL for two reasons.

1. To be a URL it must contain a scheme (like http or https).
2. URLs may not contain spaces. They are represented by %20 instead.

You can read over the information for what makes a valid URL at the Wikipedia page.

https://en.wikipedia.org/wiki/URL

As you pointed out, what you really wanted was https://google.com/search/hello%20motto, which is a URL.

Privacy Browser does automatic recognition of partial URLs. For example, if you had typed "google.com/search/hello%20motto", Privacy Browser would have recognized that, if a valid scheme was added, that would be a URL and would have done such.

Alternatively, if you had typed "https://google.com/search/hello motto" Privacy Browser would have recognized that if the space was replaced by a %20 it would be a valid URL and would have done the substitution.

This URL recognition is all handled by the Android pattern URL matcher.

https://developer.android.com/reference/android/util/Patterns#WEB_URL

Any more aggressive attempt to turn what the user types into URLs would inappropriately turn what the user intends to be a search with the default search engine into URLs that the user didn't intend. So, there is nothing unexpected about this behavior and it is indeed doing exactly what it should do.

As a further point, even though https://google.com/search/hello%20motto is a valid URL, it is not a URL that matches Google's system, so that if you attempt to go to it, Google will respond with a 404 error.

The URL you would want to do a Google search is https://www.google.com/search?q=hello%20motto. Just like the two examples above, if you partially enter the URL, Privacy Browser will auto correct it to a full URL. However, if you just want to do Google searches, I would recommend you change the search engine in Privacy Browser's settings to Google and then you can simply type "hello motto".

Actions #5

Updated by Soren Stoutner 24 days ago

  • Subject changed from Unexpected behaviour to Text that is not a URL triggers a search
Actions #6

Updated by Soren Stoutner 24 days ago

  • Subject changed from Text that is not a URL triggers a search to Text that is not recognizable as a URL triggers a search
Actions

Also available in: Atom PDF