Skip to content

Instantly share code, notes, and snippets.

@limitedeternity
Last active September 1, 2023 13:53
Show Gist options
  • Save limitedeternity/53cf1a80e2e54eb2c219e261f448e3e0 to your computer and use it in GitHub Desktop.
Save limitedeternity/53cf1a80e2e54eb2c219e261f448e3e0 to your computer and use it in GitHub Desktop.
Repeat YouTube video automatically
(async () => {
while (true) {
let el = document.querySelector('button[data-title-no-tooltip="Повторить"]');
if (el) {
let evt = new Event("click");
el.dispatchEvent(evt);
} else {
await new Promise(resolve => setTimeout(resolve, 2000));
}
}
})();
@limitedeternity
Copy link
Author

limitedeternity commented Dec 14, 2018

javascript:(async()=>{for(;;){let t=document.querySelector('button[data-title-no-tooltip="Повторить"]');if(t){let e=new Event("click");t.dispatchEvent(e)}else await new Promise(t=>setTimeout(t,2e3))}})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment