Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gunir opened this issue Oct 5, 2023 · 23 comments
Open

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

gunir opened this issue Oct 5, 2023 · 23 comments
Labels
documentation Improvements or additions to documentation

Comments

@gunir
Copy link

gunir commented Oct 5, 2023

  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.

@vonwerderc
Copy link

@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
Copy link
Author

gunir commented Oct 15, 2023

@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
Copy link
Owner

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

@vonwerderc
Copy link

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.

@yokoffing yokoffing added the documentation Improvements or additions to documentation label Oct 17, 2023
@THEBOSS619
Copy link

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

@kuriokurio
Copy link

kuriokurio commented Dec 14, 2023

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
Copy link

xd003 commented Dec 23, 2023

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

@gunir
Copy link
Author

gunir commented Dec 24, 2023

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
Copy link

xd003 commented Dec 25, 2023

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
Copy link
Author

gunir commented Dec 26, 2023

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
Copy link

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

@tailwhipstruggle
Copy link

tailwhipstruggle commented Jun 16, 2024

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
Copy link
Author

gunir commented Jun 16, 2024

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
Copy link

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
Copy link
Author

gunir commented Jun 27, 2024

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
Copy link

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
Copy link

Eula13 commented Aug 23, 2024

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
Copy link

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
Copy link

Eula13 commented Aug 24, 2024

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
Copy link

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
Copy link

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
Copy link

Eula13 commented Aug 26, 2024

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests