summaryrefslogtreecommitdiff
path: root/sh/ujs
blob: 76d85db42313d00d1a7df0d08c50ba5926026acc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

file="$HOME/.mozilla/firefox/xxxxxxxx.fly/user-overrides.js"
while getopts rw opt; do
	case $opt in
		r)
			if grep -q '^//user_pref("privacy.resistFingerprinting", false);$' "$file"; then
				# if want to abstract into a function, this maybe useful: sed -i "s#^//\\($1\\)\$#\\1#" "$file"
				sed -i 's#^//\(user_pref("privacy.resistFingerprinting", false);\)$#\1#' "$file"
				notify-send -u critical 'RFP disabled'
			else
				sed -i 's#^\(user_pref("privacy.resistFingerprinting", false);\)$#//\1#' "$file"
				notify-send 'RFP enabled'
			fi
			;;
		w)
			if grep -q '^//user_pref("webgl.disabled", false);$' "$file"; then
				sed -i 's#^//\(user_pref("webgl.disabled", false);\)$#\1#' "$file"
				# note webgl is enabled by uncomment, but RFP is disabled by uncomment
				notify-send -u critical 'webgl enabled'
			else
				sed -i 's#^\(user_pref("webgl.disabled", false);\)$#//\1#' "$file"
				notify-send 'webgl disabled'
			fi
			;;
		\?)exit 1;;
	esac
done
upd -j
o "$BROWSER"