gcarq / inox-patchset

Inox patchset tries to provide a minimal Chromium based browser with focus on privacy by disabling data transmission to Google.
BSD 2-Clause "Simplified" License
364 stars 26 forks source link

Google search engine used in the address bar is not working #118

Open junkedboy opened 6 years ago

junkedboy commented 6 years ago

Google search engine used in the address bar is not working, even if google set as default search engine in browser settings.

Version 62.0.3202.89

xsmile commented 6 years ago

@junked: Which Inox release caused it to stop working?

This is limited to Google's search engine since DuckDuckGo works fine.

0011-add-duckduckgo-search-engine.patch looks good to me and if I remember correctly this is the only place search related settings are modified directly. Maybe this is another effect of a safe-browsing leftover.

junkedboy commented 6 years ago

Which Inox release caused it to stop working?

Sorry, I don't know, cose I'm started to use Inox since version 62.0.3202.89

DuckDuckGo works fine

DDG is a pretty good, but using him is not comfortable for me.

lulcat commented 6 years ago

But is this a bug... isn't the whole point of the search with google in the omnibar thing, based on data being sent to/fro? I also am just building first inox (fork possibly).. so not sure what patches do or if I am mis-understanding the problem.

gcarq commented 6 years ago

@junked What exactly does not work? It is expected behaviour to not get suggestions while typing, but your query should be sent do google once you hit enter (if specified as your search engine ofc)

xsmile commented 6 years ago

@gcarq When typing the search term and pressing enter either nothing happens or another search engine is used.

I tried to find the patch responsible for the bug but I can't reproduce it reliably. After recompiling Chromium with different patches, Google search started working again with my main profile but new profiles use the previously selected search engine if Google is selected last.

EDIT: 0004-disable-google-url-tracker.patch is the cause.

An empty GoogleURLTracker::kDefaultGoogleHomepage[] prevents Google search from working properly. It might be used in some other place but this is strange since the search URLs are/should be located in components/search_engines/prepopulated_engines.json

lulcat commented 6 years ago

