你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/473972-youtube-js-engine-tamer,源站連結 點此以跳轉

YouTube JS Engine Tamer

To enhance YouTube performance by modifying YouTube JS Engine

当前为 2023-09-18 提交的版本,查看 最新版本



點此查看下載連結位址https://update.greasyfork.org.cn/scripts/473972/1252161/YouTube%20JS%20Engine%20Tamer.user.js

安装此脚本?
作者
𝖢𝖸 𝖥𝗎𝗇𝗀
评分
0 0 0
版本
0.4.11
创建于
2023-08-26
更新于
2023-09-18
大小
57.4 KB
许可证
MIT
适用于

YouTube JS Engine Tamer

Please make sure you install the script from greasyfork.org, not fake sites.

This script changes core mechanisms of the YouTube JS engine.

This script is experimental and subject to further changes.

This might boost your YouTube performance.

CAUTION: This might break your YouTube.

Note: PERF_471489_ option

  • This PERF_471489_ option refers to @nopeless's Youtube Player perf
  • The idea was good but the implementation was buggy.
  • I use a more gentle way to deal with the function to make sure no visual difference in daily usage.
  • Not performance guarantee as that script.

Technical Information quoted from from Youtube Player perf

g: the youtube player object

g.update calls g.updateValue and this is used to change aria-* for the progress bar (as well as other things)

My script adds a cache to this to check for changing values. It marks dirty=true if a value is changed. For example, if you are watching at 1:30 mark, then this value is updated to the same value, "1:30" every time you have a new frame. If you get 1:31, a variable is marked dirty and the userscript considers updating the progress bar.

g.Un is used to change the progress bar's transform (which is both a css and dom reflow, Yuck!) so this is suppressed until dirty is true. There are exactly 4 transforms used for the progress bar update, and its sequential. We can shave a few more cpu resources by checking the count of this function call instead of checking the names.

This has an effect of updating the progress bar every 1 second. As a great side effect of my amazing code the progress bar is updated on the same frame as the timestamp is updated, so it updates EXACTLY once per second, nice!

Note: The information described might not be 100% correct. This is just what nopeless discovered.