Last active
December 19, 2022 15:34
-
-
Save abnersajr/fb197c23ce18e3c406824276a687850b to your computer and use it in GitHub Desktop.
batch-password-change
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
function sleep(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
} | |
const get_emails = Array.from( | |
document.querySelectorAll("[id^='account-name_']") | |
).map((item) => item.innerText); | |
const process_buttons = (emails) => { | |
const email = emails.pop(); | |
document | |
.querySelector(`button[id='email_table_disk_and_quota_${email}']`) | |
.click(); | |
sleep(1800) | |
.then(() => { | |
$("#txtEmailPassword").val("migrate1020").change(); | |
}) | |
.then(() => sleep(400)) | |
.then(() => { | |
document.getElementById("btnUpdateEmailEmailAccount").click(); | |
}) | |
.then(() => sleep(1800)) | |
.then(() => { | |
if (emails.length > 0) { | |
process_buttons(emails); | |
} | |
}); | |
}; | |
process_buttons(get_emails); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment