Browse Source

:fax: Add print() to BrowserWindowProxy

Closes #5685
Felix Rieseberg 9 years ago
parent
commit
fa7f084625
2 changed files with 8 additions and 0 deletions
  1. 4 0
      docs/api/window-open.md
  2. 4 0
      lib/renderer/override.js

+ 4 - 0
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

+ 4 - 0
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_WINDOW_METHOD', this.guestId, 'print')
+  }
+
   Object.defineProperty(BrowserWindowProxy.prototype, 'location', {
     get: function () {
       return ipcRenderer.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'getURL')