X Tutup
Skip to content

Commit ce4ef1c

Browse files
committed
Update capturePage documentation for new location
1 parent 12dddae commit ce4ef1c

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

docs/api/browser-window.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -892,17 +892,7 @@ Whether the window's document has been edited.
892892

893893
### `win.capturePage([rect, ]callback)`
894894

895-
* `rect` Object (optional) - The area of page to be captured
896-
* `x` Integer
897-
* `y` Integer
898-
* `width` Integer
899-
* `height` Integer
900-
* `callback` Function
901-
902-
Captures a snapshot of the page within `rect`. Upon completion `callback` will
903-
be called with `callback(image)`. The `image` is an instance of
904-
[NativeImage](native-image.md) that stores data of the snapshot. Omitting
905-
`rect` will capture the whole visible page.
895+
Same as `webContents.capturePage([rect, ]callback)`.
906896

907897
### `win.loadURL(url[, options])`
908898

docs/api/web-contents.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,20 @@ webContents.on('found-in-page', (event, result) => {
664664
const requestId = webContents.findInPage('api');
665665
```
666666

667+
### `webContents.capturePage([rect, ]callback)`
668+
669+
* `rect` Object (optional) - The area of the page to be captured
670+
* `x` Integer
671+
* `y` Integer
672+
* `width` Integer
673+
* `height` Integer
674+
* `callback` Function
675+
676+
Captures a snapshot of the page within `rect`. Upon completion `callback` will
677+
be called with `callback(image)`. The `image` is an instance of
678+
[NativeImage](native-image.md) that stores data of the snapshot. Omitting
679+
`rect` will capture the whole visible page.
680+
667681
### `webContents.hasServiceWorker(callback)`
668682

669683
* `callback` Function

docs/api/web-view-tag.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,20 @@ Prints `webview`'s web page. Same with `webContents.print([options])`.
469469

470470
Prints `webview`'s web page as PDF, Same with `webContents.printToPDF(options, callback)`
471471

472+
### `<webview>.capturePage([rect, ]callback)`
473+
474+
* `rect` Object (optional) - The area of the page to be captured
475+
* `x` Integer
476+
* `y` Integer
477+
* `width` Integer
478+
* `height` Integer
479+
* `callback` Function
480+
481+
Captures a snapshot of the page within `rect`. Upon completion `callback` will
482+
be called with `callback(image)`. The `image` is an instance of
483+
[NativeImage](native-image.md) that stores data of the snapshot. Omitting
484+
`rect` will capture the whole visible page.
485+
472486
### `<webview>.send(channel[, arg1][, arg2][, ...])`
473487

474488
* `channel` String

0 commit comments

Comments
 (0)
X Tutup