Skip to content

Instantly share code, notes, and snippets.

@rl4debug
Last active May 1, 2024 20:52
Show Gist options
  • Save rl4debug/2374684b09c069a8e4c31da6f32d18d0 to your computer and use it in GitHub Desktop.
Save rl4debug/2374684b09c069a8e4c31da6f32d18d0 to your computer and use it in GitHub Desktop.
[chrome headless] #chrome #headless

Để start chrome headless trên ubuntu

# this script will start chrome headless that hold state of your real browser (cookie, session...)
# note that user-data-dir "/home/debug/.config/google-chrome/Default" is wrong (remove /Default)
/opt/google/chrome/chrome --headless \
    --remote-debugging-port=9222 \
  --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36" \
  --user-data-dir="/home/debug/.config/google-chrome"

For Opera ubuntu

/usr/lib/x86_64-linux-gnu/opera/opera --remote-debugging-port=9222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment