MediaWiki:Common.js: Difference between revisions

From Squidgy
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
   const links = document.querySelectorAll("#bodyContent a.external");
   const links = document.querySelectorAll("a.download-link");
 
   for (const link of links) {
   for (const link of links) {
     link.setAttribute("target", "_blank");
     link.setAttribute("target", "_blank");
     link.setAttribute("rel", "noopener noreferrer");
     link.setAttribute("rel", "noopener noreferrer");
    link.setAttribute("download", "");
   }
   }
});
});

Latest revision as of 20:07, 17 April 2025

document.addEventListener("DOMContentLoaded", function () {
  const links = document.querySelectorAll("a.download-link");

  for (const link of links) {
    link.setAttribute("target", "_blank");
    link.setAttribute("rel", "noopener noreferrer");
    link.setAttribute("download", "");
  }
});