From ce4ef1ccb8bc2cb116db256d9a8754e42c2a0c04 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 5 Jul 2016 17:26:05 -0700 Subject: [PATCH] Update capturePage documentation for new location --- docs/api/browser-window.md | 12 +----------- docs/api/web-contents.md | 14 ++++++++++++++ docs/api/web-view-tag.md | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 1f3d9d49bf0..ba07e0bf167 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -892,17 +892,7 @@ Whether the window's document has been edited. ### `win.capturePage([rect, ]callback)` -* `rect` Object (optional) - The area of page to be captured - * `x` Integer - * `y` Integer - * `width` Integer - * `height` Integer -* `callback` Function - -Captures a snapshot of the page within `rect`. Upon completion `callback` will -be called with `callback(image)`. The `image` is an instance of -[NativeImage](native-image.md) that stores data of the snapshot. Omitting -`rect` will capture the whole visible page. +Same as `webContents.capturePage([rect, ]callback)`. ### `win.loadURL(url[, options])` diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index e33d3d0cacc..47e395740b9 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -664,6 +664,20 @@ webContents.on('found-in-page', (event, result) => { const requestId = webContents.findInPage('api'); ``` +### `webContents.capturePage([rect, ]callback)` + +* `rect` Object (optional) - The area of the page to be captured + * `x` Integer + * `y` Integer + * `width` Integer + * `height` Integer +* `callback` Function + +Captures a snapshot of the page within `rect`. Upon completion `callback` will +be called with `callback(image)`. The `image` is an instance of +[NativeImage](native-image.md) that stores data of the snapshot. Omitting +`rect` will capture the whole visible page. + ### `webContents.hasServiceWorker(callback)` * `callback` Function diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 25725cecea2..ecb84855032 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -469,6 +469,20 @@ Prints `webview`'s web page. Same with `webContents.print([options])`. Prints `webview`'s web page as PDF, Same with `webContents.printToPDF(options, callback)` +### `.capturePage([rect, ]callback)` + +* `rect` Object (optional) - The area of the page to be captured + * `x` Integer + * `y` Integer + * `width` Integer + * `height` Integer +* `callback` Function + +Captures a snapshot of the page within `rect`. Upon completion `callback` will +be called with `callback(image)`. The `image` is an instance of +[NativeImage](native-image.md) that stores data of the snapshot. Omitting +`rect` will capture the whole visible page. + ### `.send(channel[, arg1][, arg2][, ...])` * `channel` String