From 72e2b313413a7659d7f15472f29e8a5cd4a1fc95 Mon Sep 17 00:00:00 2001 From: aitzol Date: Fri, 5 Mar 2021 16:10:09 +0100 Subject: [PATCH] Update 'README.md' --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b205e95..3287e07 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,17 @@ https://apunteak.lainoa.eus/post6035433e2a78d6208795d0c7 ## Test node index.js -[localhost:8080](http:localhost:8080){target="_blank"} \ No newline at end of file +[localhost:8080](http:localhost:8080){target="_blank"} + +(function() { + var links = document.links; + for (var i = 0, linksLength = links.length; i < linksLength; i++) { + if (links[i].hostname != window.location.hostname) { + links[i].target = "_blank"; + links[i].setAttribute("rel", "noopener noreferrer"); + links[i].className += " externalLink"; + } else { + links[i].className += " localLink"; + } + } +})(); \ No newline at end of file