Fixing the logic for isExternalLink (#2687)
`.href` is computed from the real value of the attribute, and this was causing an issue where isExternalLink would classify links that should not be external links as external links.
This commit is contained in:
+1
-1
@@ -320,7 +320,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
openAllLinksExternally: function () {
|
||||
const isExternalLink = (event) => event.target.tagName === 'A' && event.target.href.startsWith('http')
|
||||
const isExternalLink = (event) => event.target.tagName === 'A' && !event.target.href.startsWith(window.location.origin)
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
if (isExternalLink(event)) {
|
||||
|
||||
Reference in New Issue
Block a user