Skip to content

Instantly share code, notes, and snippets.

@randName
Created June 21, 2026 14:45
Show Gist options
  • Select an option

  • Save randName/ee1cd36c3db0ef2dfec1f0bbb2c47a5f to your computer and use it in GitHub Desktop.

Select an option

Save randName/ee1cd36c3db0ef2dfec1f0bbb2c47a5f to your computer and use it in GitHub Desktop.
chromium cdp
#/bin/bash
chown -R pwuser:pwuser /home/pwuser/profile
apt-get update -qq && apt-get install -y -qq socat
CHROME=$(find /ms-playwright -iname chrome -path '*chrome-linux*' | head -n1)
su pwuser -c "'$CHROME' \
--headless=new \
--no-sandbox \
--remote-debugging-port=9223 \
--remote-allow-origins=* \
--user-data-dir=/home/pwuser/profile" &
sleep 2
exec socat TCP-LISTEN:9222,fork,reuseaddr TCP:127.0.0.1:9223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment