• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[HOWTO] Custom search engine for Google Chrome Beta for Android

Search This thread

Draygon

Senior Member
Jul 11, 2011
466
94
Hello,

With the newest Google Chrome beta, we sadly still (and probably won't ever) have the feature to add a custom search engine to Google Chrome for Android.

I was looking for a possibility and got it working, with a little problem (mentioned at 6.) someone here hopefully is able to fix.

Now, let the tutorial begin:
What you need:
- Rooted Phone
- File Explorer which is able to get root access, for example: Solid Explorer: https://play.google.com/store/apps/...plorer&feature=nav_result#?t=W251bGwsMSwyLDNd
- Latest Google Chrome Beta for Android: https://play.google.com/store/apps/...biflipde&utm_medium=website&utm_campaign=blog

1. Open Solid Explorer, browse to following directory and file:
"/data/data/com.chrome.beta/app_chrome/Default/Preferences"

2. Open "Preferences" with a text editor

3. Search following entries:
"last_known_google_url"
and
"last_prompted_google_url"

4. I will use DuckDuckGo as example. "https://www.duckduckgo.com/?q=" is the encrypted search string for DuckDuckGo, that's why I'll use this now.

Change from:
"last_known_google_url": "http://www.google.com/"
"last_prompted_google_url": "http://www.google.com/"

To:
"last_known_google_url": "https://www.duckduckgo.com/?q="
"last_prompted_google_url": "https://www.duckduckgo.com/?q="

5. Save it

6. Now, the problem is following:
If you enter a search string in Chrome now, it will use DuckDuckGo for it. That's what we wanted, right?
The search you did for example is "Test123"
But DuckDuckGo is searching for "search?q=Test123"
Google Chrome puts a "search?q=" in front of your search.


Could someone please tell me how to fix this? I'll add it in front to the thread here then and we'll have a solution for our custom search engine in Google Chrome for Android! :)
 
Last edited:

kwurky

