From 986b3e128cdc0cadaa988e5409d15b1763b502f8 Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Tue, 4 Jun 2019 21:38:20 +0200 Subject: Add js, but don't use it, to open all post links in new tab --- assets/js/extLinks.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 assets/js/extLinks.js (limited to 'assets/js/extLinks.js') diff --git a/assets/js/extLinks.js b/assets/js/extLinks.js new file mode 100644 index 0000000..f2ca231 --- /dev/null +++ b/assets/js/extLinks.js @@ -0,0 +1,7 @@ +var elems = document.getElementsByTagName("a"); +var extLinkElems = Array.prototype.filter.call(elems, (a) => a.classList.length == 0); +extLinkElems.forEach(a => { + a.setAttribute("target", "_blank"); + a.setAttribute("rel", "noreferrer"); +}); + -- cgit v1.2.3