Destroyed 1.6 Firefox Android (markdown)

Thorin-Oakenpants 2021-07-27 19:56:10 +00:00
parent f5d0d63e53
commit d3fafeee15

@ -1,122 +0,0 @@
Authors: Non-Rooted Wiki: [icpantsparti](https://github.com/icpantsparti) and [username-is-not](https://github.com/username-is-not) | Script: [TerkiKerel](https://github.com/TerkiKerel) | Rooted Wiki: [jghq](https://github.com/jghq) | Many thanks :)
:warning: **WARNING**: This `user.js` is **designed for desktop Firefox ONLY**
- Fennec [68 or lower]: some prefs may not apply, or may cause issues, or may be missing
- Fenix / GeckoView [69+]: **DON'T DO IT**❗ FYI: `about:config` is not available on release builds
- [quote](https://old.reddit.com/r/firefox/comments/i51k0q/mozilla_could_turn_on_about_config_and_have/g0n9nn0/)
> - Android is a much different beast than the desktop platforms. *Settings commonly used on desktop may not work the same way that they do on Android!* Those of you who try to copy-paste settings from existing desktop guides will be in for a surprise. And no, its not just obscure settings that might work differently! Some of your more “common” settings may work completely differently, not at all, *or may actually break your Fenix installation!*
> - Fenix uses GeckoView. For GeckoView (the embedding layer) to integrate with Gecko (the rendering engine), some settings must remain set in a specific way, or else Fenix would become completely detached from Gecko. Without losing your profile by reinstalling, *the only way you can undo that is if your phone is rooted!*
### :small_orange_diamond: Rooted
<details><summary>don't do it: click me for details</summary><p>
All steps are performed on your Android.
- Bring up the list of running apps (tap the usually square button) and stop Firefox by swiping it away
- Start your file manager that supports root, such as [Ghost Commander](https://f-droid.org/packages/com.ghostsq.commander/)
- Copy your `user.js` file to your profile folder at:
* `data/data/org.mozilla.firefox/files/mozilla/[random_string].default`
- Set permissions on the file to match other files in the directory
- Start Firefox, go to about:config and confirm `user.js` was recognized. Be sure to check the last line as well, in case processing was stopped in the middle due to some error
- If you delete user.js from your profile directory, the applied settings will remain until you or the application changes them. If you don't delete the file, all settings in the file will be reapplied on each Firefox start.
- If no settings from user.js are applied, follow the Non-Rooted method below
</p></details>
### :small_orange_diamond: Non-Rooted
<details><summary>don't do it: click me for details</summary><p>
Choose `1A` Wi-Fi (easier) or `1B` USB connection
:small_blue_diamond: 1A: Connecting Firefox on your Desktop Computer and Android Device via Wi-Fi
[Mozilla - Debugging_Firefox_for_Android_over_Wifi](https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_over_Wifi)
- Install the ZXing Team Barcode Scanner Android app
- Enable `Remote debugging via Wi-Fi` on Android Firefox (Options|Settings|Advanced)
* You might have to toggle this off/on later if troubleshooting
- On desktop Firefox visit and set true: about:config?filter=`devtools.webide.enabled`
- Open Remote Debugging on desktop Firefox (menu|Tools|Web Developer)
- Click `Refresh Devices` icon (upper right), click on your Android device
- Scan the QR code with your Android to connect
:question: Troubleshooting
If the device is not seen (note any settings changes for reversal later): Visit the troubleshooting link on the Mozilla page for more details.
- Is desktop firewall stopping connection?
- Is Android firewall app stopping connection? (eg NetGuard, No-root firewall, etc)
- Is Network/router settings/firewall stopping connection?
- Desktop needs to be on Wi-Fi too and not wired? (wired can work)
- Desktop Firefox version is too much older than Android Firefox?
:small_blue_diamond: 1B: Connecting Firefox on your Desktop Computer and Android Device with a USB cable
[Mozilla - Debugging_Firefox_for_Android_with_WebIDE](https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE)
- Enable `Remote debugging via USB` on Android Firefox (Options|Settings|Advanced)
- Enable Android's `USB debugging` (Settings app|Developer options)
* You might have to toggle either of these off/on later if troubleshooting.
* Note: to unhide `Developer options` tap `Build number` 7 times (Settings app|About Device)
- Watch out for any Android allow/connect prompts.
- Open Remote Debugging on desktop Firefox (menu|Tools|Web Developer)
- You need to `Enable USB Devices`
* For any issues see below: "Problems connecting to the USB device?" [Troubleshoot](https://developer.mozilla.org/docs/Tools/Remote_Debugging/Debugging_over_USB)
- Click `Refresh Devices` icon, click on your Android device
:question: Troubleshooting
If the device is not seen (note any settings changes for reversal later): Click the troubleshooting link on the Mozilla page for more details.
- Did you plug in your USB cable? ;-D<
- Windows: you might need to install Google USB Driver from Android SDK?
- Linux: you may need a [/etc/udev/rules.d/51-android.rules](https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/android/51-android.rules) file, then restart udev (or reboot)?
- Linux: you might need to install android-tools-adb / adb? (it can work without)
- Desktop Firefox version is too old and not compatible with Android firefox?
:small_blue_diamond: 2: Remote access
- Open `about:support` page on Android Firefox
* It will show under `Tabs` on Desktop Firefox too.
- Click `Inspect` for `about:support` (Tabs) and this will open a new tab `about:devtools-toolbox?id=`
- Select `Console` if not already marked
:small_blue_diamond: 3: Inject the preferences
- Paste the javascript and your `user.js` into the Console
```js
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);
}
}
user_pref("general.aboutConfig.enable", true); // unblock about:config in newer versions (FF71+?)
//paste your user.js file content on the next line
```
- The script sets a function called `user_pref` so wherever that appears in the rest of the code (i.e. in the part from your `user.js`) that function is called to set the user preference. Any code for preferences that are commented out will not be run. If a preference name does not exist or is mistyped it will still be created without any warnings.
- After `Run` (or Ctrl+ENTER) split-screen `Console` view on the right will say "undefined" or show errors.
- if you get a `ReferenceError: user_pref is not defined`, reload about:support on the phone and then run the script again
- If errors occur on a line, the script might have stopped at that line, and you will need to correct the error in the code and re-run.
- Check your Android Firefox `about:support` and `about:config pages` for your modified preferences, and see if the `_user.js.parrot` preference is showing success.
:small_blue_diamond: 4: Finish
- Disconnect: `Disconnect` (top-right)
- For security, reverse settings you temporarily changed in any steps above:
* Android Firefox's debugging off
* Android's USB debugging off (if used)
* Troubleshooting changes (desktop firewall, android firewall, router, etc)
</p></details>