Senior Member
Dec 25, 2010
100
21
Is no one interested in this? :(

Just to show my interest, I'm replying to this thread. I want to use DDG as my default as well. I dislike how Google continuously redirects you to the local country page when traveling. Also the fact that SSL searches on Google are blocked in countries that shall not be named.
I haven't tested what you wrote but I'll try it the next chance I get.
 

kwurky

Senior Member
Dec 25, 2010
100
21
Awfully quiet in here. Apparently everyone on XDA using Chrome is satisfied using Google search...of course having options are preferable. At least desktop Chrome allows the default to be changed to a third party engine of our choosing. What gives Google?

Sent from my Nexus 7 using Tapatalk HD
 

Kremata

Senior Member
Dec 26, 2011
1,077
1,269
Montreal-Shanghai
This is the reason i'm not using Chrome, I'm Canadian but I live in China and Chrome keeps redirecting to Honk Kong (freaking annoying). I tried again from the Philippines but now it's redirecting to Php. I tried your solution but it doesn't work. I really think this is a MUST from a web browser. With the other browser I just set my first page to be www.google.com/ncr but we cant even set the fisrt page in Chrome.
 

Draygon

Senior Member
Jul 11, 2011
466
94
I still don't have a solution for this. :(

We have the newest chrome beta 26 now, also a stable version which got a great update so far, but still no possibility for a custom search engine.

Please, is someone able to find a solution for this? I want my duckduckgo integrated into chrome for android. :(
 

kwurky

Senior Member
Dec 25, 2010
100
21
This is the reason i'm not using Chrome, I'm Canadian but I live in China and Chrome keeps redirecting to Honk Kong (freaking annoying). I tried again from the Philippines but now it's redirecting to Php. I tried your solution but it doesn't work. I really think this is a MUST from a web browser. With the other browser I just set my first page to be www.google.com/ncr but we cant even set the fisrt page in Chrome.

Me too. Currently currently in China and being redirected to HK site. Using that NCR trick is the only way. Of course after awhile have to do it again. But this happens on desktop as well so I think it's generally a cookie/time limit problem.

BTW what browser do you use? The cool thing about Chrome right now is you can turn on proxying using Google's servers and you can visit banned websites (e.g. nytimes, etc) over plain http only. Saves time sometimes instead of connecting to VPN for a quick lookup.

Sent from my Nexus 7 using Tapatalk HD
 

steford

Senior Member
Apr 29, 2006
166
26
I still don't have a solution for this. :(

We have the newest chrome beta 26 now, also a stable version which got a great update so far, but still no possibility for a custom search engine.

Please, is someone able to find a solution for this? I want my duckduckgo integrated into chrome for android. :(

Could you perhaps persuade ddg to implement this? If a query string is included then it should search for that instead of the final directory they currently search on.
 

[email protected]

New member
Jul 18, 2013
1
1
new here, sorry cannot post links....

Change the last_known_google_url" to: "https:// w w w . d u c k d u c k g o . c o m / " and not to last_known_google_url": " h t t p s : / / w w w . d u c k d u c k g o . c o m / ?q="
 
  • Like
Reactions: crackd

lesiki

Senior Member
Oct 10, 2011
345
151
Frankfurt
Yes, I am very interested in this. I've been using Firefox for a long time, but it has become very buggy and crashy, and I miss DuckDuckGo on Chrome. I've read somewhere that Chrome's source is available somewhere, I will try to download it tomorrow and change some stuff regarding the search.
 

crazydip

Member
Sep 23, 2010
17
6
I would very much appreciate this feature as well. Wanted to use DuckDuckGo in Chrome Android and though I was blind, but I guess Chrome for Android does not let you use any custom search engine (and I'm sure Google is doing anything they can to not add it as an option).

Sorry for necromancing the thread, but it's still a very important issue IMO.
 

oogrin

Member
Sep 13, 2012
25
1
Skopje
To prevent Chrome from jumping to url of countries you don't want, you can do the following "fix".
1. Go to google.com/ncr
2. Search something, whatever... Test123
3. Kill the app from recents
4. Clear cache
5. Search from the ssearch bar
6. Chrome will ask you if you want to continue using google.com as your default search site or the stupid dot something one...

About the change of search engine, I'm here for that too :)
 
  • Like
Reactions: suomaf

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Easy to fix:
    Code:
    "last_known_google_url": "https://www.duckduckgo.com/&"
    "last_prompted_google_url": "https://www.duckduckgo.com/&"

    Problem was that duckduckgo.com assumes the un-escaped word "search" added by chrome is the search term -- so we turn it into a useless option by adding the "&". Once this is done, duckduckgo correctly looks for the &q string.

    Works for me on beta 36.0.1985.36 :)
    8
    Hello,

    With the newest Google Chrome beta, we sadly still (and probably won't ever) have the feature to add a custom search engine to Google Chrome for Android.

    I was looking for a possibility and got it working, with a little problem (mentioned at 6.) someone here hopefully is able to fix.

    Now, let the tutorial begin:
    What you need:
    - Rooted Phone
    - File Explorer which is able to get root access, for example: Solid Explorer: https://play.google.com/store/apps/...plorer&feature=nav_result#?t=W251bGwsMSwyLDNd
    - Latest Google Chrome Beta for Android: https://play.google.com/store/apps/...biflipde&utm_medium=website&utm_campaign=blog

    1. Open Solid Explorer, browse to following directory and file:
    "/data/data/com.chrome.beta/app_chrome/Default/Preferences"

    2. Open "Preferences" with a text editor

    3. Search following entries:
    "last_known_google_url"
    and
    "last_prompted_google_url"

    4. I will use DuckDuckGo as example. "https://www.duckduckgo.com/?q=" is the encrypted search string for DuckDuckGo, that's why I'll use this now.

    Change from:
    "last_known_google_url": "http://www.google.com/"
    "last_prompted_google_url": "http://www.google.com/"

    To:
    "last_known_google_url": "https://www.duckduckgo.com/?q="
    "last_prompted_google_url": "https://www.duckduckgo.com/?q="

    5. Save it

    6. Now, the problem is following:
    If you enter a search string in Chrome now, it will use DuckDuckGo for it. That's what we wanted, right?
    The search you did for example is "Test123"
    But DuckDuckGo is searching for "search?q=Test123"
    Google Chrome puts a "search?q=" in front of your search.


    Could someone please tell me how to fix this? I'll add it in front to the thread here then and we'll have a solution for our custom search engine in Google Chrome for Android! :)
    3
    2017 update

    Greetings from 2017! I stumbled upon this thread a few days ago because I, too, wanted to use a different search engine on chrome for android. I was partly motivated by Google's horrible AMP ruining my browsing experience. AMP pages are completely unusable on my Nexus 5x. I can't scroll! Wtf Google! Anyway, still, in 2017, it is not possible for the user to add a custom search engine to the browser. In fact, there are only a handful of options to choose from (Google, Ask, Aol, Bing, Yahoo, in United States). The old Preferences file hack no longer works. Well, I didn't want to give up here, so I pulled the Chromium code and figured it out.

    What Google did here is actually rather interesting. There are many more than just the five search engines listed above built into the browser. I counted something like fifty, including different languages (eg Yahoo USA, Yahoo France). I guess Google wanted to make things simple for the user (and hard for people who like to customize) by just pulling a handful of search engines based on the country and language of the phone/user. For the USA, the five listed above are "prepopulated" into the search engines available for the user to choose from and the rest are not shown in the UI. For the curious, DuckDuckGo is not present at all among the search engines.

    So I added it! I modified a few files and got DuckDuckGo working for search in Chromium 58 for Android. I couldn't find a search suggestions service from DuckDuckGo (saw ddgg.nfriedly.com, but it didn't work), so I incorporated Bing's suggestions service. Why Bing? In the code, Google's suggestions setup is really complicated, whereas Bing's was a simple URL. I compared some search suggestion results from Bing and Google and Bing seemed adequate. So when you start a search you get suggestions from Bing, and the search is completed on DuckDuckGo.

    This was a good deal of time and effort (took forever to set up the development environment and around 4 hours to compile Chromium the first time), and I feel accomplished, but sadly I won't be using what I have built. For some reason the Chromium build won't let me sign in to sync with my Google account on my phone. Maybe because the build isn't signed or whatever. I also realized that I still like Google search results better than DDG. I'll just have to go to DDG whenever Google is giving me AMP pages.

    But you guys can use it if you really want DDG in Chrome on Android. If anyone sees this, let me know if you think I should try submitting the code to the Chromium project to see if we can get DDG into people's browsers everywhere! If anyone wants to know more about the specific changes I made in the code, let me know.

    Here's a link to the APK from my Dropbox. Scan it for malware if you want.
    https://www.dropbox.com/s/vr95hm2b0r1lmq8/ChromePublic.apk?dl=0

    Until next time, XDA
    1
    Is no one interested in this? :(
    1
    new here, sorry cannot post links....

    Change the last_known_google_url" to: "https:// w w w . d u c k d u c k g o . c o m / " and not to last_known_google_url": " h t t p s : / / w w w . d u c k d u c k g o . c o m / ?q="