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:
parent
ae1cd71d3b
commit
2997cf8daf
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user