Last active
August 8, 2016 02:32
-
-
Save cr4m3r/177bb715cd1f5d1145d0e2b655eeab2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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