Skip to content

Instantly share code, notes, and snippets.

@gdlmx
Last active October 6, 2023 02:07
Show Gist options
  • Save gdlmx/b7fe3b02e781c2fa6b651aab17c36a8f to your computer and use it in GitHub Desktop.
Save gdlmx/b7fe3b02e781c2fa6b651aab17c36a8f to your computer and use it in GitHub Desktop.
Google Doc autoplay
var jumpto = (i , n)=>{
var evt = new Event("blur", {"bubbles":true, "cancelable":false});
var sldnr = document.querySelector('input.a-b-La-su-vb') ;
sldnr.value = `${i}`;
console.log(`jumping to ${i}, ${n} , ${sldnr.getAttribute('aria-label')}`);
sldnr.dispatchEvent(evt);
if(i<n){
setTimeout(() => {
jumpto(i+1, n);
}, 1500);
}
}
var click_next = (i , n)=>{
var evt = new Event("click", {"bubbles":true, "cancelable":false});
var sldnr = document.querySelector('div#entity-page-next') ;
sldnr.dispatchEvent(evt);
if(i<n){
setTimeout(() => {
click_next(i+1, n);
}, 1500);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment