]> khamidou — GitHub mirrors - electron.git/commitdiff
:memo: add 'did-navigate-in-page', 'did-navigate-to-different-page', 'will-navigate...
authorleethomas <leet944@gmail.com>
Sat, 2 Jan 2016 00:05:27 +0000 (16:05 -0800)
committerleethomas <leet944@gmail.com>
Sat, 2 Jan 2016 01:22:25 +0000 (17:22 -0800)
docs/api/web-contents.md
docs/api/web-view-tag.md

index 2057b515c025f8b7cfeaa3d6c7abfe63dcf68023..5b53cd14f0d1fd04746b5788cbb9dca2cb85843c 100644 (file)
@@ -135,8 +135,22 @@ Emitted when a user or the page wants to start navigation. It can happen when th
 This event will not emit when the navigation is started programmatically with
 APIs like `webContents.loadURL` and `webContents.back`.
 
+It is also not emitted during in-page navigation, such as clicking anchor links
+or updating the `window.location.hash`. Use `did-navigate-in-page` for this purpose.
+
 Calling `event.preventDefault()` will prevent the navigation.
 
+### Event: 'did-navigate-to-different-page'
+
+Emitted when the new page that was navigated to is different from the previous
+page.
+
+### Event: 'did-navigate-in-page'
+
+Emitted when the page url changes but does not cause navigation outside of the page.
+Examples of this occurring are when anchor links are clicked or when the
+DOM `hashchange` event is triggered.
+
 ### Event: 'crashed'
 
 Emitted when the renderer process has crashed.
index 0c79083c112d59a1aac7a610a646e706bd6b03d8..8575964aab624070713b512ef972d1fff049b58b 100644 (file)
@@ -572,6 +572,28 @@ webview.addEventListener('new-window', function(e) {
 });
 ```
 
+### Event: 'will-navigate'
+
+Returns:
+* `url` String
+
+Emitted when a user or the page wants to start navigation. It can happen when the
+`window.location` object is changed or a user clicks a link in the page. It not
+emitted during in-page navigation such as clicking anchor links or updating the
+`window.location.hash`. Use `did-navigate-in-page` for this purpose.
+
+
+### Event: 'did-navigate-to-different-page'
+
+Emitted when the new page that was navigated to is different from the previous
+page.
+
+### Event: 'did-navigate-in-page'
+
+Emitted when the page url changes but does not cause navigation outside of the page.
+Examples of this occurring are when anchor links are clicked or when the
+DOM `hashchange` event is triggered.
+
 ### Event: 'close'
 
 Fired when the guest page attempts to close itself.