DEV: adds noopener rel to external links

DEV: adds noopener rel to external links

If a link is set to open in a new tab, automatically add rel="noopener" to it.

diff --git a/javascripts/discourse/initializers/initialize-for-header-icon-links.js b/javascripts/discourse/initializers/initialize-for-header-icon-links.js
index 2641e4f..13bd554 100644
--- a/javascripts/discourse/initializers/initialize-for-header-icon-links.js
+++ b/javascripts/discourse/initializers/initialize-for-header-icon-links.js
@@ -17,6 +17,7 @@ export default {
           const className = `header-icon-${dasherize(fragments[0])}`;
           const viewClass = fragments[3].toLowerCase();
           const target = fragments[4].toLowerCase() === "blank" ? "_blank" : "";
+          const rel = target ? "noopener" : "";
           const isLastLink =
             link === links[links.length - 1] ? ".last-custom-icon" : "";
           const selector = `li.custom-header-icon-link.${className}.${viewClass}${isLastLink}`;
@@ -29,6 +30,9 @@ export default {
                   href,
                   title,
                   target,
+                  attributes: {
+                    rel,
+                  },
                 },
                 icon
               ),

GitHub sha: 21687683db77023d3caad868d3235ede0174c55b