Skip to content

Instantly share code, notes, and snippets.

@wata
Last active April 14, 2020 05:14
Show Gist options
  • Save wata/cd39f29876e4ae806967f634143439b3 to your computer and use it in GitHub Desktop.
Save wata/cd39f29876e4ae806967f634143439b3 to your computer and use it in GitHub Desktop.
A script to get the password from accounts.google.com for iOS shortcuts
if (navigator.credentials && navigator.credentials.preventSilentAccess) {
navigator.credentials.get({
password: true,
unmediated: false,
federated: {
providers: ['https://accounts.google.com']
}
}).then((cred) => {
if (cred && cred.password) {
window.alert(cred.password)
} else {
window.alert('Not Found')
}
completion()
}).catch((error) => {
window.alert(error)
completion()
})
}
@wata
Copy link
Author

wata commented Apr 14, 2020

2020-04-14: NotSupportedError: Only PublicKeyCredential is supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment