massgrave.dev/links.js
2023-01-11 16:49:43 +05:30

5 lines
165 B
JavaScript

(function() {
for (const link of document.getElementsByTagName('a')) {
if (/^(https?:)?\/\//.test(link.getAttribute('href'))) link.target = '_blank';
}
})();