We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc239ad commit 8ca8875Copy full SHA for 8ca8875
1 file changed
src/docs/_static/script.js
@@ -48,6 +48,7 @@ document.addEventListener('DOMContentLoaded', function () {
48
showTotalRecords();
49
attachSearch();
50
filterPaginatedData();
51
+ externalLinksOpenNewTab();
52
lastUpdated();
53
})
54
});
@@ -366,3 +367,18 @@ function renderCards(data) {
366
367
}
368
369
370
+
371
+function externalLinksOpenNewTab() {
372
373
+ const hyperlinks = document.querySelectorAll("a[href^='https://'], a[href^='http://']");
374
+ const host = window.location.hostname;
375
+ const internalLink = link => new URL(link).hostname === host
376
377
+ hyperlinks.forEach(link => {
378
+ if (internalLink(link)) return
379
+ link.setAttribute("target", "_blank")
380
+ link.setAttribute("rel", "noopener")
381
+ })
382
383
+};
384
0 commit comments