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

Search This thread

owenjm

Senior Member
Dec 8, 2010
76
22
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 :)
 

Demonyc

Member
Jun 13, 2010
17
0
Worked perfectly for me! Smart thinking, my man.

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 :)
 

7175

Senior Member
Feb 6, 2013
309
481
Really glad I found this thread. This makes chrome a usable browser for me. I appreciate the performance of chrome but didn't like being stuck with the stock search engines. Thanks a bunch OP and owenjm.

For anyone interested, here's some code you can copy and paste into terminal emulator to change the search engine to duckduckgo.

Code:
p='/data/data/com.chrome.beta/app_chrome/Default/Preferences'
awk '/last_known_google_url/ {sub(/google.com\//,"duckduckgo.com/\\&")}; {print}' ${p} > $p.bak
awk '/last_prompted_google_url/ {sub(/google.com\//,"duckduckgo.com/\\&")}; {print}' ${p}.bak > ${p}
 
Last edited:
  • Like
Reactions: Hashbang173

aeg3d

Member
Oct 29, 2016
13
2
Would it be possible to do this for the Yahoo or Bing searches instead?

Just go into settings, those search engines are pre-installed

---------- Post added at 05:23 PM ---------- Previous post was at 05:20 PM ----------

Anyone know how to do this on current Chrome/Chrome Beta builds? This technique no longer works, the strings "last_known_google_url" and "last_prompted_google_url" are no longer in the Preferences file, or in any of the other files I could find within /data/data/com.chrome.beta/
 

mwilliaams

Member
Oct 7, 2014
7
4
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
 

Racer159

New member
Jun 6, 2010
1
0
I've been waiting for this!

This is awesome! Thank you for putting this together, and yes if you can submitting the code to the Chromium project would be great as well! I don't sync settings with chrome, so I can't really test that, but for everything else, that APK works like a charm. :)

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.

Until next time, XDA
 

AchillesTheGod

Senior Member
Mar 28, 2014
304
45
25
I'm interested. If I change the default to encrypted.google.com in theroy it will get rid of Google Amp. But I want someone to try it before I Root my Pixel.

---------- Post added at 10:03 PM ---------- Previous post was at 09:55 PM ----------

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

I hear if you can get the default chrome app to search with encrypted.google.com it won't use amp
 

AchillesTheGod

Senior Member
Mar 28, 2014
304
45
25
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
I figured it out!! Sync is very important to me as well. Because I have a Google Home and Chromebook Pixel.
But I hate Amp. Because articles comments never work. So to disable amp.

1. Go to encrypted.google.com
2. Search something using encrypted.google.com
3. Go to chrome > settings > search engine.
4. You will see this recently visited.
5. Switch it to default.
6. Now whenever you load searches. AMP will be disabled.

However. I use the pixel launcher. And I'm still trying to get articles to not load amp when using "The Feed"
 

Attachments

  • Screenshot_20170826-150829.png
    Screenshot_20170826-150829.png
    100.7 KB · Views: 124

kekistaneerefugee

Senior Member
Jul 10, 2017
142
38
I figured it out!! Sync is very important to me as well. Because I have a Google Home and Chromebook Pixel.
But I hate Amp. Because articles comments never work. So to disable amp.

1. Go to encrypted.google.com
2. Search something using encrypted.google.com
3. Go to chrome > settings > search engine.
4. You will see this recently visited.
5. Switch it to default.
6. Now whenever you load searches. AMP will be disabled.

However. I use the pixel launcher. And I'm still trying to get articles to not load amp when using "The Feed"

Is this something new in the APK? I'm using version 49.xxx from before the download manager was included in chrome and cant get additional search engines to show up like that :/ I would love to get rid of amp links but cant deal with that download manager.
 

AchillesTheGod

Senior Member
Mar 28, 2014
304
45
25
Is this something new in the APK? I'm using version 49.xxx from before the download manager was included in chrome and cant get additional search engines to show up like that :/ I would love to get rid of amp links but cant deal with that download manager.

encrypted.google.com wont show up as a option in the settings until you use it at least once. follow the instructions exactly in order

also i discovered way to get amp to stop working completely even in The Feed on the pixel launcher. install Samsung browser from the playstore. i also installed Samsung sync on my chromebooks from the playstore and on my Alienware Desktop chrome browser so my bookmarks are still synced. then i when on my Google Pixel and in settings then apps i disabled chrome completely. using google as my default search engine on the Samsung browser also makes sure my Google Home and Google Assistant still records my data for advertising and other personal search results the samsung browser is faster and more feature packed with adblocker extensions and secret mode with allows for bookmarking sites even if youre incognito and its password protected
 

kekistaneerefugee

Senior Member
Jul 10, 2017
142
38
encrypted.google.com wont show up as a option in the settings until you use it at least once. follow the instructions exactly in order

also i discovered way to get amp to stop working completely even in The Feed on the pixel launcher. install Samsung browser from the playstore. i also installed Samsung sync on my chromebooks from the playstore and on my Alienware Desktop chrome browser so my bookmarks are still synced. then i when on my Google Pixel and in settings then apps i disabled chrome completely. using google as my default search engine on the Samsung browser also makes sure my Google Home and Google Assistant still records my data for advertising and other personal search results the samsung browser is faster and more feature packed with adblocker extensions and secret mode with allows for bookmarking sites even if youre incognito and its password protected


Not an option in my version of chrome. I couldn't get duckduckgo to show up either, its probably something implemented in a newer apk.
 

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="
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone