MediaWiki:Common.js: Difference between revisions

From Squidgy
Jump to navigation Jump to search
Created page with "Any JavaScript here will be loaded for all users on every page load.: document.addEventListener("DOMContentLoaded", function () { const links = document.querySelectorAll("#bodyContent a.external"); for (const link of links) { link.setAttribute("target", "_blank"); link.setAttribute("rel", "noopener noreferrer"); } });"
 
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
   const links = document.querySelectorAll("#bodyContent a.external");
   const links = document.querySelectorAll("#bodyContent a.external");

Revision as of 20:00, 17 April 2025

document.addEventListener("DOMContentLoaded", function () {
  const links = document.querySelectorAll("#bodyContent a.external");
  for (const link of links) {
    link.setAttribute("target", "_blank");
    link.setAttribute("rel", "noopener noreferrer");
  }
});