Skip to content

Commit

Permalink
Desktop: Fixes #3287: Disable middle-clicking external URLs, as they …
Browse files Browse the repository at this point in the history
…would open inside the application
  • Loading branch information
laurent22 committed Jun 3, 2020
1 parent 0ee3703 commit da77de0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ElectronClient/gui/note-viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,12 @@
updateBodyHeight();
}));

// Prevent middle-click as that would open the URL in an Electron window
// https://github.com/laurent22/joplin/issues/3287
window.addEventListener('auxclick', webviewLib.logEnabledEventHandler((event) => {
event.preventDefault();
}));

updateBodyHeight();
} catch (error) {
ipcProxySendToHost('error:' + JSON.stringify(webviewLib.cloneError(error)));
Expand Down

0 comments on commit da77de0

Please sign in to comment.