mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-13 18:21:51 +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:
parent
ae1cd71d3b
commit
2997cf8daf
@ -65,6 +65,12 @@ function createWindow() {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
openExternalUrl(url);
|
openExternalUrl(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Also redirect window.open
|
||||||
|
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||||
|
openExternalUrl(url);
|
||||||
|
return { action: "deny" };
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openExternalUrl(urlString: string) {
|
function openExternalUrl(urlString: string) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user