Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
fix: add basic invalid certificate handling, fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
sentialx committed Feb 1, 2019
1 parent 428dd50 commit 92fc70b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/browser-view-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ export default class BrowserViewWrapper extends BrowserView {
);
});

(this.webContents as any).addListener(
'certificate-error',
(
event: Electron.Event,
url: string,
error: string,
certificate: Electron.Certificate,
callback: Function,
) => {
console.log(certificate, error, url);
// TODO: properly handle insecure websites.
event.preventDefault();
callback(true);
},
);

this.setAutoResize({ width: true, height: true });
this.webContents.loadURL('https://google.com');
}
Expand Down

0 comments on commit 92fc70b

Please sign in to comment.