Merge pull request #8494 from rhysd/getCurrentWebContents

github-electron: add missing remote.getCurrentWebContents()
This commit is contained in:
Masahiro Wakame
2016-03-12 01:34:18 +09:00
2 changed files with 6 additions and 0 deletions
@@ -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);
+4
View File
@@ -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.
*/