News for hackers. Stuff that matters.
Re:Give Firefox a chance by the_pwner224 on Sunday June 23, 2019 @02:33PM (#20257698)
For about:config, I put all my rules in a user.js file. Make that file in a synced folder (Dropbox, Nextcloud, Syncthing, etc.), go to your FF profile folder, and in there make a symlink to the actual synced user.js.

http://kb.mozillazine.org/User.js_file

Alternatively every about:config option has a corresponding option that enables sync for it. But that gets messy with many options.

https://superuser.com/questions/466291/firefox-sync-aboutcon...

Re:Give Firefox a chance by dngray on Sunday June 23, 2019 @11:18PM (#20260197)
> For about:config, I put all my rules in a user.js file. Make that file in a synced folder (Dropbox, Nextcloud, Syncthing, etc.), go to your FF profile folder, and in there make a symlink to the actual synced user.js.

That's exactly what I did, except I just forked the ghacks-user.js user.js file with the changes I needed

I then made a desktop branch, and an android branch.

https://github.com/dngray/ghacks-user.js/tree/fx-desktop

https://github.com/dngray/ghacks-user.js/tree/fx-android

The main reason I'll never use Chrome is because on Android that means no extensions whatsoever, meaning I'd have to give up uBlock and uMatrix. It's also why I wouldn't buy an iPhone (Firefox on iOS isn't allowed to have extensions).

A user.js file can be deployed on Android https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.6-Fire... (I use the non-rooted instructions).

On my desktop I have it hooked in with my bootstrap script. I use Yadm https://yadm.io/

    #!/usr/bin/env bash

    firefox() {
        local -n branches=$1
        local b p d="$XDG_CONFIG_HOME"/firefox/ghacks-user.js

        for p in "${!branches[@]}"
        do
            b=${branches["$p"]}
            printf 'Configuring "%s" on "%s"\n' "$p" "$b"
            ln -sf "$XDG_CONFIG_HOME"/firefox/chrome/userChrome.css ~/.mozilla/firefox/"$p"/chrome/userChrome.css
            git --git-dir="$d/.git" --work-tree="$d" checkout "$b" &&
            cp "$d/user.js" ~/.mozilla/firefox/"$p"/user.js
        done
    }
The function takes in an array:

    firefox_data_path="mozilla/firefox.json"
    declare -A fx_profiles

    while read -r profile; read -r branch; do
        fx_profiles[$profile]=$branch
    done < <(jq -r '.[] | .profile, .branch' "$template_data_path/$firefox_data_path")

    firefox fx_profiles
Which simply reads in a bunch of profiles and what branch they are supposed to be from a json file:

    [
      {
        "profile": "user.default",
        "branch": "fx-desktop"
      }
    ]