commit 4d8fde4a61f98608ca275568dab4cfbfce9dbb2f Author: François Vieille Date: Thu Apr 28 01:21:14 2016 +0200 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..05e8eda --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.sublime* + diff --git a/Js/anywhere.js b/Js/anywhere.js new file mode 100644 index 0000000..3ca0132 --- /dev/null +++ b/Js/anywhere.js @@ -0,0 +1,14 @@ +/** + * Redirect to a "random" link in current page + * - naive code - + */ + +javascript:(function(){ + var l = Array.prototype.slice.call(document.getElementsByTagName('a')); + for(var i = l.length-1;i>=0;i--){ + if(/^(#|mailto)/.test(l[i].href.slice(0,1))||l[i].href==document.location.href)l.splice(i,0); + }; + r=l[Math.floor(Math.random()*l.length)].href; + console.log(r); + document.location.href=r; +})(); \ No newline at end of file diff --git a/Js/anywhere.min.js b/Js/anywhere.min.js new file mode 100644 index 0000000..62a7d01 --- /dev/null +++ b/Js/anywhere.min.js @@ -0,0 +1 @@ +javascript:(function(){var l=Array.prototype.slice.call(document.getElementsByTagName('a'));for(var i=l.length-1;i>=0;i--){if(/^(#|mailto)/.test(l[i].href.slice(0,1))||l[i].href==document.location.href)l.splice(i,0)};r=l[Math.floor(Math.random()*l.length)].href;console.log(r);document.location.href=r})(); \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..560ad7c --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +## redirect to **random** link in current page + __bookmarklet to install__ + + to be continued + + \ No newline at end of file