Fix right clicking on links being treated as link clicks (#2355)

This commit is contained in:
absidue 2022-06-30 20:53:15 +02:00 committed by GitHub
parent 8c495ca94b
commit 65d36852ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,14 +334,17 @@ export default Vue.extend({
})
$(document).on('auxclick', 'a[href^="http"]', (event) => {
this.handleLinkClick(event)
// auxclick fires for all clicks not performed with the primary button
// only handle the link click if it was the middle button,
// otherwise the context menu breaks
if (event.button === 1) {
this.handleLinkClick(event)
}
})
},
handleLinkClick: function (event) {
const el = event.currentTarget
console.log(this.usingElectron)
console.log(el)
event.preventDefault()
// Check if it's a YouTube link