Skip to content

Instantly share code, notes, and snippets.

@tuantmb
Forked from Esirei/auto-next.js
Created March 5, 2021 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuantmb/f48b914a6db040ee1d73fc51782310c6 to your computer and use it in GitHub Desktop.
Save tuantmb/f48b914a6db040ee1d73fc51782310c6 to your computer and use it in GitHub Desktop.
Pluralsight AutoNext Module
let autoNext = () => {
const modal = document.getElementsByClassName('player-modal is-active');
if (modal.length > 0) {
// const buttons = document.querySelectorAll('[data-css-176v989]');
const buttons = document.getElementsByClassName('u-full-width');
console.log('checking...', buttons.length);
for (let i = 0; i < buttons.length; i++) {
const button = buttons[i];
console.log(button.textContent);
if (button.textContent === 'Continue to next module') {
console.log('Next module!');
button.click();
}
}
}
};
setInterval(autoNext, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment