From e73c4d3e020ae21653d31d7981d45d51c477e55b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Vieille?= Date: Sun, 1 May 2016 22:30:38 +0200 Subject: [PATCH] Change code --- Js/anywhere.js | 4 ++-- Js/anywhere.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Js/anywhere.js b/Js/anywhere.js index 390fdbb..ed439cd 100644 --- a/Js/anywhere.js +++ b/Js/anywhere.js @@ -3,7 +3,7 @@ * - naive code - */ -javascript:(function(r = "http://swapthatlink.com", c = document.location.href){ +javascript:(function(r, c){ var l = Array.prototype.slice.call(document.getElementsByTagName('a')), e = new RegExp("^(javascript|mailto|(https?)?" + c + "/?#)"), f = false; @@ -17,4 +17,4 @@ javascript:(function(r = "http://swapthatlink.com", c = document.location.href){ } document.location.href = r; return; -})(); \ No newline at end of file +})("http://swapthatlink.com", document.location.href); \ No newline at end of file diff --git a/Js/anywhere.min.js b/Js/anywhere.min.js index e7d62fb..828ad6d 100644 --- a/Js/anywhere.min.js +++ b/Js/anywhere.min.js @@ -1 +1 @@ -javascript:(function(r="http://swapthatlink.com",c=document.location.href){var l=Array.prototype.slice.call(document.getElementsByTagName('a')),e=new RegExp("^(mailto|(https?)?"+c+"/?#)"),f=false;while(!f&l.length>0){i=Math.floor(Math.random()*l.length);if(e.test(l[i].href)||l[i].href==c)l.splice(i,1);else{r=l[i].href;f=true}}document.location.href=r;return})(); \ No newline at end of file +javascript:(function(t,e){for(var a=Array.prototype.slice.call(document.getElementsByTagName("a")),o=new RegExp("^(javascript|mailto|(https?)?"+e+"/?#)"),n=!1;!n&a.length>0;)i=Math.floor(Math.random()*a.length),o.test(a[i].href)||a[i].href==e?a.splice(i,1):(t=a[i].href,n=!0);document.location.href=t})("http://swapthatlink.com",document.location.href); \ No newline at end of file