Skip to content

Instantly share code, notes, and snippets.

@takano32
Forked from hitode909/random-surf.user.js
Created May 10, 2010 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takano32/395788 to your computer and use it in GitHub Desktop.
Save takano32/395788 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name random-surf
// @namespace http://www.hatena.ne.jp/hitode909
// @include *
// ==/UserScript==
setInterval(function(){
var anchors = document.querySelectorAll('a');
var target = anchors[Math.floor(anchors.length * Math.random())];
location.href = target.href;
}, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment