Betterfox icon indicating copy to clipboard operation
Betterfox copied to clipboard

[GUIDE] How to install Betterfox on Android Firefox using adb

Open gunir opened this issue 2 years ago • 31 comments

  1. Install adb: https://www.xda-developers.com/install-adb-windows-macos-linux/

  2. Connect your Android device to your PC using cable, if success you'll be able to see something like this if you type adb devices and Enter: image

  3. Enable Remote Debugging via USB in Android Firefox's Settings: image

  4. From Firefox PC, type about:debugging and Enter, you'll see your Android device in the list, choose Connect: image

  5. And open your device and you'll see all the opening tabs: image

  6. Open about:support in your Firefox Android

  7. Inspect the about:support tab from your Firefox PC, you will see this console screen: image

  8. Paste this code to the console:



var user_pref = function(pref, val){

  try {
    if(typeof val == "string"){

         Services.prefs.setStringPref(pref, val);    
    }
    else if(typeof val == "number"){

         Services.prefs.setIntPref(pref, val);    
    }
    else if(typeof val == "boolean"){

         Services.prefs.setBoolPref(pref, val);    
    }
  } catch(e){
    console.log("pref:" + pref + " val:" + val + " e:" + e);
  }
}
//paste your user.js file content here


  1. Now the final step, copy Betterfox's code, for example Fasterfox and replace //paste your user.js file content here then Enter.

  2. You're done. Check about:config to see result.

This guide was written by a Vietnamese Firefox user with nickname @ndv92, this is the original post: https://voz.vn/t/tong-hop-nhung-addon-chat-cho-firefox-pc-mobile.682181/post-27739740

This Vietnamese thread is surprisingly deep about Firefox, but there's a lot of slangs so Google Translate won't make it.

None was written by me, I just translate it to English, literally.

Thanks for reading, And thank @yokoffing for making and maintaining Betterfox.

gunir avatar Oct 05 '23 07:10 gunir

@gunir Do we check about:config in the browser or the phone? The tab will not load when I check it on my phone, so I can't really tell if it worked. I was able to do all of the steps though.

vonwerderc avatar Oct 15 '23 17:10 vonwerderc

@gunir Do we check about:config in the browser or the phone? The tab will not load when I check it on my phone, so I can't really tell if it worked. I was able to do all of the steps though.

Yes, but you need to use Firefox Beta/Nightly, Stable doesn't allow to open it for some reasons ?

gunir avatar Oct 15 '23 18:10 gunir

Thanks @gunir for posting and translating this mini-guide. Have you tried it yourself? Does it work?

yokoffing avatar Oct 16 '23 16:10 yokoffing

Thanks @gunir for posting and translating this mini-guide. Have you tried it yourself? Does it work?

It worked for me using Firefox beta on Android. It might work on regular firefox, but you can't check about:config to verify.

vonwerderc avatar Oct 16 '23 16:10 vonwerderc

Just wanted to say, it is confirmed and working on Lastest Firefox Beta on Android today. All good!

THEBOSS619 avatar Dec 07 '23 00:12 THEBOSS619

hey code newbie here, I recently managed to set up hardened firefox on my pc ^-^ just ran through this post today and decided to setup hardened firefox on my android phone as well, I followed the steps and used securefox.js on nightly. user above confirmed it was working, I'm not advanced enough to test that but it seems mine worked too ! thanks to all

kuriokurio avatar Dec 14 '23 21:12 kuriokurio

Can we please have this mentioned in the readme somewhere, i wish i would have find this earlier. Thanks for sharing the guide

xd003 avatar Dec 23 '23 14:12 xd003

Can we please have this mentioned in the readme somewhere, i wish i would have find this earlier. Thanks for sharing the guide

How about writing a wiki post ?

https://github.com/yokoffing/Betterfox/wiki

gunir avatar Dec 24 '23 12:12 gunir

Can we please have this mentioned in the readme somewhere, i wish i would have find this earlier. Thanks for sharing the guide

