Skip to content

Instantly share code, notes, and snippets.

@mcotton
Created November 2, 2011 00:11
Show Gist options
  • Save mcotton/1332353 to your computer and use it in GitHub Desktop.
Save mcotton/1332353 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