diff --git a/docs/api/app.md b/docs/api/app.md index a017c2e86e12b..14615242893b3 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -277,6 +277,7 @@ Returns: * `certificate` [Certificate](structures/certificate.md) * `callback` Function * `isTrusted` Boolean - Whether to consider the certificate as trusted +* `isMainFrame` Boolean Emitted when failed to verify the `certificate` for `url`, to trust the certificate you should prevent the default behavior with diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 2135a8d9439db..72484093a5707 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -530,6 +530,7 @@ Returns: * `certificate` [Certificate](structures/certificate.md) * `callback` Function * `isTrusted` Boolean - Indicates whether the certificate can be considered trusted. +* `isMainFrame` Boolean Emitted when failed to verify the `certificate` for `url`. diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 9516d571f438b..6c94aa0a7caed 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -815,10 +815,10 @@ void App::AllowCertificateError( v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); v8::Locker locker(isolate); v8::HandleScope handle_scope(isolate); - bool prevent_default = - Emit("certificate-error", - WebContents::FromOrCreate(isolate, web_contents), request_url, - net::ErrorToString(cert_error), ssl_info.cert, adapted_callback); + bool prevent_default = Emit( + "certificate-error", WebContents::FromOrCreate(isolate, web_contents), + request_url, net::ErrorToString(cert_error), ssl_info.cert, + adapted_callback, is_main_frame_request); // Deny the certificate by default. if (!prevent_default)