From 2a9dadf70a06fddb239b9b6bf3b0e49d4e696ada Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 11 Mar 2016 10:14:19 +0900 Subject: [PATCH] github-electron: add missing remote.getCurrentWebContents() API document is here: https://github.com/atom/electron/blob/master/docs/api/remote.md#remotegetcurrentwebcontents --- github-electron/github-electron-renderer-tests.ts | 2 ++ github-electron/github-electron.d.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/github-electron/github-electron-renderer-tests.ts b/github-electron/github-electron-renderer-tests.ts index 31bd5a32ea..5af40f0321 100644 --- a/github-electron/github-electron-renderer-tests.ts +++ b/github-electron/github-electron-renderer-tests.ts @@ -38,6 +38,8 @@ remote.getCurrentWindow().capturePage(buf => { }); }); +remote.getCurrentWebContents().print(); + remote.getCurrentWindow().capturePage(buf => { remote.require('fs').writeFile('/tmp/screenshot.png', buf, (err: Error) => { console.log(err); diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 3bb70fc338..52640de485 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1541,6 +1541,10 @@ declare module Electron { * @returns The BrowserWindow object which this web page belongs to. */ getCurrentWindow(): BrowserWindow; + /** + * @returns The WebContents object of this web page. + */ + getCurrentWebContents(): WebContents; /** * @returns The global variable of name (e.g. global[name]) in the main process. */