TikTok Autoscroll

Autoscroll videos on tiktok.

目前為 2021-08-23 提交的版本,檢視 最新版本

// ==UserScript==
// @name         TikTok Autoscroll
// @namespace    http://tampermonkey.net/
// @version      0.2.1
// @description  Autoscroll videos on tiktok.
// @author       @Masiosare
// @match        https://www.tiktok.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    function scrollTo(e) {
       console.log(e);
console.log(e.tagName.toLowerCase())
        while(true && e.tagName.toLowerCase() != "body") {
            e = e.parentElement;
            console.log(e.className)
            if(e.className.includes("lazyload-wrapper")){
                console.log("Scrolling to")
                console.log(e.nextSibling)
                e.nextSibling.scrollIntoView();
            break;
            }
        }
    }
    document.addEventListener("DOMNodeInserted", function (e) {


        if (e.target && e.target.tagName && e.target.tagName.toLowerCase() == "video") {

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

                v.target.loop = false;
                v.target.muted = false;
                v.target.controls = true;
                let duration = v.target.duration
                console.log("Scrolling in " + (duration + 3) * 1000);
                setTimeout(function () {

                    scrollTo(v.target)
                }, (duration + 3) * 1000);
            }, false);


        }

    }, false);

})();

QingJ © 2025

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