简体   繁体   English

有没有办法使用 greasemonkey 在第 3 方站点上暂停(然后取消暂停)所有正在运行的 js 脚本?

[英]is there a way to pause (and later unpause) all running js scripts on a 3rd party site using greasemonkey?

tl;dr -- is this possible to pause or stop all running js on the page, using greasemonkey? tl;dr——是否可以使用 greasemonkey 暂停或停止页面上所有正在运行的 js?

here is the situation: i hate how, when watching videos on fb, they stutter.情况是这样的:我讨厌在 Facebook 上看视频时,他们口吃。 i am 99% sure the stutter is caused by the excessive amounts of js running in the background (providing all the realtime page updates)我 99% 确定卡顿是由后台运行的过多 js 造成的(提供所有实时页面更新)

here is what i want to do: create some code that will pause all js execution (i will attach it to a button or possibly autodetect when a video is playing) -- and then later resume execution (after video is done)(this part is not essential, i can always reload the page)这是我想做的:创建一些代码来暂停所有 js 执行(我将它附加到一个按钮或可能在播放视频时自动检测)——然后稍后恢复执行(视频完成后)(这部分不是必需的,我可以随时重新加载页面)

Now i know i can use an addon like noscript to pause-unpause but it would be nice if i could have something automagic (and alot more slimline)现在我知道我可以使用像 noscript 这样的插件来暂停-取消暂停,但如果我能有一些自动化的东西(并且更苗条),那就太好了

No, there is no easy general-purpose Greasemonkey solution to stop or block the execution of a web page's scripts.不,没有简单的通用 Greasemonkey 解决方案来停止或阻止 web 页面脚本的执行。 Greasemonkey can add, but not remove, javascript. Opera's way beefier User Javascript system can do both. Greasemonkey 可以添加,但不能删除,javascript。Opera 的方式更强大 用户 Javascript 系统可以做到这两点。

/ Greasemonkey co-maintainer / Greasemonkey 共同维护者

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM