fluoride: Use target=_blank for status links

This commit is contained in:
r 2020-06-21 16:48:33 +00:00
parent 626369c317
commit 1936044137

View File

@ -186,6 +186,12 @@ function handleReplyLink(div) {
}
}
function handleStatusLink(a) {
if (a.classList.contains("mention"))
return;
a.target = "_blank";
}
document.addEventListener("DOMContentLoaded", function() {
var statuses = document.querySelectorAll(".status-container");
for (var i = 0; i < statuses.length; i++) {
@ -205,6 +211,11 @@ document.addEventListener("DOMContentLoaded", function() {
for (var j = 0; j < replyLinks.length; j++) {
handleReplyLink(replyLinks[j]);
}
var links = s.querySelectorAll(".status-content a");
for (var j = 0; j < links.length; j++) {
handleStatusLink(links[j]);
}
}
});