12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #!/bin/sh
- set -e
- apply_to_profiles() {
- if [ -n "$(ls ~/.mozilla/firefox/*.default* 2>/dev/null)" ];then
- for dir in ~/.mozilla/firefox/*.default*; do
- cp -v user.js.new "$dir"
- echo "Custom settings applied for profile in ${dir}."
- done
- fi
- if [ -n "$(ls ~/snap/firefox/common/.mozilla/firefox/*.default* 2>/dev/null)" ];then
- for dir in ~/snap/firefox/common/.mozilla/firefox/*.default*; do
- cp -v user.js.new "$dir"
- echo "Custom settings applied for profile in ${dir}."
- done
- fi
- }
- apply_custom_settings() {
-
- cp -v user.js user.js.new
- {
- echo ' user_pref("media.peerconnection.enabled", false);'
- echo ' user_pref("media.navigator.enabled", false);'
- echo ' user_pref("extensions.pocket.enabled", false);'
- echo ' user_pref("privacy.query_stripping.enabled", true);'
- echo ' user_pref("privacy.trackingprotection.enabled", true);'
- echo ' user_pref("browser.safebrowsing.malware.enabled", false);'
- echo ' user_pref("browser.safebrowsing.phishing.enabled", false);'
- echo ' user_pref("javascript.options.wasm", false);'
- echo ''
- echo ' user_pref("browser.display.background_color", "#323232"'
- echo ''
- echo ' user_pref("browser.startup.homepage", "about:blank");'
- echo ' user_pref("security.fileuri.strict_origin_policy", false);'
- }>>user.js.new
-
-
-
-
-
- }
- dir=user.js
- repo="https://github.com/arkenfox/${dir}.git"
- mkdir -p ~/src
- cd ~/src || return
- if [ ! -d "$dir" ]; then
- git clone $repo
- cd "$dir" || return
- apply_custom_settings
- apply_to_profiles
- else
- cd "$dir" || return
- git fetch
- LOCAL=$(git rev-parse HEAD)
- REMOTE=$(git rev-parse @{u})
- if [ ! $LOCAL = $REMOTE ]; then
- pwd
- echo "Need to pull"
- git pull
- apply_custom_settings
- apply_to_profiles
- else
- echo "no update needed"
- fi
- fi
|