1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-11 09:11:50 +00:00

Handle window.open calls with external browser

Re-use the same openExternalUrl logic meant for frame navigation to
handle window.open calls as well. Possibly a partial solution, as the
ability to open new windows might be useful for mods.
This commit is contained in:
Даниїл Григор'єв 2025-03-27 23:02:45 +02:00
parent ae1cd71d3b
commit 2997cf8daf
No known key found for this signature in database
GPG Key ID: B890DF16341D8C1D

View File

@ -65,6 +65,12 @@ function createWindow() {
ev.preventDefault();
openExternalUrl(url);
});
// Also redirect window.open
win.webContents.setWindowOpenHandler(({ url }) => {
openExternalUrl(url);
return { action: "deny" };
});
}
function openExternalUrl(urlString: string) {