Closed Bug 1841869 Opened 2 years ago Closed 1 year ago

entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine

Categories

(Firefox :: Address Bar, defect, P3)

Firefox 115
defect

Tracking

()

VERIFIED FIXED
124 Branch
Tracking Status
firefox124 --- verified

People

(Reporter: e412byoy7, Assigned: mseibert)

References

Details

(Keywords: papercut, Whiteboard: [sng-scrubbed][search-papercut])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

  1. enter sth. like "Lorem Ipsum @mozilla.org" in adress bar
  2. hit enter key

Actual results:

A strange login-prompt appears:
"You are about to log in to the site “mozilla.org” with the username “Lorem%20Ipsum%20”, but the website does not require authentication. This may be an attempt to trick you.

Is “mozilla.org” the site you want to visit?"

Expected results:

It should instantly search for "Lorem Ipsum @mozilla.org" on the default search engine, upon hitting enter key.

The Bugbug bot thinks this bug should belong to the 'Firefox::Address Bar' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Address Bar

we interpret the first part as a username:password pair, that technically is correct:
new URL("http://Lorem Ipsum @mozilla.org").href => "http://Lorem%20Ipsum%20@mozilla.org/"
The userinfo section allows for the following characters: unreserved / pct-encoded / sub-delims / ":"

From a user perspective, I think it makes sense to search though, unless the user explicitly typed the %20. I think the benefit overweights the cases where the user actually wants to provide a userinfo pair containing spaces.
The fix may not be trivial though, URIFixup trusts the URI parser, so this would need an explicit exception that I don't particularly like.
We should probably just add an exception in UrlbarProviderHeuristicFallback.sys.mjs

Severity: -- → S3
Keywords: papercut
Priority: -- → P3
Whiteboard: [sng-scrubbed][search-papercut]
Assignee: nobody → mseibert
Attachment #9372078 - Attachment description: WIP: Bug 1841869 - entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine. → Bug 1841869 - entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine.r=adw
Status: NEW → ASSIGNED
Attachment #9372078 - Attachment description: Bug 1841869 - entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine.r=adw → WIP: Bug 1841869 - entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine.r=adw
Attachment #9372078 - Attachment description: WIP: Bug 1841869 - entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine.r=adw → Bug 1841869 - entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine.r=adw

Same with searching for a term like "abc.com word1 word2". It tries to open "abc.com" instead of searching for the entire string "abc.com word1 word2" on the browser's default searchengine.

Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8e2553caf05d entering "abc @xyz.[TLD]" in address bar opens a prompt regarding loading "xyz.[TLD]" instead of searching for "abc @xyz.[TLD]" on the default search engine.r=adw

But shouldn't also "https://abc.com word1 word2" search on the browser's searchengine for "word1" and "word2" on "https://abc.com"?

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch

Hey! I asked a question!

Flags: needinfo?(smolnar)

(In reply to Dan from comment #6)

But shouldn't also "https://abc.com word1 word2" search on the browser's searchengine for "word1" and "word2" on "https://abc.com"?

Searching on a specific site works differently, and it's something we're investigating for the future.
For now that string is an invalid url, and the expected outcome is to execute a search for the whole string.
If you're using Google (but I imagine other search engines have similar syntax) you could search for "site:abc.com word1 word2".

Flags: needinfo?(smolnar)

Nevermind, it also works with https in front, sorry Sandor! Awesome fix, thanks everyone!!!

Reproducible on a 2024-01-25 Nightly build on Windows 10.
Verified as fixed on Firefox Nightly 124.0a1 on Windows 10, macOS 12, Ubuntu 22.

Status: RESOLVED → VERIFIED
Regressions: 1911022
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: