javascript - setTimeout not working in Greasemonkey user script when JS disabled in browser -
I am working on a project for which my user needs to run on scripts pages because they Javascript is presented without execution. This means that we have to browse with disabling javascript.
I am facing a problem, however, when I try to delay the execution of the function within my script. Whenever I call window.setTimeout
, the function I pass is never executed.
I think this function is actually calling unprotected voice
instead of window, is there a way to resolve it?
When I enable javascript, call setTimeout
should work properly and everything else in my script is working fine without enabling JavaScript.
Help!
Even if Greece's JavaScript goes with high privileges, as Pausi said, SetTimeout
Functions have been added to the JavaScript space of the page - wrapped in a closure as needed. (In normal operation, the Grezamky example often goes to the timer of any timer, which is set, there is a fire.)
Therefore, if the page's main javascript is disabled, the timer will never run .
Possible Action:
-
Use
GM_xmlhttpRequest
as a raw delay. You can set up a page that deliberately pulls your feedback. So like code:GM_xmlhttpRequest ({method: "GET", url: "http://YourTestServer.com/DelayService.php?Seconds=2", onload: function (feedback) {Your Delayed Functions ();}});
will call a utility page that you set up to delay for you.
-
Use NoScript to disable javascript for all pages except for the main page, for example, for the page, YourSite.com/testpage .htm , which includes the script, say, * SpamGenerator.net ... Allow yourSite.com < / Strong>, but block them from SpamGenerator.net .
Comments
Post a Comment