Closed Bug 1857957 Opened 1 year ago Closed 1 year ago

Custom keyword search breaks when question mark (?) in search string

Categories

(Firefox :: Address Bar, defect)

Firefox 118
defect

Tracking

()

RESOLVED DUPLICATE of bug 1667639

People

(Reporter: as.tro.freak0, Unassigned)

References

Details

(Whiteboard: [sng-scrubbed])

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

Steps to reproduce:

I create a custom keyword search, in this case

https://translate.google.com/?sl=en&tl=es&text=%s&op=translate

with the keyword 'eng' (for translating english to spanish).

This works great, like all other custom keyword searches, UNLESS there is a question mark in the query string contains a question mark, ie. when I want to translate a question.

Actual results:

In that case (typing 'eng test?' in the search bar), it breaks and instead queries the default search engine with 'eng test?', so it ends up on this webpage (Ecosia in this case):

https://www.ecosia.org/search?q=eng%20test%3F&addon=firefox&addonversion=4.1.0&method=topbar

Expected results:

It should escape the question mark (or otherwise parse it correctly) and go to the correct URL:

https://translate.google.com/?sl=en&tl=es&text=test?&op=translate

I have also tried parsing it with JavaScript like so:
javascript:void(window.open('https://translate.google.com/?sl=en&tl=es&text=' + encodeURIComponent('test?') + '&op=translate'))

This works if run from the console, but not from a custom search, where it would be

javascript:void(window.open('https://translate.google.com/?sl=en&tl=es&text=' + encodeURIComponent('%s') + '&op=translate'))

Component: Untriaged → Address Bar
See Also: → 1667639
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1667639
Resolution: --- → DUPLICATE
Whiteboard: [sng-scrubbed]
See Also: 1667639
You need to log in before you can comment on or make changes to this bug.