Google search toolbar broken
Prerequisites
-
Can you reproduce the problem in a fresh firefox profile with only ClearURLs? -
Are you running the latest version of ClearURLs? -
Are you have changed settings under about:config
?
Description
Reported over Mozilla AMO. Screenshot below
Steps to Reproduce
- Get an american IP-Adress for example via a VPN
- Visit google.com and enter a question
Expected behavior: Whole words
Actual behavior: Single characters
System
- Platform: Windows 64-bit, also Linux
Reason for the bug
Depending on which country you visit Google, there are different XHR requests for Google Search. With an American IP address, the gs_ri field is needed.
This error could not be followed by me at first, because I have always set up a connection to Google via a German IP address.
We learn from this, that in all bug reports the country from which the page was called must be specified.
Here's the XHR answer, if I'm visiting google with a German IP address:
["ClearURLs is nice",[["clearurls is nice 2017",33,[160],{"a":"clearurls\u0026nbsp;is\u0026nbsp;","b":"nice\u0026nbsp;2017"}]],{"e":"1","i":"ClearURLs is nice","o":"\u003csc\u003eclean urls\u003c\/sc\u003e is nice","p":"\u003cse\u003eClearURLs\u003c\/se\u003e is nice","q":"SwOQbSEsHxIf90h8EuTSox66QTQ","t":{"bpc":false,"tlw":false}}]
And here with an American IP:
)]}'
["ClearURLs is nice",[],{"i":"ClearURLs is nice","o":"\u003csc\u003eclear urls\u003c\/sc\u003e is nice","p":"\u003cse\u003eClearURLs\u003c\/se\u003e is nice","q":"oC8RWJ42cgRrRgsLEBp7TXhVmJQ","t":{"bpc":false,"tlw":false}}]
Solution
I've rewrite the YouTube search exception, to generalize them for the Google search.
Before:
.*(google\\.).*\\/complete\\/search\\?client=youtube.*gs_gbg=[^\\/|\\?|&]*(\\/|&(amp;)?)?
After:
.*(google\\.).*\\/complete\\/search\\?.*gs_[a-zA-Z]*=[^\\/|\\?|&]*(\\/|&(amp;)?)?
A short note on the side
Google needs the hl
field to change the language of the google page. I also added an exception for this case.