1(function ($, drupalSettings) { 2 Drupal.behaviors.extlinkRelFix = { 3 attach() { 4 const externalLinks = document.querySelectorAll("a.ext"); 5 6 externalLinks.forEach((link) => { 7 if ( 8 drupalSettings.data.extlink.extExcludeNoreferrer && 9 new RegExp(drupalSettings.data.extlink.extExcludeNoreferrer).test( 10 link.getAttribute("href"), 11 ) 12 ) { 13 return; 14 } 15 16 const rel = link.getAttribute("rel") || ""; 17 const relParts = rel.split(/\s+/); 18 if (!relParts.includes("noopener")) { 19 relParts.push("noopener"); 20 } 21 22 link.setAttribute("rel", relParts.join(" ").trim()); 23 }); 24 }, 25 }; 26})(jQuery, drupalSettings);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.