From 1854a284e9a3b0bb0c6ce262a5000c52914f47af Mon Sep 17 00:00:00 2001 From: Kevin Rigney Date: Tue, 13 Aug 2019 23:22:09 -0400 Subject: [PATCH] Allow arguments to be passed to chrome at runtime --- copyables/crd-session | 2 +- copyables/entrypoint.sh | 2 ++ copyables/etc/supervisor/conf.d/supervisord.conf | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/copyables/crd-session b/copyables/crd-session index dceffeb..9370483 100644 --- a/copyables/crd-session +++ b/copyables/crd-session @@ -1,2 +1,2 @@ rm -rf /home/chrome/.config/chrome-remote-desktop/chrome-profile/Singleton* -exec /opt/google/chrome/chrome --no-sandbox --start-maximized --force-device-scale-factor=1 --use-system-title-bar +exec /opt/google/chrome/chrome --no-sandbox --start-maximized --force-device-scale-factor=1 --use-system-title-bar ${CHROME_OPTS} diff --git a/copyables/entrypoint.sh b/copyables/entrypoint.sh index 6c1233a..360347c 100644 --- a/copyables/entrypoint.sh +++ b/copyables/entrypoint.sh @@ -28,4 +28,6 @@ IFS='x' read SCREEN_WIDTH SCREEN_HEIGHT <<< "${VNC_SCREEN_SIZE}" export VNC_SCREEN="${SCREEN_WIDTH}x${SCREEN_HEIGHT}x24" export CHROME_WINDOW_SIZE="${SCREEN_WIDTH},${SCREEN_HEIGHT}" +export CHROME_OPTS="${CHROME_OPTS_OVERRIDE:- --user-data-dir --no-sandbox --window-position=0,0 --force-device-scale-factor=1}" + exec "$@" diff --git a/copyables/etc/supervisor/conf.d/supervisord.conf b/copyables/etc/supervisor/conf.d/supervisord.conf index 39830d6..9e7d39f 100644 --- a/copyables/etc/supervisor/conf.d/supervisord.conf +++ b/copyables/etc/supervisor/conf.d/supervisord.conf @@ -8,7 +8,7 @@ priority=100 [program:chrome] environment=HOME="/home/chrome",DISPLAY=":1",USER="chrome" -command=/opt/google/chrome/chrome --user-data-dir --no-sandbox --window-position=0,0 --window-size=%(ENV_CHROME_WINDOW_SIZE)s --force-device-scale-factor=1 +command=/opt/google/chrome/chrome --window-size=%(ENV_CHROME_WINDOW_SIZE)s %(ENV_CHROME_OPTS)s user=chrome autorestart=true priority=200