]> khamidou — GitHub mirrors - electron.git/commitdiff
doc: "new-window" event of WebContents
authorCheng Zhao <zcbenz@gmail.com>
Mon, 27 Oct 2014 15:23:26 +0000 (23:23 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 27 Oct 2014 15:27:33 +0000 (23:27 +0800)
docs/api/browser-window.md

index dd0bd4bd06b154628eb6464094aee7ae67550239..d64292fb85e7888f20e091a9ac5f1247e946b3b8 100644 (file)
@@ -546,6 +546,21 @@ Corresponds to the points in time when the spinner of the tab stops spinning.
 
 Emitted when a redirect was received while requesting a resource.
 
+### Event: 'new-window'
+
+* `event` Event
+* `url` String
+* `frameName` String
+* `options` Object
+
+Emitted when the page requested to open a new window for `url`. It could be
+requested by `window.open` or a external link like `<a target='_blank'>`.
+
+By default a new `BrowserWindow` will be created for `url` called, and a proxy
+will be returned to `window.open` to let you have limited control of it.
+
+Calling `event.preventDefault()` can prevent creating new windows.
+
 ### Event: 'crashed'
 
 Emitted when the renderer process is crashed.