Created
July 31, 2014 14:37
-
-
Save arantius/459b381eb0ae487e7f4f to your computer and use it in GitHub Desktop.
Test for Greasemonkey issue #1921
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 setTimeout parameter test | |
// @include http* | |
// @grant GM_log | |
// ==/UserScript== | |
function countdown(remaining) { | |
document.title = remaining + " seconds left until reload"; | |
if (remaining <= 0) { | |
window.location.reload(); | |
} else { | |
window.setTimeout(countdown, 1000, remaining - 1); | |
} | |
} | |
countdown(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment