diff --git a/docs/api/window-open.md b/docs/api/window-open.md index 7f9400bfae9f..b615a4b6488e 100644 --- a/docs/api/window-open.md +++ b/docs/api/window-open.md @@ -63,6 +63,10 @@ Evaluates the code in the child window. Focuses the child window (brings the window to front). +### `BrowserWindowProxy.print()` + +Invokes the print dialog on the child window. + ### `BrowserWindowProxy.postMessage(message, targetOrigin)` * `message` String diff --git a/lib/renderer/override.js b/lib/renderer/override.js index 35ca80f16afe..5667e5e16f55 100644 --- a/lib/renderer/override.js +++ b/lib/renderer/override.js @@ -45,6 +45,10 @@ var BrowserWindowProxy = (function () { return ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'blur') } + BrowserWindowProxy.prototype.print = function () { + return ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', this.guestId, 'print') + } + Object.defineProperty(BrowserWindowProxy.prototype, 'location', { get: function () { return ipcRenderer.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'getURL')