Last active
December 21, 2024 10:32
-
-
Save yyaremenko/4d88efc5e5db96af30a6cd3dc5533770 to your computer and use it in GitHub Desktop.
Reset Udemy course progress
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
// run this script in the Developer Tools' Console | |
// in the browser of your choice | |
let panelsSelector = '.ct-sidebar-course-content .ud-accordion-panel-toggler'; | |
let checkboxesSelector = '.ct-sidebar-course-content li input[type=checkbox]:checked'; | |
let click = function(selector) { | |
console.log('CLICKING...'); | |
let elems = document.querySelectorAll(selector); | |
elems.forEach(function(item, i) { | |
setTimeout(function() { | |
item.click(); | |
}, i * 50) | |
}) | |
console.log('DONE, clicked total '+elems.length+' items'); | |
} | |
let clearAll = function() { | |
// expanding all panels before unchecking checkboxes is a must | |
click(panelsSelector); | |
// make sure to give enough time for all panels to expand | |
setTimeout(function() { | |
click(checkboxesSelector); | |
}, 1000); | |
} | |
clearAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment