Last active
April 24, 2021 11:32
-
-
Save ryanpcmcquen/cee082bff514f8849a29c409fe3571ff to your computer and use it in GitHub Desktop.
DEPRECATED! Chrome now has password export built in.
This file contains 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
// 1. Open: chrome://settings/passwords | |
// 2. Open Chrome developer tools (using F12 or Ctrl+Shift+i). | |
// 3. Run the following code in the console tab. | |
// 4. Copy output in a text file and save it somewhere safe! | |
;(() => { | |
const asyncForEach = (array, done, iterator) => { | |
let i = 0 | |
let next = err => { | |
if (err) { | |
done(err) | |
} else if (i >= array.length) { | |
done() | |
} else if (i < array.length) { | |
let item = array[i++] | |
setTimeout(() => { | |
iterator(item, i - 1, next) | |
}, 0) | |
} | |
} | |
next() | |
} | |
settingsUi = $$("settings-ui") | |
settingsPage = Polymer.dom(settingsUi[0].shadowRoot) | |
container = settingsPage.querySelector("#container") | |
settingsPasswordsAndForms = Polymer.dom( | |
Polymer.dom( | |
Polymer.dom( | |
settingsPage.querySelector("#main").shadowRoot | |
).querySelector("settings-basic-page").shadowRoot | |
).querySelector("settings-passwords-and-forms-page").shadowRoot | |
) | |
page = settingsPasswordsAndForms.querySelector("passwords-section") | |
.shadowRoot | |
passwordSection = Polymer.dom( | |
settingsPasswordsAndForms.querySelector("#pages") | |
).querySelector("#passwordSection") | |
list = Polymer.dom(page).querySelector("iron-list") | |
passwordItems = list.get("items") | |
asyncForEach( | |
passwordItems, | |
() => { | |
console.log(JSON.stringify(passwordItems, null, 4)) | |
// Now you can save the output in a text file! | |
}, | |
(item, index, next) => { | |
passwordSection.passwordManager_.getPlaintextPassword( | |
index, | |
(item) => { | |
passwordItems[index].password = item.plaintextPassword | |
next() | |
}.bind(passwordSection) | |
) | |
} | |
) | |
})() |
@gregh747, you have to copy and paste it to a file manually. But, Chrome now has a password export built in, and this no longer works.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi How to import the file in another system please ?