Protect against phishing attacks on target _blank links.

This commit is contained in:
David Russell 2017-12-22 14:40:48 +07:00
parent b73540bd7d
commit 7a62b4ab46

View File

@ -185,6 +185,7 @@
function upgradeAnchors() {
Array.from(document.getElementsByTagName('a')).forEach($link => {
if ($link.hostname !== window.location.hostname) {
$link.setAttribute('rel', 'noopener noreferrer');
$link.setAttribute('target', '_blank');
}
});