https://github.com/asyne/mindless
Headless Chrome screenshot capturing via Node.js API
https://github.com/asyne/mindless
chrome docker headless nodejs
Last synced: about 1 year ago
JSON representation
Headless Chrome screenshot capturing via Node.js API
- Host: GitHub
- URL: https://github.com/asyne/mindless
- Owner: asyne
- Created: 2017-05-04T00:34:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-07T12:44:46.000Z (over 6 years ago)
- Last Synced: 2024-11-08T22:36:47.420Z (over 1 year ago)
- Topics: chrome, docker, headless, nodejs
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Getting started with Headless Chrome
Chrome 59 gets cross-platform Headless mode support. Chrome Headless is already available on Linux so you could start hacking with it right now, even if you're not on Linux. The only thing you will need is [Docker](https://www.docker.com/).
For now, there is one example of use in this repository – capturing screenshots for different platforms (Desktop, Mobile & Tablet) using Headless Chrome. But more may appear later, contributions are always welcome.
You could [read Chrome announcement post](https://developers.google.com/web/updates/2017/04/headless-chrome) for more generic use cases on Headless mode.
### Running with Docker
```sh
# Clone Github repository
$ git clone git@github.com:asyne/mindless.git
# Build Docker image
$ cd mindless/
$ docker build -t mindless .
# Run Docker container and take screenshots of Github's main page
# «output» folder will be created in the current directory
$ docker run -it --cap-add=SYS_ADMIN -v $(pwd)/output:/output mindless --url https://github.com/
```
### Reference
- [Chrome Debugging Protocol](https://chromedevtools.github.io/devtools-protocol/)
- [Chrome Remote Interface (CDP client)](https://github.com/cyrus-and/chrome-remote-interface/)