SetTimeout does not always work in Greasemonkey

I found many similar problems, but not a single equal and correct solution. This is a very strange problem.

I have a simple Greasemonkey script to check the problem:

// ==UserScript==
// @name        testdiddio
// @namespace   http://userscripts.org/users/useridnumber
// @include     https://www.google.it/
// @version     1
// ==/UserScript==


function wait(){
    console.info("wait");
    setTimeout(wait,1000);
}

console.info("start");
wait();

This is the result of firebug:

start
wait
wait
wait
wait

The wait () function is called 4 times and then stops. If I set Timeout to 100 ms, the call seems to work for at least 10/15 seconds and then stops.

I use: Firefox 12.0 Greasemonkey 0.9.19

+4
source share
1 answer

Greasemonkey 0.9.19.
​​, setTimeout(), JS , ( 1549, 1552 1553 ..).

0.9.20 0.9.18.

+6

All Articles