gpt4 book ai didi

greasemonkey - setTimeout 在 Greasemonkey 中并不总是有效

转载 作者:行者123 更新时间:2023-12-04 04:21:11 33 4
gpt4 key购买 nike

我发现了很多类似的问题,但没有一个是平等的,也没有正确的解决方案。这是一个非常奇怪的问题。

我有一个简单的 Greasemonkey 脚本来测试这个问题:

// ==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();

这是 Firebug 的输出:
start
wait
wait
wait
wait

wait() 函数被调用 4 次然后停止。如果我将超时设置为 100 毫秒,调用似乎工作至少 10/15 秒然后停止。

我正在使用:
火狐 12.0
油猴 0.9.19

最佳答案

这是 Greasemonkey 0.9.19 中的一个错误。
添加了一项功能以允许 setTimeout()即使页面的 JS 被禁用并引入了一些并发症(问题 154915521553 等)也能正常工作。

它应该会在 0.9.20 版中很快得到解决,或者恢复到 0.9.18 版。

关于greasemonkey - setTimeout 在 Greasemonkey 中并不总是有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10553274/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com