Browse Source

fixup tests

Samuel Attard 4 years ago
parent
commit
28b794216d

+ 1 - 1
docs/api/structures/cancellable-navigation-event.md

@@ -1,6 +1,6 @@
 # CancellableNavigationEvent Object extends `Event`
 
-* `returnValue` Object | null - Set this to cancel the navigation event and optionally return a custom error code or error page
+* `returnValue` Object - Set this to cancel the navigation event and optionally return a custom error code or error page
   * `errorCode` Number - Can be any error code from the [Net Error List](https://source.chromium.org/chromium/chromium/src/+/master:net/base/net_error_list.h).  If you provide `errorPage` then this code can not be `-3`. We recommend using `-2` which is `net::Aborted`.
   * `errorPage` String (optional) - Custom HTML error page to display when the navigation is cancelled.
 

+ 1 - 1
shell/browser/electron_navigation_throttle.cc

@@ -86,7 +86,7 @@ content::NavigationThrottle::ThrottleCheckResult
 ElectronNavigationThrottle::WillStartRequest() {
   auto* handle = navigation_handle();
   if (handle->IsRendererInitiated() && handle->IsInMainFrame())
-    return DelegateEventToWebContents("-will-navigate", net::ERR_FAILED);
+    return DelegateEventToWebContents("-will-navigate", net::ERR_ABORTED);
   return PROCEED;
 }