How about writing a wiki post ?

https://github.com/yokoffing/Betterfox/wiki

Will work but i was thinking we could rather a have a Betterfox user.js specifically for Android itself. Since not all the flags from desktop are present on Android, moreover there could be certain Android specific flags which could be benefited from.

xd003 avatar Dec 25 '23 10:12 xd003

Since not all the flags from desktop are present on Android, moreover there could be certain Android specific flags which could be benefited from.

So far so good from what I've tested, using the base user.js on Firefox Android only improves speed and battery life, which is great because telemetry can be very battery hungry.

I've seen no issues.

gunir avatar Dec 26 '23 04:12 gunir

Still works in 2024 on Firefox Beta. Hope this gets picked up by the dev and turns official

Zachary-Luckman avatar Mar 07 '24 01:03 Zachary-Luckman

I can't get this to work in Firefox beta, dunno if something changed recently but for every line in the user.js it outputs "Services is not defined". I imagine a simple edit to the script could make it work again but I don't know enough about Firefox to find out what to change

Edit: same with firefox nightly

tailwhipstruggle avatar Jun 16 '24 06:06 tailwhipstruggle

I can't get this to work in Firefox beta, dunno if something changed recently but for every line in the user.js it outputs "Services is not defined". I imagine a simple edit to the script could make it work again but I don't know enough about Firefox to find out what to change

Edit: same with firefox nightly

Make sure you run it on about:support page, just need to do exactly as the guide, it's pretty much the most informative guide already, nothing much can be improved.

gunir avatar Jun 16 '24 07:06 gunir

Fennec from Fdroid allows about:config and also it's based on Firefox stable, not beta or nightly. Update comes a week or so later than Firefox. But this could be used for this? I haven't tested yet..

iHarryPotter178 avatar Jun 27 '24 05:06 iHarryPotter178

Fennec from Fdroid allows about:config and also it's based on Firefox stable, not beta or nightly. Update comes a week or so later than Firefox. But this could be used for this? I haven't tested yet..

I'm using this on Fennec, it works on Mull and SmartCookieWeb, Waterfox.

gunir avatar Jun 27 '24 13:06 gunir

Fennec from Fdroid allows about:config and also it's based on Firefox stable, not beta or nightly. Update comes a week or so later than Firefox. But this could be used for this? I haven't tested yet..

I'm using this on Fennec, it works on Mull and SmartCookieWeb, Waterfox.

I just tested it on fennec, and it works. Now we need a adapted mobile version of betterfox.

iHarryPotter178 avatar Jun 27 '24 14:06 iHarryPotter178

Steps for rooted phones so they don't have to use adb: Use a root file explorer and navigate to /data/data/org.mozila.fenix/files/mozilla/"your profile name" and place the user.js there. You can then tweak it to your desire, force stop Firefox, and you're done.

Eula13 avatar Aug 23 '24 21:08 Eula13

Completely off topic. This guide serves a very clear and singular purpose.

If you want tonearm brownie points, create a new thread with step by step for root which is more or less the same as Windows, just different file paths but some general location

SyCoREAPER avatar Aug 23 '24 23:08 SyCoREAPER

Completely off topic. This guide serves a very clear and singular purpose.

If you want tonearm brownie points, create a new thread with step by step for root which is more or less the same as Windows, just different file paths but some general location

don't want to add clutter to issues, not completely off topic just offers a really simple alternative way if you have a rooted phone.

Eula13 avatar Aug 24 '24 08:08 Eula13

Completely off topic. This guide serves a very clear and singular purpose.

If you want tonearm brownie points, create a new thread with step by step for root which is more or less the same as Windows, just different file paths but some general location

don't want to add clutter to issues, not completely off topic just offers a really simple alternative way if you have a rooted phone.

I understand where you're going with that thought train but your comment will just get lost in the clutter. A new thread and earning credit for it I think is appropriate in the situation.

SyCoREAPER avatar Aug 24 '24 08:08 SyCoREAPER