var n = 0;
function loop() {
location.hash = f[Math.floor((Date.now()/100)%f.length)];
if (n++ > f.length) {
n = 0;
window.history.go(-f.length);
}
setTimeout(loop, 50);
}
This actually doesn't work properly and jumps back too far sometimes because the URLs move with time and not a counter, but you get the idea.