Amazon search suggestions are no longer displayed if a special locale character is used in the string
Categories
(Firefox :: Search, defect, P2)
Tracking
()
People
(Reporter: cbaica, Assigned: bugzilla)
Details
Attachments
(1 file)
Affected versions
- Fx87.0a1
Pre-requisites
- Install a DE Firefox locale.
Steps to reproduce
- Launch Firefox.
- Click on the address bar and select the amazon one-off from the drop-down.
- Start typing 'stühle'.
Expected result
- Search suggestions are displayed for the typed word.
Actual result
- Search suggestions are not displayed.
Regression range
- Not a regression.
Additional notes
- The search suggestions dissappear after the special character 'ü' is typed (or pasted).
- No suggestions are displayed for copy/pasted words containing special characters.
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Compare the network responses from:
https://completion.amazon.de/search/complete?q=stühle&search-alias=aps&mkt=4
https://www.google.com/complete/search?client=firefox&q=stü
Google has the first element returned as "stü" whereas Amazon has it as "st\u00FC".
I haven't tested/dug into the code, but I suspect that the encoded version that Amazon is returning is enough to throw our suggested results off.
They are setting text/javascript;charset=UTF-8
in the response header, and the rest of the suggestions are utf-8, so I'm a little surprised the first element isn't as well.
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
SearchSuggestionController throws out suggestions if the remote search string does not match the typed one. This will need a workaround. We can also let Amazon know, since this seems like a bug on their end.
Assignee | ||
Comment 3•3 years ago
|
||
We could fix this by replacing this block with
try {
if (
!Array.isArray(serverResults) ||
!serverResults[0] ||
(this._searchString.localeCompare(serverResults[0], undefined, {
sensitivity: "base",
}) &&
// Some engines (e.g. Amazon) return a search string containing
// escaped Unicode sequences. Try decoding the remote search string
// and compare that with our typed search string.
this._searchString.localeCompare(
decodeURIComponent(
JSON.parse('"' + serverResults[0].replace(/\"/g, '\\"') + '"')
),
undefined,
{
sensitivity: "base",
}
))
) {
// something is wrong here so drop remote results
deferredResponse.resolve(
"Unexpected response, this._searchString does not match remote response"
);
return;
}
} catch (ex) {
deferredResponse.resolve(
`Failed to parse the remote response string: ${ex}`
);
return;
}
but we're going to try reaching out to Amazon first to see if this is a bug or something intentional. I'll remove the iteration for now.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
Pushed by htwyford@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c6fb19f57dca Allow suggestions from engines that escape Unicode characters. r=Standard8
Comment 6•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Reporter | ||
Comment 7•3 years ago
|
||
The issue is verified fixed in the latest Fx92.0a1 build on Windows 10 and Ubuntu 20. While having the amazon search engine as default and typeing or pasting special charcaters, or words containing special characters, search suggestions are still provided.
Description
•