TikTok: stop auto-advancing the feed
Makes a finished video loop in place instead of auto-jumping to the next one.
Code to copy
// Stop a finished video from auto-advancing; keep it looping instead
function holdVideo() {
document.querySelectorAll('video').forEach(function (v) {
if (!v.dataset.jzHold) {
v.dataset.jzHold = '1';
v.loop = true;
v.addEventListener('ended', function (e) {
e.stopImmediatePropagation();
v.currentTime = 0;
v.play().catch(function () {});
}, true);
}
});
}
holdVideo();
const obs = new MutationObserver(holdVideo);
obs.observe(document.documentElement, { childList: true, subtree: true });
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.