From b18027ec440ce5974a3fd3c3824aea191c33a31f Mon Sep 17 00:00:00 2001 From: Jocelyn Le Sage Date: Fri, 7 Oct 2022 21:14:02 -0400 Subject: [PATCH] Disable the privacy notice page on first start. --- rootfs/defaults/prefs.js | 2 ++ rootfs/etc/cont-init.d/55-firefox.sh | 4 ++++ ...set-prefs-from-env.sh => 56-firefox-set-prefs-from-env.sh} | 0 rootfs/startapp.sh | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 rootfs/defaults/prefs.js rename rootfs/etc/cont-init.d/{55-firefox-set-prefs-from-env.sh => 56-firefox-set-prefs-from-env.sh} (100%) diff --git a/rootfs/defaults/prefs.js b/rootfs/defaults/prefs.js new file mode 100644 index 0000000..442c540 --- /dev/null +++ b/rootfs/defaults/prefs.js @@ -0,0 +1,2 @@ +// Disable the privacy notice page. +user_pref("toolkit.telemetry.reportingpolicy.firstRun", false); diff --git a/rootfs/etc/cont-init.d/55-firefox.sh b/rootfs/etc/cont-init.d/55-firefox.sh index 5adde96..1d8b721 100755 --- a/rootfs/etc/cont-init.d/55-firefox.sh +++ b/rootfs/etc/cont-init.d/55-firefox.sh @@ -6,6 +6,7 @@ set -u # Treat unset variables as an error. # Make sure some directories are created. mkdir -p /config/downloads mkdir -p /config/log/firefox +mkdir -p /config/profile # Generate machine id. if [ ! -f /etc/machine-id ]; then @@ -13,6 +14,9 @@ if [ ! -f /etc/machine-id ]; then cat /proc/sys/kernel/random/uuid | tr -d '-' > /etc/machine-id fi +# Copy default preferences. +[ -f /config/profile/prefs.js ] || cp /defaults/prefs.js /config/profile/prefs.js + # Verify the size of /dev/shm. SHM_SIZE_MB="$(df -m /dev/shm | tail -n 1 | tr -s ' ' | cut -d ' ' -f2)" if [ "$SHM_SIZE_MB" -eq 64 ]; then diff --git a/rootfs/etc/cont-init.d/55-firefox-set-prefs-from-env.sh b/rootfs/etc/cont-init.d/56-firefox-set-prefs-from-env.sh similarity index 100% rename from rootfs/etc/cont-init.d/55-firefox-set-prefs-from-env.sh rename to rootfs/etc/cont-init.d/56-firefox-set-prefs-from-env.sh diff --git a/rootfs/startapp.sh b/rootfs/startapp.sh index 05d18c9..0140226 100755 --- a/rootfs/startapp.sh +++ b/rootfs/startapp.sh @@ -4,6 +4,6 @@ set -e # Exit immediately if a command exits with a non-zero status. set -u # Treat unset variables as an error. export HOME=/config -mkdir -p /config/profile + /usr/bin/firefox --version exec /usr/bin/firefox --profile /config/profile --setDefaultBrowser >> /config/log/firefox/output.log 2>> /config/log/firefox/error.log