Last active
August 25, 2022 06:43
-
-
Save tobias-khs/ba3819a761c905a58a74379f7f100fd4 to your computer and use it in GitHub Desktop.
Bookmarklet to make the current YouTube video loop indefinitely. Also starts the video.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){var duration=()=>{var dr=document.getElementsByClassName('ytp-time-duration')[0].textContent.split(':');var dur=parseInt(dr[0])*60+parseInt(dr[1]-2);return dur*1000};var ke=(keyCode)=>document.body.dispatchEvent(new KeyboardEvent('keydown',{bubbles:true,cancelable:true,keyCode}));var lop=()=>ke(48);setInterval(lop,duration());ke(32)})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment