Update externallinks.js
This commit is contained in:
parent
abd0a2d89e
commit
39c03d4eb6
1 changed files with 6 additions and 8 deletions
|
|
@ -1,9 +1,7 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var links = document.querySelectorAll('a[href^="https://"], a[href^="http://"]');
|
||||
links.forEach(function(link) {
|
||||
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');
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue