data URIs are misinterpreted as a search, if they include a question mark and a space
Categories
(Firefox :: Address Bar, defect, P3)
Tracking
()
People
(Reporter: dholbert, Assigned: mak)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
STR:
- Type or copypaste this data URI into your location bar, and then hit enter:
data:text/html,oh hi?
(Notice the space character - it is important.)
EXPECTED RESULTS:
Firefox should show me a basic document with content oh hi?
ACTUAL RESULTS:
Firefox takes me to a google search for the search string data:text/html,oh hi?
Here's a slightly more complex data URI that's a bit clearer about why it needs spaces and a question mark (and also triggers this issue):
data:text/html,<div style="color:green">Is this green?
In Chrome and older versions of Firefox, this ^^ URI produces a basic document with some green text saying "Is this green?". In current Firefox and Firefox Nightly, it gives ACTUAL RESULTS (a google search page for the raw data URI).
mozregression gives me this range:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=f3e62cd8aef6a739ec433be0c43837fd23af2426&tochange=7a266c35cb309b3be5686b2814947092623bd36e
...which means this was a regression from:
https://hg.mozilla.org/integration/autoland/rev/7a266c35cb309b3be5686b2814947092623bd36e
Ed Lee — Bug 1541502 - Add Pocket menu, triggering improvements and bug fixes to Activity Stream r=k88hudson
Comment 1•6 years ago
|
||
I don't think the regression is from that bug 1541502 newtab export. The behavior seems to be the urlbar dropdown/view switches the first result from "Visit" to "Search with Google" when there's a space and a ?.
Initial check of that export commit and the parent both exhibit the searches-in-google behavior. I'll try to bisect some more
| Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Ed Lee :Mardak from comment #1)
The behavior seems to be the urlbar dropdown/view switches the first result from "Visit" to "Search with Google" when there's a space and a
?.
Aha, you're right! If I type in an affected data URI and then hit "esc" (to close the autocomplete dropdown) before hitting enter, then I get EXPECTED RESULTS.
RE the regression cset -- you're right, the parent cset reproduces the issue as well[1]... I'm not sure what happened with my bisection. Sorry about that!
[1] based on mozregression --repo autoland --launch f3e62cd8aef6a739ec433be0c43837fd23af2426
Updated•6 years ago
|
Updated•6 years ago
|
| Reporter | ||
Comment 3•6 years ago
|
||
(That regressing bug makes much more sense -- thanks for fixing that.)
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
I could reproduce the issue on Windows 10 x64, Mac 10.14 and Ubuntu 18.04.3 LTS on all latest Firefox Release 72.0.2, Beta 73.0 and Nightly 74.0a1 (2020-02-06) versions. Will add the according flags.
Updated•6 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 5•5 years ago
|
||
Ideally spaces should always be encoded when in the path, so I don't think those are valid URIs, according to the spec.
That said, it should be trivial to detect the data protocol and special case them, considered they are particularly useful for developers, and also for parity with other browsers.
| Assignee | ||
Comment 6•5 years ago
|
||
Note the test case is currently affected by bug 1631611.
| Assignee | ||
Comment 7•5 years ago
|
||
Ignore whitespaces when tokenizing strings looking like data: urls.
Improve the tokenizer to better distinguish possible origins from text, by
using the domains whitelist.
Fix a regexp mistake uncovered by the test.
Comment 9•5 years ago
|
||
| bugherder | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
I verified this issue using Fx 77.0a1 (2020-04-30), on Windows 10 x64 and macOS 10.13.
Description
•