Created
October 24, 2020 02:40
-
-
Save sbolel/7244b0c8f823d747f6d8add70cc77745 to your computer and use it in GitHub Desktop.
Google Voice Deletion Script
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
/** | |
* Script that deletes all Google Voice items visible in the current list. | |
* @param {number} timeout - milliseconds to wait between each dialog opening. | |
* @usage copy and paste into JS console. | |
*/ | |
(function(timeout){ | |
const getConfirm = () => document.querySelector('[gv-test-id="dialog-confirm-button"]') | |
const getDelete = () => document.querySelector('[icon-name="delete"]') | |
const getFirst = () => document.querySelector('[gv-test-id="conversation-avatar-or-checkmark"]') | |
const getRest = () => document.querySelectorAll('div[md-virtual-repeat]').splice(0, 1) | |
const getFifthChild(node) => node.children[0].children[0].children[0].children[0].children[0] | |
setInterval(() => { | |
getFirst().click() | |
setTimeout(() => getRest().forEach((value) => getFifthChild(value).click(), timeout) | |
setTimeout(() => getDelete().click(), timeout) | |
setTimeout(() => getConfirm().click(), timeout) | |
}, 2000) | |
})(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment