[MM-50409] Stop the main window from creating its own uncontrolled child windows (#2549)

This commit is contained in:
Devin Binnie
2023-02-09 09:04:02 -05:00
committed by GitHub
parent 6dca4a5095
commit 8dbdb0a75e
2 changed files with 10 additions and 0 deletions

View File

@@ -215,6 +215,9 @@ export class WindowManager {
this.mainWindow.on('enter-full-screen', () => this.sendToRenderer('enter-full-screen'));
this.mainWindow.on('leave-full-screen', () => this.sendToRenderer('leave-full-screen'));
// Should not allow the main window to generate a window of its own
this.mainWindow.webContents.setWindowOpenHandler(() => ({action: 'deny'}));
if (process.env.MM_DEBUG_SETTINGS) {
this.mainWindow.webContents.openDevTools({mode: 'detach'});
}