Files
javis_bot/docker/run-chrome.sh
javis-bot 8868381f13 fix: minimal Chrome flags (drop --test-type/AutomationControlled) + policy infobar suppress
Per the flag hypothesis: remove the automation-signaling flags that can trigger
Google's /sorry/ challenge. Suppress the --no-sandbox warning bar with a Chrome
managed policy (CommandLineFlagSecurityWarningsEnabled=false) instead of
--test-type, so the infobar stays hidden without the automation signal.
2026-06-15 16:51:11 +09:00

34 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Wait for the desktop, then launch Chrome on :1 so the VNC screen shows a
# controllable browser (jarvis can also drive it). Runs as root -> --no-sandbox.
set -e
for i in $(seq 1 40); do
xdpyinfo -display :1 >/dev/null 2>&1 && break
sleep 1
done
sleep 3
export DISPLAY=:1
# Suppress the "--no-sandbox unsupported flag" warning bar via a managed policy
# instead of --test-type. --test-type is an automation signal Google can flag,
# so we keep the launch flags minimal/clean (less chance of the /sorry/ bot
# challenge) while still hiding the infobar.
mkdir -p /etc/opt/chrome/policies/managed
cat > /etc/opt/chrome/policies/managed/jarvis.json <<'JSON'
{ "CommandLineFlagSecurityWarningsEnabled": false }
JSON
# Minimal, non-automation flags. --remote-debugging exposes CDP so the brain can
# drive this on-screen Chrome (Google/YouTube/Naver), --disable-features=Translate
# hides the translate popup. NO --test-type / --disable-blink-features.
exec google-chrome \
--no-sandbox --no-first-run --disable-dev-shm-usage \
--no-default-browser-check \
--disable-features=Translate,TranslateUI \
--lang=ko-KR \
--remote-debugging-port="${CDP_PORT:-9222}" \
--remote-debugging-address="${CDP_BIND:-127.0.0.1}" \
--user-data-dir="${CHROME_PROFILE_DIR:-/root/chrome-profile}" \
--password-store=basic --start-maximized \
"${CHROME_START_URL:-about:blank}"