This commit is contained in:
François Vieille 2016-04-28 01:21:14 +02:00
commit 4d8fde4a61
4 changed files with 23 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.sublime*

14
Js/anywhere.js Normal file
View File

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

1
Js/anywhere.min.js vendored Normal file
View File

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

6
README.md Normal file
View File

@ -0,0 +1,6 @@
## redirect to **random** link in current page
__bookmarklet to install__
to be continued