Update externallinks.js
This commit is contained in:
parent
abd0a2d89e
commit
39c03d4eb6
1 changed files with 6 additions and 8 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
var links = document.querySelectorAll('a[href^="https://"], a[href^="http://"]');
|
var links = document.querySelectorAll('a[href^="https://"], a[href^="http://"]');
|
||||||
links.forEach(function(link) {
|
links.forEach(function(link) {
|
||||||
if (!link.href.includes(window.location.hostname)) {
|
if (!link.href.includes(window.location.hostname)) {
|
||||||
|
|
@ -6,4 +5,3 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
link.setAttribute('rel', 'noopener noreferrer');
|
link.setAttribute('rel', 'noopener noreferrer');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
Loading…
Reference in a new issue