chore: use webContents.setWindowOpenHandler() in default-app (#34308)
This commit is contained in:
parent
9d3fc9c794
commit
6667de28e3
1 changed files with 3 additions and 3 deletions
|
@ -66,9 +66,9 @@ async function createWindow (backgroundColor?: string) {
|
|||
mainWindow = new BrowserWindow(options);
|
||||
mainWindow.on('ready-to-show', () => mainWindow!.show());
|
||||
|
||||
mainWindow.webContents.on('new-window', (event, url) => {
|
||||
event.preventDefault();
|
||||
shell.openExternal(decorateURL(url));
|
||||
mainWindow.webContents.setWindowOpenHandler(details => {
|
||||
shell.openExternal(decorateURL(details.url));
|
||||
return { action: 'deny' };
|
||||
});
|
||||
|
||||
mainWindow.webContents.session.setPermissionRequestHandler((webContents, permission, done) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue