Skip to content

Commit

Permalink
Remove dialog for certificate errors on subresources.
Browse files Browse the repository at this point in the history
Fixes #1119.  Closes #1277.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
  • Loading branch information
andersk committed Mar 22, 2024
1 parent 79f6f13 commit 7072a41
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions app/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type {Event} from "electron/common";
import {clipboard} from "electron/common";
import type {IpcMainEvent, WebContents} from "electron/main";
import {
Expand Down Expand Up @@ -306,18 +305,24 @@ function createMainWindow(): BrowserWindow {
app.on(
"certificate-error",
(
event: Event,
webContents: WebContents,
urlString: string,
error: string,
event,
webContents,
urlString,
error,
certificate,
callback,
isMainFrame,
// eslint-disable-next-line max-params
) => {
const url = new URL(urlString);
dialog.showErrorBox(
"Certificate error",
`The server presented an invalid certificate for ${url.origin}:
if (isMainFrame) {
const url = new URL(urlString);
dialog.showErrorBox(
"Certificate error",
`The server presented an invalid certificate for ${url.origin}:
${error}`,
);
);
}
},
);

Expand Down

0 comments on commit 7072a41

Please sign in to comment.