Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelScript/1ea27fe211fe55f278108816f0c8754a to your computer and use it in GitHub Desktop.
Save MichaelScript/1ea27fe211fe55f278108816f0c8754a to your computer and use it in GitHub Desktop.
# Running this on https://google.com returns expected behavior:
# Chrome prompts you to save your credentials
# This also works if you spin up an http server i.e: `python -m SimpleHTTPServer`
# and run it in your console.
# However running on https://localhost results in a silent failure
# where the success function fires but you are not prompted.
# Easy way to spin up a simple https server is: https://gist.github.com/dergachev/7028596
var creds = new PasswordCredential({
id: "test@test.com",
password:"password1"
});
navigator.credentials.store(creds).then(function(){
console.log("Done saving credentials");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment