-
-
Save marcocspc/39ae0d26760b881a828b95ffc14d4dcc to your computer and use it in GitHub Desktop.
A simple cmdline to set firefox config in all profiles found in $HOME/.mozilla/firefox - useful to disable TRR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # https://blog.ungleich.ch/en-us/cms/blog/2018/08/04/mozillas-new-dns-resolution-is-dangerous/ | |
| # https://askubuntu.com/questions/313483/how-do-i-change-firefoxs-aboutconfig-from-a-shell-script | |
| # | |
| # To completely disable sending your DNS queries to cloudflare: | |
| # | |
| # ff_set network.trr.mode 5 | |
| # | |
| # Directories in which "find" command will search for | |
| # config files. This value covers default | |
| # firefox installation and snap one. | |
| DIRS_LIST="$HOME/.mozilla/firefox $HOME/snap/firefox/common/.mozilla/firefox $HOME/snap/firefox/common/.cache/mozilla/firefox $HOME/.var/app/org.mozilla.firefox/.mozilla/firefox" | |
| # You will need to restart firefox to apply the config. | |
| # To do it run: | |
| # killall firefox && nohup firefox > /dev/null & | |
| ################ Script ################ | |
| for profile in `find $DIRS_LIST -maxdepth 1 -type d -name \*.default*`; do | |
| if [ -f $profile/prefs.js ]; then | |
| echo "Setting option $* in $profile/prefs.js" | |
| sed -i 's/user_pref("'$1'",.*);/user_pref("'$1'",'$2');/' $profile/prefs.js | |
| grep -q $1 $profile/prefs.js || echo "user_pref(\"$1\",$2);" >> $profile/prefs.js | |
| fi | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update script to cover firefox snap installation and add a few more instructions on how this works.