Skip to content

Commit

Permalink
webui: Store browser in array
Browse files Browse the repository at this point in the history
At the moment most of the firefox command line is getting placed
in a variable named $BROWSER and then getting run as

$BROWSER http://url

This only works if $BROWSER is at the very front of the line or if
it's run through eval.

Instead, make BROWSER into an array so it's positional arguments
get expanded positionally.
  • Loading branch information
halfline authored and adamkankovsky committed Oct 3, 2024
1 parent 8efd69a commit 3a1ae07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webui-desktop
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ THEME_PATH="${FIREFOX_THEME_DIR}/${THEME_ID}"
cp -a "${THEME_PATH}/." ${FIREFOX_PROFILE_PATH}

# FIXME: is this hardcoded resolution necessary ?
BROWSER="/usr/bin/firefox --new-instance --window-size 1024,768 --profile ${FIREFOX_PROFILE_PATH}"
BROWSER=(/usr/bin/firefox --new-instance --window-size "1024,768" --profile "${FIREFOX_PROFILE_PATH}")

# start browser in a temporary home dir, so that it does not interfere with your real one
BROWSER_HOME=$(mktemp --directory --tmpdir cockpit.desktop.XXXXXX)
Expand Down Expand Up @@ -126,7 +126,7 @@ fi
# XDG_RUNTIME_DIR so it is willing to start.
unset XAUTHORITY XDG_RUNTIME_DIR

HOME="$BROWSER_HOME" MOZ_APP_TITLE="" MOZ_APP_REMOTINGNAME="liveinst" XDG_CURRENT_DESKTOP=GNOME MOZ_GTK_TITLEBAR_DECORATION=client $BROWSER http://"$WEBUI_ADDRESS""$URL_PATH" &
HOME="$BROWSER_HOME" MOZ_APP_TITLE="" MOZ_APP_REMOTINGNAME="liveinst" XDG_CURRENT_DESKTOP=GNOME MOZ_GTK_TITLEBAR_DECORATION=client "${BROWSER[@]}" http://"$WEBUI_ADDRESS""$URL_PATH" &
B_PID=$!

wait $B_PID

0 comments on commit 3a1ae07

Please sign in to comment.