TikTok Autoscroll

try to take over the world!

目前为 2020-08-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         TikTok Autoscroll
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       @Masiosare
// @match        https://www.tiktok.com/foryou?lang=en
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    function scrollTo(e) {

        e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.nextSibling.scrollIntoView()

    }

    document.addEventListener("DOMNodeInserted", function (e) {
        if (e.target.tagName == "VIDEO") {

            e.target.addEventListener('loadeddata', function (v) {

                v.target.loop = false;
                v.target.muted = false;
                let duration = v.target.duration
                console.log("Scrolling in " + duration * 1000);
                setTimeout(function () {
                    scrollTo(v.target)
                }, duration * 1000);
            }, false);


        }

    }, false);

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址