From 15d2cbbc8ccf49d2d30dc4edb020d459864c04f9 Mon Sep 17 00:00:00 2001 From: Emma Date: Sat, 8 Oct 2022 16:36:29 -0400 Subject: [PATCH] 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. --- src/renderer/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/App.js b/src/renderer/App.js index 62467cfa..f7447b94 100644 --- a/src/renderer/App.js +++ b/src/renderer/App.js @@ -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)) {