Skip to content

Commit

Permalink
Revert "Use setWindowOpenHandler instead of new-window"
Browse files Browse the repository at this point in the history
This reverts commit e5ca53f.

ref: electron issue 29509
  • Loading branch information
GarboMuffin committed Jun 22, 2021
1 parent 17a8073 commit 1eb7a0a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,11 @@ app.on('open-file', (event, path) => {
});

app.on('web-contents-created', (event, contents) => {
contents.setWindowOpenHandler((details) => {
if (isSafeOpenExternal(details.url)) {
setImmediate(() => {
shell.openExternal(details.url);
});
contents.on('new-window', (e, url) => {
e.preventDefault();
if (isSafeOpenExternal(url)) {
shell.openExternal(url);
}
return {action: 'deny'};
});
contents.on('will-navigate', (e, url) => {
try {
Expand Down

0 comments on commit 1eb7a0a

Please sign in to comment.