Skip to content

Commit

Permalink
refactor: new-window event removal
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Jun 13, 2024
1 parent bdc6592 commit 534711e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/webui/open-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ module.exports = function () {
}
})

contents.on('new-window', (event, url) => {
event.preventDefault()
// handling external links
contents.setWindowOpenHandler(({ url }) => {
// open in external URL handler (user's default web browser)
shell.openExternal(url)
// do not open in Electron itself
return { action: 'deny' }
})
})
}

0 comments on commit 534711e

Please sign in to comment.