Update dependency electron to v22 (#480)

* Update dependency electron to v22

* Switch from new-window event to setWindowOpenHandler

* Stop recommending libappindicator3-1, Electron 22 stops using it

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
renovate[bot]
2022-12-07 00:04:53 +00:00
committed by GitHub
parent 333361fc02
commit 6508e171db
5 changed files with 140 additions and 155 deletions

View File

@@ -263,7 +263,11 @@ ipcMain.on('userDownloadAction', function(ev: IpcMainEvent, { id, open = false }
});
export default (webContents: WebContents): void => {
webContents.on('new-window', onWindowOrNavigate);
webContents.setWindowOpenHandler((details) => {
safeOpenURL(details.url);
return { action: "deny" };
});
webContents.on('will-navigate', (ev: Event, target: string): void => {
if (target.startsWith("vector://")) return;
return onWindowOrNavigate(ev, target);