Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test for Greasemonkey issue #1921
// ==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
You can’t perform that action at this time.