Skip to content

Instantly share code, notes, and snippets.

@sergiopereiraTT
Created April 22, 2014 22:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiopereiraTT/11196486 to your computer and use it in GitHub Desktop.
Save sergiopereiraTT/11196486 to your computer and use it in GitHub Desktop.
Bookmarklet for quick login
javascript:(function(){var d=document;s=d.querySelector;s.call(d,'input[name*=email]').value='YOUREMAIL@company.com'; s.call(d,'input[name*=pass]').value='SECRETPASSWORDHERE';s.call(d,'button[id*=login],input[type=button][id*=login],.btn-login').click(); }())
@sergiopereiraTT
Copy link
Author

This is a bookmarklet. To use it, add a bookmark in your browser and use the above text as the URL.
This bookmarklet will fill email+password login forms and submit them. You'll have to update it with the desired email and password and it's obviously not a good idea to use it with real-world credentials. Use it just for testing, with test accounts.
It won't work for every imaginable login form since it was mainly created for the projects I work on, which are consistent about the form field names.

@dirkk0
Copy link

dirkk0 commented Mar 3, 2021

This is great!
Another way to do this would be to create a function 'doit()' in a general js import and call this from the bookmark like:
<a href="javascript:doit();">doit</a>

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