mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-23 02:51:26 +01:00
PE-151, need to use setWindowOpenHandler (in new version of electron) instead of new-window event.
This commit is contained in:
parent
caa11748e5
commit
8b8f7cda7b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user