From 590be75fa98bba86608e00fef446f6c564e5e780 Mon Sep 17 00:00:00 2001 From: Gohy Leandre Date: Mon, 31 Aug 2015 11:18:10 +0200 Subject: [PATCH] add ValidatedUrl to did-fail-load event --- atom/browser/api/atom_api_web_contents.cc | 4 ++-- atom/renderer/lib/web-view/guest-view-internal.coffee | 2 +- docs/api/web-contents.md | 1 + docs/api/web-view-tag.md | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 9cb52a1ec74d..7c37f17e10d9 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -388,7 +388,7 @@ void WebContents::DidFailProvisionalLoad( int error_code, const base::string16& error_description, bool was_ignored_by_handler) { - Emit("did-fail-load", error_code, error_description); + Emit("did-fail-load", error_code, error_description, validated_url); } void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host, @@ -396,7 +396,7 @@ void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host, int error_code, const base::string16& error_description, bool was_ignored_by_handler) { - Emit("did-fail-load", error_code, error_description); + Emit("did-fail-load", error_code, error_description, validated_url); } void WebContents::DidStartLoading() { diff --git a/atom/renderer/lib/web-view/guest-view-internal.coffee b/atom/renderer/lib/web-view/guest-view-internal.coffee index 44db5e304db4..b491184fb8d7 100644 --- a/atom/renderer/lib/web-view/guest-view-internal.coffee +++ b/atom/renderer/lib/web-view/guest-view-internal.coffee @@ -6,7 +6,7 @@ requestId = 0 WEB_VIEW_EVENTS = 'load-commit': ['url', 'isMainFrame'] 'did-finish-load': [] - 'did-fail-load': ['errorCode', 'errorDescription'] + 'did-fail-load': ['errorCode', 'errorDescription', 'validatedUrl'] 'did-frame-finish-load': ['isMainFrame'] 'did-start-loading': [] 'did-stop-loading': [] diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 89afae43d1c0..a3d3c360fff6 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -32,6 +32,7 @@ Returns: * `event` Event * `errorCode` Integer * `errorDescription` String +* `validatedUrl` String This event is like `did-finish-load` but emitted when the load failed or was cancelled, e.g. `window.stop()` is invoked. diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 850390702168..ff12110fac84 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -384,6 +384,7 @@ Returns: * `errorCode` Integer * `errorDescription` String +* `validatedUrl` String This event is like `did-finish-load`, but fired when the load failed or was cancelled, e.g. `window.stop()` is invoked.