Skip to content

Instantly share code, notes, and snippets.

View miszo's full-sized avatar
🧠
focusing

Miszo Radomski miszo

🧠
focusing
View GitHub Profile
@miszo
miszo / clearChromePasswords.js
Created August 3, 2020 11:28
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.
// 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 set