Skip to content

Commit

Permalink
prevent paste on middle click, fixes #2995
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Jul 19, 2022
1 parent 61a0397 commit 8902cb3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/public/app/services/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ $(document).on('dblclick', "a", e => {
}
});

$(document).on('mousedown', 'a', e => {
if (e.which === 2) {
// prevent paste on middle click
// https://github.com/zadam/trilium/issues/2995
// https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event#preventing_default_actions
e.preventDefault();
return false;
}
});

export default {
getNotePathFromUrl,
createNoteLink,
Expand Down

0 comments on commit 8902cb3

Please sign in to comment.