Skip to content

Commit

Permalink
Merge pull request #5 from arhh/block-child-windows
Browse files Browse the repository at this point in the history
Block child windows
  • Loading branch information
arhh authored Mar 6, 2024
2 parents fb4ed9f + 84b2a0a commit 856ca13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ const createWindow = () => {
icon: 'resources/material_apps.png',
});

// Same behaviour as win.webContents.loadURL(...)
win.loadURL(config.appUrl);

win.once('ready-to-show', () => {
win.setTitle(config.title);
win.show()
})

// Load contents of new windows in main window instead.
// Avoids desktop clutter
win.webContents.setWindowOpenHandler((details) => {
win.loadURL(details.url);
return {action: 'deny'};
})
}

app.whenReady().then(() => {
Expand Down

0 comments on commit 856ca13

Please sign in to comment.