From 040049f9e72daf88fc5419b2417f2089badd17b8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 17 Dec 2014 15:15:37 -0800 Subject: [PATCH] docs: "will-navigate" event --- docs/api/browser-window.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 6486ddd0..fc0459b1 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -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. -- 2.43.0