set rel attribute on external links to noreferrer

This commit is contained in:
Jonas Leder 2021-11-09 11:44:18 +01:00
parent e44fbd85b2
commit 3b2d2631f0

View file

@ -3,6 +3,7 @@ document.onreadystatechange = function () {
let href = element.href; let href = element.href;
if(href.indexOf(location.hostname) === -1){ if(href.indexOf(location.hostname) === -1){
element.target = "_blank"; element.target = "_blank";
element.setAttribute("rel", "noreferrer");
} }
}); });
} }