@@ -8,7 +8,7 @@ if grep -q "SAMEORIGIN" "${FILE}" >/dev/null 2>&1; then
88 cp " $FILE " " $FILE -"
99 OLD=" add_header X-Frame-Options 'SAMEORIGIN';"
1010 NEW=" add_header Content-Security-Policy \" frame-ancestors 'self' https://connect.myunraid.net/\" ;"
11- sed -i " s# ${OLD} # ${NEW} # " " ${FILE} "
11+ sed -i " s/ ${OLD} / ${NEW} / " " ${FILE} "
1212 NGINX_CHANGED=1
1313fi
1414
@@ -43,13 +43,22 @@ if [ -f "${FILE}" ] && grep -q "top.Shadowbox" "${FILE}" >/dev/null 2>&1; then
4343fi
4444
4545# Relax restrictions on built-in Firefox
46- FILE=/usr/share/mozilla/firefox/9n35r0i1.default/user.js
47- if [ -f " $FILE " ]; then
48- cp -f " $FILE " " $FILE -"
49- # Append settings if they don't exist
50- grep -q " privacy.firstparty.isolate" " $FILE " || echo ' user_pref("privacy.firstparty.isolate", false);' >> " $FILE "
51- grep -q " javascript.options.asmjs" " $FILE " || echo ' user_pref("javascript.options.asmjs", true);' >> " $FILE "
52- grep -q " javascript.options.wasm" " $FILE " || echo ' user_pref("javascript.options.wasm", true);' >> " $FILE "
46+ FIREFOX_DIR=/usr/share/mozilla/firefox
47+ # Find the default profile directory (may change in future versions)
48+ PROFILE_DIR=$( find " $FIREFOX_DIR " -name " *.default" -type d 2> /dev/null | head -n 1)
49+
50+ if [ -z " $PROFILE_DIR " ]; then
51+ echo " Firefox default profile directory not found, skipping Firefox configuration"
52+ else
53+ FILE=" $PROFILE_DIR /user.js"
54+ if [ -f " $FILE " ]; then
55+ cp -f " $FILE " " $FILE -"
56+ # Append settings if they don't exist
57+ grep -q " privacy.firstparty.isolate" " $FILE " || echo ' user_pref("privacy.firstparty.isolate", false);' >> " $FILE "
58+ grep -q " javascript.options.asmjs" " $FILE " || echo ' user_pref("javascript.options.asmjs", true);' >> " $FILE "
59+ grep -q " javascript.options.wasm" " $FILE " || echo ' user_pref("javascript.options.wasm", true);' >> " $FILE "
60+ echo " Updated Firefox preferences in $FILE "
61+ fi
5362fi
5463
5564# Move settings on flash drive
0 commit comments