cyfung1031 / userscript-supports

This is for the userscripts created on GreasyFork.org.
https://cyfung1031.github.io/userscript-supports/
MIT License
48 stars 3 forks source link

[YouTube JS Tamer] Review Memory Leakage #46

Closed cyfung1031 closed 1 month ago

cyfung1031 commented 2 months ago

List of Possible Sources

Yt Code Leakage

      , BHb = function(a, b, c) {
        document.querySelectorAll("ytd-playlist-video-renderer").forEach(function(d, e) {
            d.style.viewTransitionName = "ytd-playlist-video-renderer-" + String(e)
        });
        document.startViewTransition(function() {
            var d = document.querySelectorAll("ytd-playlist-video-renderer")[b];
            d.remove();
            var e = document.querySelectorAll("ytd-playlist-video-renderer");
            c === 0 ? e[c].before(d) : e[c - 1].after(d)
        }).finished.then(function() {
            document.querySelectorAll("ytd-playlist-video-renderer").forEach(function(g) {
                g.style.viewTransitionName = ""
            });
            var d = b > c ? "up" : "down"
              , e = Math.abs(b - c);
            e > a.clientHeight / 112 && DHb(e, d)
        })
    }