diff --git a/externallinks.js b/externallinks.js index 024d569..d0e2afe 100644 --- a/externallinks.js +++ b/externallinks.js @@ -1,9 +1,7 @@ -document.addEventListener('DOMContentLoaded', function() { - var links = document.querySelectorAll('a[href^="https://"], a[href^="http://"]'); - links.forEach(function(link) { - if (!link.href.includes(window.location.hostname)) { - link.setAttribute('target', '_blank'); - link.setAttribute('rel', 'noopener noreferrer'); - } - }); +var links = document.querySelectorAll('a[href^="https://"], a[href^="http://"]'); +links.forEach(function(link) { + if (!link.href.includes(window.location.hostname)) { + link.setAttribute('target', '_blank'); + link.setAttribute('rel', 'noopener noreferrer'); + } }); \ No newline at end of file