--javascript
- CLI
- --javascript
- REST
- javascript
Runs this JavaScript in the page once the DOM is parsed, before the capture. Cannot be combined with --javascript-file.
Example
zshot -f page.png \
--javascript "document.body.style.background = 'white'" \
https://zshot-cli.com/example_assets/hello_zshot/{
"url": "https://zshot-cli.com/example_assets/hello_zshot/",
"output_type": "png",
"javascript": "document.body.style.background = 'white'"
}curl -X POST http://127.0.0.1:3000/ \
-H "Content-Type: application/json" \
-d '{"url":"https://zshot-cli.com/example_assets/hello_zshot/","output_type":"png","javascript":"document.body.style.background = 'white'"}' \
-o page.png