Created
August 3, 2020 11:28
-
-
Save miszo/0caacb8511270c816a34da6c2c05b4c0 to your computer and use it in GitHub Desktop.
Unfortunately it is impossible to clear all passwords at one in Chrome. But since it is written with web technologies, you can navigate through DOM and ShadowDOM. It works with Chrome v84.
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
// Unfortunately it is impossible to clear all passwords at one in Chrome. | |
// But since it is written with web technologies, you can navigate through DOM and ShadowDOM. | |
// It works with Chrome v84. | |
// 1. Go to chrome://settings/passwords | |
// 2. Open console, paste code below or run it as a snippet in devtools | |
(() => { | |
const interval = setInterval(() => { | |
const kebabMenu = document.querySelector('settings-ui').shadowRoot.children.container.querySelector('settings-main').shadowRoot.querySelector('settings-basic-page').shadowRoot.querySelector('#basicPage settings-autofill-page').shadowRoot.querySelector('#pages settings-subpage #passwordSection').shadowRoot.querySelector('#passwordList').querySelector('password-list-item').shadowRoot.querySelector('cr-icon-button#passwordMenu'); | |
const removePasswordButton = document.querySelector('settings-ui').shadowRoot.children.container.querySelector('settings-main').shadowRoot.querySelector('settings-basic-page').shadowRoot.querySelector('#basicPage settings-autofill-page').shadowRoot.querySelector('#pages settings-subpage #passwordSection').shadowRoot.querySelector('#menu #menuRemovePassword'); | |
kebabMenu.click(); | |
removePasswordButton.click(); | |
}, 200); | |
const whenShouldStopInterval = 60 * 1000; | |
setTimeout(() => clearInterval(interval), whenShouldStopInterval); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment