Để 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