Skip to content

Instantly share code, notes, and snippets.

@cr4m3r
Last active August 8, 2016 02:32
Show Gist options
  • Save cr4m3r/177bb715cd1f5d1145d0e2b655eeab2c to your computer and use it in GitHub Desktop.
Save cr4m3r/177bb715cd1f5d1145d0e2b655eeab2c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name mturk PRE eloader
// @version 1.0
// @include https://www.mturk.com/mturk/*
// @author slothbear
// @description Automatically reloads after Page Request Error
// @grant none
// ==/UserScript==
var content = document.body.textContent || document.body.innerText;
var hasText = content.indexOf("You have exceeded the maximum allowed page request rate for this website.")!==-1;
if(hasText){
var randomTime = Math.floor((Math.random() * 4000) + 1500); //between 1.5 and 4 seconds so multiple pages don't load at once.
setTimeout(function(){
window.location.reload();
},randomTime);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment