]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: "will-navigate" event
authorCheng Zhao <zcbenz@gmail.com>
Wed, 17 Dec 2014 23:15:37 +0000 (15:15 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 17 Dec 2014 23:15:37 +0000 (15:15 -0800)
docs/api/browser-window.md

index 6486ddd0a29e2e421e2e1163fa67be818ec27011..fc0459b1faa99e034eb388b46e3dc01a65985650 100644 (file)
@@ -616,6 +616,19 @@ will be returned to `window.open` to let you have limited control of it.
 
 Calling `event.preventDefault()` can prevent creating new windows.
 
+### Event: 'will-naviagte'
+
+* `event` Event
+* `url` String
+
+Emitted when user or the page wants to start an navigation, it can happen when
+`window.location` object is changed or user clicks a link in the page.
+
+This event will not emit when the navigation is started programmely with APIs
+like `WebContents.loadUrl` and `WebContents.back`.
+
+Calling `event.preventDefault()` can prevent the navigation.
+
 ### Event: 'crashed'
 
 Emitted when the renderer process is crashed.