Coolio. Just wanted to add Inox is now compiled and I am using it. I haven't used inox before, can only confirm pattern, although it used to be something one wished to disable to avoid data sent (prior to actually sending the query string itself). Hitting enter doesn't send string to any search engine. (I can add, it seems if I hit g: or something, it will select google, yet enter doesn't send string).

edit: if ddg is default it works.. if I do google, I notice it is an issue with the search engine format string I think. (it won't work as default engine indeed), as i think it is somewhat malformed given (y)our other patches. Regardless if google is default or not, spelling the google.com kyeword will turn the search bar into: search google | ...type something here and it automatically disappears, (fails), both if selected as SE or not... Coiuld be a simply syntactical/parsing error but I can't edit it, :/

edit2: ya in chromium, whicever is default, using keyword will launch that keyword's searchurl and works.. same goes for inox except google one.. something got mangled whilst slimming down on the server home calling. ,)

edit 3: FIXED... ok, thanks to poster above the patch, it is clear from the deleted NOTES, what is going wrong.

const char GoogleURLTracker::kDefaultGoogleHomepage[] =

With that said.. one could implement a custom inox flag to pass on launchup, to choose the desired google-page (google.com,google.cn,google.co.uk, etc). This would in fact be how inox does want it, and I forgot (since I am a new inox user) but inox iirc whilst building does in fact add the custom flag comptability, right? If so, it's all good! :dagger:

lulcat commented 6 years ago

Also... whislt I'm at it, shouldn't "multiple_routes_enabled": false be set in default;preferences?

no one using inox, (or anyone else) should really want their f***ing local lan ip on the interwebs... Instead of searching how to disable it, they should rather search how to enable it. [The expletive was not aimed at inox bloke who is a champ for making this stuff!! :D, just bad countries' corps etc. ;p)

for those wondering. $EDITOR ~/.config/inox/name_of_your_profile_orDefault_but_should_be_in_default_so_all_new_profiles_also_have_it/Preferences add between the final two }} if you don't haveit already in the string: ,"webrtc":{"multiple_routes_enabled":false}

xsmile commented 6 years ago

Search engines URLs are defined in components/search_engines/prepopulated_engines.json but Google search uses a template ({google:baseURL}) to query the URL from another place which seems to be kDefaultGoogleHomepage defined in components/google/core/browser/google_url_tracker.cc.

We can leave kDefaultGoogleHomepage in place or we can replace the template string with the URL.

@gcarq Maybe you have another idea?

lulcat commented 6 years ago

xsmile.. since it is the google engine, it has to have some default string for google.com... which is .. namely google.com . Since, I didn't want to rebuild AGAIN :p , I did this for now mv /usr/bin/inox{,bin} and then cat /usr/bin/inox inox.bin --google-base-url="https://www.google.kp/" "$*"

google.kp can be google.com/google.tw google.cn google.ru whatever a user wishes to use, but the patch incorrectly removes the baseUrl.. Removing it does nothing for security/privacy, as it is simply a necessary google url for the google engine. : For someone not wishing to use google.com, they simply use another engine. (also, I recommend another default keyword for google, e.g. just 'g' , rather than google.com as set in inox.. since the keywords are just a preset 'hotkey' for the engine. (I use g for google, d for duckduckgo, etc.).

xsmile commented 6 years ago

@lulcat I am well aware of the issue and the cause of it has been discovered 13 days ago.

Not placing a static Google URL in prepopulated_engines.json means the URL is most probably used in other places to connect to Google for whatever reasons, which we want to avoid and which is why it is removed by Inox in the first place.

Removing it does nothing for security/privacy

How did you come to this conclusion?

Eloston commented 6 years ago

@xsmile To make everyone happy, we could leave the GoogleURLTracker patch alone and add a new patch. The new patch can modify the code substituting {google:baseURL} to read a command-line argument (like --google-base-url). If the flag's not present, the substitution can be made blank or set to google.com

EDIT: Actually it won't make you or I any happier because it's another patch to maintain... EDIT2: If I'm not mistaken, setting the base URL manually just allows the user to force a specific region. Using google.com will still redirect to a different region depending on the user's IP address (and possibly browser locale)

xsmile commented 6 years ago

@Eloston Another possibility is to track down all usages of kDefaultGoogleHomepage and disable them but this would be even more work. I didn't test it, but replacing {google:baseURL} with google.com should work the way you described.

lulcat commented 6 years ago

@Eloston: I currently , as mentioned above define the google-base-url manually as a flag, I am taken to that, irrespective of my location. @xsmile .. I am not on the install at this very moment, and can't check nor do I have the source to check, so it could be that kDefaultGoogleHomepage is [ab]used somewhere else.. but as I said, it cannot be empty if a user wishes to use the google search engine... I would put it back in as it's necessary, add a note on how a user can use a wrapper / flag to set it on launch as I described above, and finally grep the source for where it might be used elsewhere if you feel it might be. (I didn't check but maybe tomorrow if I have time , I can pull the source again and look if it has other privacy issues. But it has to be set in code or by user, if google search engine wishes to be functional in inox. The g instead of google.com as a hotkey for making google work in the searchbar was just a common hotkey people used for years .. I have duckduckgo as default (but I use d or ddg as the hotkey, and g for google). typing google.com for each time one wishes to hit google, will make a user more likely to switch to google.. that was the only reason for that tip.. :)

Eloston commented 6 years ago

Just a note: I think that resolving this issue will fix the crashes of #126.

xsmile commented 6 years ago

During my tests with a clean browser profile Chromium queried some Google URLs if kDefaultGoogleHomepage was set, meaning the patch in its current form still serves its purpose. I don't know which file is responsible for these requests yet.

However, leaving kDefaultGoogleHomepage empty and putting a static URL for Google search in prepopulated_engines.json is not enough since kDefaultGoogleHomepage seems to be needed in other parts of the browser.

Eloston commented 6 years ago

However, leaving kDefaultGoogleHomepage empty and putting a static URL for Google search in prepopulated_engines.json is not enough since kDefaultGoogleHomepage seems to be needed in other parts of the browser.

You mean in other search-related components, or entirely different components?

xsmile commented 6 years ago

You mean in other search-related components, or entirely different components?

Search-related components for the most part, but not limited to it. I didn't follow up on this yet.

Irvinehimself commented 6 years ago

For me, the symptoms are: When I set Google as the default search engine, it crashes Inox when I open a new tab.

An albeit quick and dirty work around is to use DDG's "Bang" feature to create create a fake search engine with the url: https://duckduckgo.com/!google %s

It's not perfect, but it means I can use the context menu to search Google

All the best Irvine

Edit: I should add that Google search using the keyword feature works fine, It's just trying to make Google the default search engine which causes me problems

d-packs commented 6 years ago

I found a quick and fully working workaround for this issue:

Use a URL shortener to replace https://google.com/search and paste that link into inox search engine settings.

You will need to use a URL shortener that forwards query strings. http://bit.do was the first in my search to offer this feature.

So now you can add a search engine with the following specs (as an example)

Search Engine: Google
Keyword: g
URL: http://bit.do/[----]?q=%s  

Where http://bit.do/[----] is a short URL generated for https://google.com/search [EDIT:] bit.do is painfully slow at times, might be a good idea to look for alternative shorteners. Would be great if there were a real solution to avoid such workarounds. This is the only issue keeping me from using inox as default browser