Last active
September 17, 2021 09:47
-
-
Save lozhn/9165f17d04f7452710710850da085bc9 to your computer and use it in GitHub Desktop.
Attempts to remove all saved passwords in chrome
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
// Tested in Chrome 93 | |
// | |
// Open `chrome://settings/passwords` and paste the snippet in the console and hit Enter | |
// It may my required to repeat the process a few times as I don't know JS | |
// and `.click()` seems to be async so not every button get clicked | |
n = document.querySelector("body > settings-ui").shadowRoot.querySelector("#main").shadowRoot.querySelector("settings-basic-page").shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-autofill-page").shadowRoot.querySelector("#passwordSection").shadowRoot.querySelector("#passwordsListHandler > div > div.cr-separators.list-with-header").children.length | |
for (i = 1; i < n; i++) { | |
document.querySelector("body > settings-ui").shadowRoot.querySelector("#main").shadowRoot.querySelector("settings-basic-page").shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-autofill-page").shadowRoot.querySelector("#passwordSection").shadowRoot.querySelector(`#passwordsListHandler > div > div.cr-separators.list-with-header > password-list-item:nth-child(${i})`).shadowRoot.querySelector("#moreActionsButton").click() | |
document.querySelector("body > settings-ui").shadowRoot.querySelector("#main").shadowRoot.querySelector("settings-basic-page").shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-autofill-page").shadowRoot.querySelector("#passwordSection").shadowRoot.querySelector("#passwordsListHandler").shadowRoot.querySelector("#menuRemovePassword").click() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment