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. */