Created
October 24, 2018 19:12
-
-
Save liamness/4e9ded403b419e33071be0e9b6e3f7d2 to your computer and use it in GitHub Desktop.
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
/* | |
Google currently don't offer a way to easily delete all the passwords that you have saved with them. | |
So if you need to do that, here is a thing that does that. | |
Just browse to passwords.google.com, log in, and paste the following into the console. | |
Of course, posting things you found on the internet into the console is usually a bad idea. | |
*/ | |
(() => { | |
let currentButton | |
const intervalId = setInterval(() => { | |
const button = document.querySelector('div[aria-label^="Remove "]') | |
if (!button) { | |
console.log('Nothing more to delete, woo'); | |
clearInterval(intervalId); | |
} else if (button === currentButton) { | |
console.log('Do nothing, still deleting current password'); | |
} else { | |
console.log(`Deleting ${button.parentElement.parentElement.textContent}...`); | |
currentButton = button | |
button.click(); | |
} | |
}, 200); | |
})(); |
This doesn't work for me at https://passwords.google.com/
It's been ages since I wrote this script, probably the markup changed in the meantime. You can also remove all your passwords by deleting them in Chrome's settings, and then syncing the changes.
This doesn't work for me at https://passwords.google.com/
The quickest way I found to delete all passwords in chrome was to run a little script performing a sequence of mouse clicks... super sketchy but handy.
#!/bin/bash
i=$1
interval=$2
while [ $i -gt 0 ]
do
sleep $interval
xdotool mousemove <replace_with_x1> <replace_with_y1>
xdotool click 1
sleep $interval
xdotool mousemove <replace_with_x2> <replace_with_y2>
xdotool click 1
i=$[i-1]
done
You should have xdotool installed.
To run it:
- Go to chrome://password-manager/passwords
- Set your cursor over the first password and run
xdotool getmouselocation
. That should output something likex:895 y:352 ...
. That's your x1 and y1 respectively. - Click that password and set your cursor over the "Delete" button and run
xdotool getmouselocation
again. That's your x2 and y2 respectively. - Once you replace all 4 placeholers, run
bash this_script.sh i interval
replacing i with the number of passwords you have, and interval with the ammount of seconds you want to wait between each click. Ex:bash this_script.sh 10 0.2
I'm not proud of this approach but I don't need anything fancy.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! Found it on your reddit post. For you or anyone else who cares, i personally added 2 lines to the top to let me know how many passwords this script would be deleting. It's below: