From ed6213e9514b9dc5a1fee10d29fb192259a4bffa Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 23 Jun 2016 20:32:19 +0900 Subject: [PATCH] Do not emit did-fail-load for canceled requests --- atom/browser/api/atom_api_web_contents.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 58b6a4729a84..45719d95199b 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -607,7 +607,10 @@ void WebContents::DidFailProvisionalLoad( bool was_ignored_by_handler) { bool is_main_frame = !render_frame_host->GetParent(); Emit("did-fail-provisional-load", code, description, url, is_main_frame); - Emit("did-fail-load", code, description, url, is_main_frame); + + // Do not emit "did-fail-load" for canceled requests. + if (code != net::ERR_ABORTED) + Emit("did-fail-load", code, description, url, is_main_frame); } void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,