yokoffing / Betterfox

Firefox user.js for speed, privacy, and security. Your favorite browser, but better.
MIT License
6.22k stars 153 forks source link

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

Open gunir opened 1 year ago

gunir commented 1 year ago
  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



10. Now the final step, copy Betterfox's code, for example [Fasterfox](https://raw.githubusercontent.com/yokoffing/Betterfox/main/Fastfox.js) and replace `//paste your user.js file content here` then Enter.

11. 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.
vonwerderc commented 1 year ago

@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.

gunir commented 1 year ago

@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 ?

yokoffing commented 1 year ago

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

vonwerderc commented 1 year ago

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.

THEBOSS619 commented 12 months ago

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

kuriokurio commented 11 months ago

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

xd003 commented 11 months ago

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

gunir commented 11 months ago

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

xd003 commented 11 months ago

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.

gunir commented 11 months ago

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.

Zachary-Luckman commented 9 months ago

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

tailwhipstruggle commented 5 months ago

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

gunir commented 5 months ago

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.

iHarryPotter178 commented 5 months ago

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..

gunir commented 5 months ago

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.

iHarryPotter178 commented 5 months ago

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.

Eula13 commented 3 months ago

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.

SyCoREAPER commented 3 months ago

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

Eula13 commented 3 months ago

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.

SyCoREAPER commented 3 months ago

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.

iHarryPotter178 commented 3 months ago

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.

does it actually work? i tried it in fennec and mull, but can't tell if it's doing anything, even after looking at the about:config..how to verify it's working on?

Eula13 commented 3 months ago

does it actually work? i tried it in fennec and mull, but can't tell if it's doing anything, even after looking at the about:config..how to verify it's working on?

I use firefox nightly and verified using about:config by doing a comparison on user js and about:config

RaflIsLife commented 2 months ago

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.

does it actually work? i tried it in fennec and mull, but can't tell if it's doing anything, even after looking at the about:config..how to verify it's working on?

I had the same issue, and managed to fix it. The way to do this is by changing the chmod permission to 777 for user.js