Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


setTimeout broken again in 1.0 #1620

peci1 opened this Issue · 7 comments

3 participants


Hello, bad news... setTimeout() ceased working for me after update to 1.0

I tried setting:
@grant none
@grant GM_util
@grant GM_util.timeout
@grant setTimeout
none of which work.

Thanks for any help ;)


You're going to need to be much more specific; works fine for me.

Provide a link to an exact script, the shorter the better, that doesn't work for you. (Plus, setTimeout is not a Greasemonkey API, so @grant is unrelated.)


Okay, here is a sample code:

// ==UserScript==
// @name        test
// @namespace
// @include
// @grant GM_util
// @grant GM_util.timeout
// @version     1
// ==/UserScript==
setTimeout('alert("test2")', 500);

The string "test1" is shown, whereas "test2" is never shown.


@peci1, your test script would probably work if you used @grant none, and no other grants.

However, that is a poor way to use setTimeout. Avoid "eval" strings whenever you can.

A more proper usage, will also work irregardless of the @grant settings.

//-- Traditional
setTimeout ( function () {
    alert ("test2");
    }, 500

//-- Okay for most modern browsers (certainly for Greasemonkey)
setTimeout (alert, 500, "test2");

The issue originally from #1318 is indeed happening in the @grant none case. The underlying Firefox bug is fixed and slated to be released in Firefox 16.

Otherwise, in 15, I am indeed seeing strange behavior that I've yet to 100% explain.



// ==UserScript==
// @name        _del5
// @namespace   _pc
// @include*
// @grant       none
// ==/UserScript==

setTimeout('alert("test2")', 500);

works fine for me.

(FF 15.0, GM 1.0, Win XP)


Seems to be a little bit weird.

The script from @BrockA works fine.

My script works well on most pages (after changing the include clause), but when I run it a lot of times, then the second alert stops working. Even duplicating the tab with bad behavior helps, the duplicated page shows two alerts.

Most of my setTimeout statements have started to work as expected yesterday (but I don't know of a recent update to FF or GM).


Test script:

Behaves as expected (setTimeout broken after alert); the bug from issue #1318 is back in the grant-none mode. If I edit none to GM_log, then it works again as expected (I see three alerts).

If I edit the setTimeout lines, then in the legacy case I see one global-model alert, then two tab-modal alerts (not exactly broken, but admittedly weird; this will go away in Firefox 16). If I then go back to grant none, I see one tab-modal alert, and then still brokenness as expected.

@arantius arantius closed this issue from a commit
Commit has since been removed from the repository and is no longer available.
@arantius arantius closed this in 9acad2d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.