Created
March 31, 2022 22:53
-
-
Save SamHoque/04a4afc04999e42c7718b3bb3d556080 to your computer and use it in GitHub Desktop.
Mass Delete Yahoo Mail
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
/** | |
* Yahoo Mass Mail Deleter | |
* @version 1.0.0 | |
* @author Sam Hoque | |
* @description I made this little script due to yahoo only showing me 3 emails at a time out of 1200 mails! and there was no way to get rid of them all quickly. | |
* @license MIT | |
*/ | |
//Save reference to the JQuery dollar sign variable, for some reason this becomes null, so we store it in a variable. | |
const jquery = $; | |
/** | |
* Refresh the mail list, and then select all of the mails and delete them. | |
* Repeat until there is no more mails left. | |
* @returns {Promise<void>} | |
*/ | |
async function refreshAndClearMail() { | |
let refreshBtn = jquery('.n_Z1YKD9t'); | |
refreshBtn.click(); | |
await new Promise(r => setTimeout(r, 2000)); | |
let checkAllBtn = jquery("button[title*='Tickbox, not ticked']"); | |
checkAllBtn.click(); | |
let deleteBTN = jquery('button[title*="Delete the selected messages"]'); | |
deleteBTN.click(); | |
} | |
/** | |
* Run this code every 2 seconds to delete all the mails. | |
*/ | |
setInterval(function () { | |
refreshAndClearMail(); | |
}, 2000); | |
/** | |
* Run the code on page load. | |
*/ | |
refreshAndClearMail(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment