Skip to content

Commit fceddad

Browse files
committed
Documentation for --log-console, closes #101
1 parent aa02fe9 commit fceddad

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/screenshots.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,34 @@ new Promise(takeShot => {
198198
```
199199
If your custom code defines a `Promise`, `shot-scraper` will wait for that promise to complete before taking the screenshot. Here the screenshot does not occur until the `takeShot()` function is called.
200200

201+
## Viewing console.log() output
202+
203+
Almost all of the `shot-scraper` commands accept a `--log-console` option, which will cause them to output any calls to `console.log()` to standard error while the command is running.
204+
205+
This includes both `console.log()` calls in the existing page JavaScript, as well as any calls to that method that you include in your own custom JavaScript.
206+
207+
For example, running `--log-console` while taking a screenshot of the Facebook homepage will show this warning message, which Facebook logs to the developer tools console to help protect people from social engineering attacks:
208+
209+
```
210+
% shot-scraper shot facebook.com --log-console
211+
212+
.d8888b. 888 888
213+
d88P Y88b 888 888
214+
Y88b. 888 888 This is a browser feature intended for
215+
"Y888b. 888888 .d88b. 88888b. 888 developers. If someone told you to copy-paste
216+
"Y88b. 888 d88""88b 888 "88b 888 something here to enable a Facebook feature
217+
"888 888 888 888 888 888 Y8P or "hack" someone's account, it is a
218+
Y88b d88P Y88b. Y88..88P 888 d88P scam and will give them access to your
219+
"Y8888P" "Y888 "Y88P" 88888P" 888 Facebook account.
220+
888
221+
888
222+
888
223+
224+
See https://www.facebook.com/selfxss for more information.
225+
226+
Screenshot of 'http://facebook.com' written to 'facebook-com.png'
227+
```
228+
201229
## `shot-scraper shot --help`
202230

203231
Full `--help` for this command:

0 commit comments

Comments
 (0)