diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 7bd1095b8a9f..10f91c47bcb4 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -111,9 +111,15 @@ content::WebContents* WebContents::OpenURLFromTab( args.AppendString(""); args.AppendInteger(params.disposition); Emit("-new-window", args); - return NULL; + return nullptr; } + // Give user a chance to cancel navigation. + base::ListValue args; + args.AppendString(params.url.spec()); + if (Emit("will-navigate", args)) + return nullptr; + content::NavigationController::LoadURLParams load_url_params(params.url); load_url_params.referrer = params.referrer; load_url_params.transition_type = params.transition;