8000 feat: add isMainFrame argument to 'certificate-error' event by miniak · Pull Request #30879 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add isMainFrame argument to 'certificate-error' event #30879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/api/web-contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
8 changes: 4 additions & 4 deletions shell/browser/api/electron_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -817,10 +817,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)
Expand Down
0