-
-
Save sillysachin/3674fc2a948d9a80a22b3edf07782aa7 to your computer and use it in GitHub Desktop.
headless chrome screenshot setup.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install Google Chrome | |
| # https://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line | |
| sudo apt-get install libxss1 libappindicator1 libindicator7 | |
| wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| sudo dpkg -i google-chrome*.deb # Might show "errors", fixed by next line | |
| sudo apt-get install -f | |
| # Install Node Stable (v7) | |
| curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - | |
| sudo apt-get install -y nodejs | |
| # Run Chrome as background process | |
| # https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
| # --disable-gpu currently required, see link above | |
| google-chrome --headless --hide-scrollbars --remote-debugging-port=9222 --disable-gpu & | |
| # Install script dependencies | |
| npm install chrome-remote-interface minimist | |
| # Take the screenshot | |
| nodejs index.js --url="http://www.eff.org" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment