diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index a1b50478a5..007f19677a 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -118,6 +118,7 @@ #include "shell/common/mouse_util.h" #include "shell/common/node_includes.h" #include "shell/common/options_switches.h" +#include "shell/common/process_util.h" #include "shell/common/v8_value_serializer.h" #include "storage/browser/file_system/isolated_context.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" @@ -1656,9 +1657,15 @@ void WebContents::DidFinishNavigation( frame_process_id, frame_routing_id); // Do not emit "did-fail-load" for canceled requests. - if (code != net::ERR_ABORTED) + if (code != net::ERR_ABORTED) { + EmitWarning( + node::Environment::GetCurrent(JavascriptEnvironment::GetIsolate()), + "Failed to load URL: " + url.possibly_invalid_spec() + + " with error: " + description, + "electron"); Emit("did-fail-load", code, description, url, is_main_frame, frame_process_id, frame_routing_id); + } } }