You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/api.md
+8-9
Original file line number
Diff line number
Diff line change
@@ -1298,18 +1298,18 @@ await browser.close();
1298
1298
#### page.screenshot([options])
1299
1299
-`options` <[Object]> Options object which might have the following properties:
1300
1300
-`path` <[string]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). If no path is provided, the image won't be saved to the disk.
1301
-
-`type` <"png"|"jpeg"> Specify screenshot type, defaults to 'png'.
1301
+
-`type` <"png"|"jpeg"> Specify screenshot type, defaults to `png`.
1302
1302
-`quality` <[number]> The quality of the image, between 0-100. Not applicable to `png` images.
1303
-
-`fullPage` <[boolean]> When true, takes a screenshot of the full scrollable page. Defaults to `false`.
1304
-
-`clip` <[Object]> An object which specifies clipping region of the page. Should have the following fields:
1303
+
-`fullPage` <[boolean]> When true, takes a screenshot of the full scrollable page, instead of the currently visibvle viewport. Defaults to `false`.
1304
+
-`clip` <[Object]> An object which specifies clipping of the resulting image. Should have the following fields:
1305
1305
-`x` <[number]> x-coordinate of top-left corner of clip area
1306
1306
-`y` <[number]> y-coordinate of top-left corner of clip area
1307
1307
-`width` <[number]> width of clipping area
1308
1308
-`height` <[number]> height of clipping area
1309
-
-`omitBackground` <[boolean]> Hides default white background and allows capturing screenshots with transparency. Defaults to `false`.
1309
+
-`omitBackground` <[boolean]> Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.
1310
1310
- returns: <[Promise]<[Buffer]>> Promise which resolves to buffer with the captured screenshot.
1311
1311
1312
-
> **NOTE** Screenshots take at least 1/6 second on OS X. See https://crbug.com/741689 for discussion.
1312
+
> **NOTE** Screenshots take at least 1/6 second on Chromium OS X and Chromium Windows. See https://crbug.com/741689 for discussion.
1313
1313
1314
1314
#### page.select(selector, value, options)
1315
1315
-`selector` <[string]> A selector to query frame for.
@@ -2483,13 +2483,12 @@ If `key` is a single character and no modifier keys besides `Shift` are being he
2483
2483
#### elementHandle.screenshot([options])
2484
2484
-`options` <[Object]> Screenshot options.
2485
2485
-`path` <[string]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). If no path is provided, the image won't be saved to the disk.
2486
-
-`type` <"png"|"jpeg"> Specify screenshot type, defaults to 'png'.
2486
+
-`type` <"png"|"jpeg"> Specify screenshot type, defaults to `png`.
2487
2487
-`quality` <[number]> The quality of the image, between 0-100. Not applicable to `png` images.
2488
-
-`omitBackground` <[boolean]> Hides default white background and allows capturing screenshots with transparency. Defaults to `false`.
2488
+
-`omitBackground` <[boolean]> Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.
2489
2489
- returns: <[Promise]<|[Buffer]>> Promise which resolves to buffer with the captured screenshot.
2490
2490
2491
-
This method scrolls element into view if needed, and then uses [page.screenshot](#pagescreenshotoptions) to take a screenshot of the element.
2492
-
If the element is detached from DOM, the method throws an error.
2491
+
This method scrolls element into view if needed before taking a screenshot. If the element is detached from DOM, the method throws an error.
2493
2492
2494
2493
#### elementHandle.scrollIntoViewIfNeeded()
2495
2494
- returns: <[Promise]> Resolves after the element has been scrolled into view.
0 commit comments