您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Autoscroll videos on tiktok.
当前为
// ==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); })();