-
Notifications
You must be signed in to change notification settings - Fork 523
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
Ideas for Android (how to inject the config files) #318
Comments
http://codeverge.com/mozilla.support.firefox/why-would-mozilla-developers-disallow/2044673 |
@Thorin-Oakenpants but many users use non-rooted phone. %99 of user.js preferences are about privacy and you are telling me to use sync (the cloud thing) ? :) There should be tricks to change the preferences. The only way is not to use user.js file. For example: 1- we can try to write user-script for Greasemonkey or violentmonkey which executes a script on about:config page ? 2- remote debugging about:config page from destkop firefox ? 3- execute a javascript from url-bar (like bookmarklet) ? Or any other tricks/ideas? Thank you |
2 - Android has strict permissions and a single user by default. |
I try remote debugging from my desktop Firefox. I did not installed any extension or ADB on my operating system. It is very easy to debug remote android. I write a simple javascript to execute on about:config page. I tested it. I write it here. maybe someone will need it.
|
@Thorin-Oakenpants yes it works. I tested it. First you start remote debugging from desktop Firefox (without any extension or Android-SDK). Desktop Firefox has build-in WebIDE module. After you connect to android firefox app, you go to about:config page. You can also inject a script to a web page that opened from Android. Copy my script, also copy your userjs file below it, and execute whole script to android firefox. I am using:
"only take the active ones?" --> I don't know if I understand your question exactly. But I see this: If I will call my user_pref method with any parameter it works. I mean If I have "media.navigator.this.pref.is.not.exist" it works. But does it matters ? Who cares if I have a pref which is not using by anyone?... I think this topic should be clearly documented. Mobile privacy is more terrible status than Desktop. |
👍 Android [Generic] |
I didn't mean that as title, but as an idea that a wiki page for non-rooted devices only seems limited IMHO |
I managed to set some Firefox preferences on my non-root Android using TerkiKerel's javascript. It is straight forward, but not entirely obvious at first. Here are some notes which might help towards an Android wiki page. Using remote debugging to inject user.js preferences to Android Firefox1) Choose a) Wi-Fi (easier) or b) USB connection1a) Connecting Firefox on your Desktop Computer and Android Device via Wi-Fimozilla - Debugging_Firefox_for_Android_over_Wifi
Troubleshooting, if the device is not seen (note any settings changes for reversal later):
1b) Connecting Firefox on your Desktop Computer and Android Device with a USB cablemozilla - Debugging_Firefox_for_Android_with_WebIDE
Note: to unhide "Developer options" tap "Build number" 7 times (Settings app|About Device) Troubleshooting, if the device is not seen (note any settings changes for reversal later):
2) Remote access
3) Inject the preferences
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 4) Finish
|
May be also worth a mention on a Android wiki page. You can view the prefs you have set on about:support, but if you want to get the contents of prefs.js on non-root Android. Enter into the firefox url address bar: Tap on the prefs.js file and it displays, long press, select all, copy and paste into a text editor type app (such as QuickEdit, etc) for saving. (Note that firefox updates the prefs.js file on app exit so settings made during the current session would not be visible yet.) |
I am rooted but FF wouldn't pick up user.js for some reason. This method worked perfectly. THANK YOU. Suggesting this for rooted: All steps are performed on your Android. |
This doesn't work for now: Tried to prepend it with Is there any way to read/write FF preferences in remote debugging console? |
Did you saw #1147? |
No, thanks a lot! For google: I was able to get and set preferences for Firefox 90.0.3 @ Android staying on about:support page. Related: #1147 (comment) So, no need to live with Firefox Nightly on Android just because of about:config availability. |
Hi,
the new web-extension API does not allow add-ons to edit about:config references. We can change the user.js file on our desktop operating systems. But how we can edit user.js on mobile Android Firefox? We can change them manually from about:config but these takes long time. Also I always reset my settings/or I reset the mobile phone completely. It is difficult to set all these settings from mobile.
It would be great if you have an idea for Android Firefox.
Thank you
The text was updated successfully, but these errors were encountered: