gpt4 book ai didi

特定页面集的 Javascript 页面加载延迟

转载 作者:行者123 更新时间:2023-11-30 10:51:26 24 4
gpt4 key购买 nike

我想使用一个小的 greasemonkey 脚本延迟一组特定的网页。基本上,如果正在加载的网站是一组页面的一部分,那么我想延迟加载页面所需的时间。例如如果正在加载的页面是“http://www.a.com/”、“http://www.a.com/b”等,那么我想将加载延迟 30 秒。

最佳答案

假设 Dushara 的评论是正确的:

"See xkcd.com/862 for what the poster wants. (Hover the mouse over the image to see the reasoning). In fact, I found this question while googling for exactly the same thing."

那么这在 Greasemonkey 中是不可能的。原因是 GM 在页面加载后触发(任何缓慢的图片或 AJAX 调用除外)。所以用户会看到该页面,然后它会闪烁空白 30 秒......但是,只有在快速眼球看到太多之后。 ;)

更新:现在这在 Greasemonkey 中是可能的(使用 @run-at document-start 指令——2011 年 8 月添加)。参见 this answer for an example .


请注意,XKCD 的创建者使用良好的老式意志力来实现他的“简单的 30 秒延迟”。来自 his blog entry :

"Lots of people have asked me for the system I used to implement the restriction in the alt-text of today’s comic.
...
I made it a rule that as soon as I finished any task, or got bored with it, I had to power off my computer."

另请参阅:"Browser extension (or other software) to delay page load" -- 现在有指向人们为此创建的适当扩展的链接。

关于特定页面集的 Javascript 页面加载延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5043263/

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