Browse Source

Change code

François Vieille 2 years ago
parent
commit
e73c4d3e02
2 changed files with 3 additions and 3 deletions
  1. 2 2
      Js/anywhere.js
  2. 1 1
      Js/anywhere.min.js

+ 2 - 2
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;
-})();
+})("http://swapthatlink.com", document.location.href);

+ 1 - 1
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})();
+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);