mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
PE-151, need to use setWindowOpenHandler (in new version of electron) instead of new-window event.
This commit is contained in:
+2
-2
@@ -281,8 +281,7 @@ function createMainWindow(clientData) {
|
||||
win.on("close", () => {
|
||||
MainWindow = null;
|
||||
});
|
||||
win.webContents.on("new-window", (e, url) => {
|
||||
e.preventDefault();
|
||||
win.webContents.setWindowOpenHandler(({url, frameName}) => {
|
||||
if (url.startsWith("https://docs.getprompt.dev/")) {
|
||||
electron.shell.openExternal(url);
|
||||
} else if (url.startsWith("https://discord.gg/")) {
|
||||
@@ -293,6 +292,7 @@ function createMainWindow(clientData) {
|
||||
let newUrl = decodeURIComponent(param);
|
||||
electron.shell.openExternal(newUrl);
|
||||
}
|
||||
return { action: 'deny' };
|
||||
});
|
||||
return win;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user