How to change the search provider for Firefox OS phones from Bing to Google

Peter Rukavina

One of the great things about having the source code to your phone’s operating system is that you can change your phone’s behaviour in ways you wouldn’t be able to otherwise.

For example, on my Geeksphone Peak the default search provider in the browser is Bing. I’d like to switch this to Google because I like Google’s search results better. Currently this isn’t a user-configurable option in the phone’s settings (although this might change soon), but it’s possible to change nonetheless.

It turns out to be relatively simple to do this, at least once you’ve got a workflow set up to build Gaia, the Firefox OS user interface. In the source tree for you’ve grabbed from github, find and edit the file gaia/apps/browser/js/browser.js and change:

DEFAULT_SEARCH_PROVIDER_URL: 'm.bing.com',
DEFAULT_SEARCH_PROVIDER_TITLE: 'Bing',
DEFAULT_SEARCH_PROVIDER_ICON: 'http://bing.com/favicon.ico',

to:

DEFAULT_SEARCH_PROVIDER_URL: 'www.google.com',
DEFAULT_SEARCH_PROVIDER_TITLE: 'Google',
DEFAULT_SEARCH_PROVIDER_ICON: 'https://www.google.com/favicon.ico',

Then simply build (./build.sh gaia) and flash (./flash.sh gaia) Gaia to the phone. After the flash is complete, you should find the default search is now Google.com:

Firefox OS with Google as Default Search

Comments

Submitted by UBi on

Permalink

Since it’s all HTML/CSS/JS: shouldn’t it suffice to transfer the browser zip file to your desktop computer, unzip it, modify browser.js, re-zip it, and put it back in place? Rebuilding and flashing complete gaia seems like huge overhead to me.

Submitted by Mathieu on

Permalink

Thanks for posting this. I’m new to FirefoxOS (and the android-ish adb stuff), but the following worked for me:

adb pull /system/b2g/webapps/browser.gaiamobile.org/applica…

After decompressing the file, the confs are in ./js/browser.js as you mentioned, but it seems to get compiled into ./gaia_build_defer_index.js, so I had to change both.

Then re-zip to push back:

adb remount
adb push application.zip /system/b2g/webapps/browser.gaiamobile.org/applica…
adb reboot

Diclaimer: I am just randomly poking around FirefoxOS, use at your own risk :)

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). You can subscribe to an RSS feed of posts, an RSS feed of comments, or receive a daily digests of posts by email.

Search