mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Protect against phishing attacks on target _blank links.
This commit is contained in:
parent
b73540bd7d
commit
7a62b4ab46
|
@ -185,6 +185,7 @@
|
||||||
function upgradeAnchors() {
|
function upgradeAnchors() {
|
||||||
Array.from(document.getElementsByTagName('a')).forEach($link => {
|
Array.from(document.getElementsByTagName('a')).forEach($link => {
|
||||||
if ($link.hostname !== window.location.hostname) {
|
if ($link.hostname !== window.location.hostname) {
|
||||||
|
$link.setAttribute('rel', 'noopener noreferrer');
|
||||||
$link.setAttribute('target', '_blank');
|
$link.setAttribute('target', '_blank');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user