Greasy Fork is available in English.
try to take over the world!
当前为
// ==UserScript==
// @name TikTok Autoscroll
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author @Masiosare
// @match https://www.tiktok.com/*
// @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;
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);
})();