From d57814169ae818480bc12bb282bb79d6bb9b9ef5 Mon Sep 17 00:00:00 2001 From: Ryan Kuba Date: Wed, 25 Jan 2023 16:54:14 +0000 Subject: [PATCH] KASM-3936 update firefox to use default maximize loop and strip out launch messages --- src/ubuntu/install/firefox/custom_startup.sh | 22 +++++++++++-------- src/ubuntu/install/firefox/install_firefox.sh | 9 +++++++- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/ubuntu/install/firefox/custom_startup.sh b/src/ubuntu/install/firefox/custom_startup.sh index b283439..943d5dd 100644 --- a/src/ubuntu/install/firefox/custom_startup.sh +++ b/src/ubuntu/install/firefox/custom_startup.sh @@ -2,7 +2,10 @@ set -ex START_COMMAND="firefox" PGREP="firefox" -DEFAULT_ARGS="-width ${VNC_RESOLUTION/x*/} -height ${VNC_RESOLUTION/*x/}" +export MAXIMIZE="true" +export MAXIMIZE_NAME="Mozilla Firefox" +MAXIMIZE_SCRIPT=$STARTUPDIR/maximize_window.sh +DEFAULT_ARGS="" ARGS=${APP_ARGS:-$DEFAULT_ARGS} options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit @@ -35,13 +38,14 @@ kasm_exec() { URL=$OPT_URL elif [ -n "$1" ] ; then URL=$1 - fi - - # Since we are execing into a container that already has the browser running from startup, - # when we don't have a URL to open we want to do nothing. Otherwise a second browser instance would open. + fi + + # Since we are execing into a container that already has the browser running from startup, + # when we don't have a URL to open we want to do nothing. Otherwise a second browser instance would open. if [ -n "$URL" ] ; then /usr/bin/filter_ready /usr/bin/desktop_ready + bash ${MAXIMIZE_SCRIPT} & $START_COMMAND $ARGS $OPT_URL else echo "No URL specified for exec command. Doing nothing." @@ -55,7 +59,7 @@ kasm_startup() { URL=$LAUNCH_URL fi - if [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ; then + if [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ; then echo "Entering process startup loop" set +x @@ -66,17 +70,17 @@ kasm_startup() { /usr/bin/filter_ready /usr/bin/desktop_ready set +e + bash ${MAXIMIZE_SCRIPT} & $START_COMMAND $ARGS $URL set -e fi sleep 1 done set -x - + fi -} - +} if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then kasm_exec diff --git a/src/ubuntu/install/firefox/install_firefox.sh b/src/ubuntu/install/firefox/install_firefox.sh index 690cfa7..ed55d63 100644 --- a/src/ubuntu/install/firefox/install_firefox.sh +++ b/src/ubuntu/install/firefox/install_firefox.sh @@ -68,7 +68,14 @@ else preferences_file=/usr/lib/firefox/browser/defaults/preferences/firefox.js fi # Disabling default first run URL -echo "pref(\"datareporting.policy.firstRunURL\", \"\");" >> "$preferences_file" +cat >"$preferences_file" <