Skip to content

Instantly share code, notes, and snippets.

@Frankenmint
Forked from mcotton/bookmarklet.js
Created October 31, 2019 22:15
Show Gist options
  • Save Frankenmint/715e52a956cbe03a9fa6717e8439a0c0 to your computer and use it in GitHub Desktop.
Save Frankenmint/715e52a956cbe03a9fa6717e8439a0c0 to your computer and use it in GitHub Desktop.
auto-login bookmarklet
// Saved URL should look like this:
// javascript:<function>
// replace <function> with the following text
(function(){
// Grab the username and password input fields
user = document.getElementById('txtUserName');
pass = document.getElementById('txtPassword');
// Grab the submit button, oddly named 'punch'
punch = document.getElementById('btnPunch');
// Assign them values and simulate clicking the 'punch' button
user.value = 'foo';
pass.value = 'bar';
punch.click()
// Wrap it up in parens so it is a self-calling function
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment