mirror of
https://github.com/tcsenpai/Zundler.git
synced 2025-06-07 03:55:26 +00:00
Open external links in new tab
This commit is contained in:
parent
74fc46e1d9
commit
d5b30f9f52
@ -91,6 +91,10 @@ var fix_link = function(a) {
|
|||||||
a.addEventListener('click', virtual_click);
|
a.addEventListener('click', virtual_click);
|
||||||
} else if (a.getAttribute('href').startsWith('#')) {
|
} else if (a.getAttribute('href').startsWith('#')) {
|
||||||
a.setAttribute('href', "about:srcdoc" + a.getAttribute('href'))
|
a.setAttribute('href', "about:srcdoc" + a.getAttribute('href'))
|
||||||
|
} else {
|
||||||
|
// External links should open in a new tab. Browsers block links to
|
||||||
|
// sites of different origin within an iframe for security reasons.
|
||||||
|
a.setAttribute('target', "_blank");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user