Skip to content

Instantly share code, notes, and snippets.

@brycefisher
Created August 16, 2013 21:59
Show Gist options
  • Save brycefisher/6253828 to your computer and use it in GitHub Desktop.
Save brycefisher/6253828 to your computer and use it in GitHub Desktop.
<p>To setup this bookmarklet in your browser, you'll need to:</p>
<ol>
<li>Clone (or download) this gist using the information on this page</li>
<li>Fill in your username and password</li>
<li>Change the drupal_domain variable to the domain of your drupal install</li>
<li>(Possibly) change the path to the path to your drupal login form</li>
<li>Drag the link to your bookmark bar</li>
</ol>
<p>To use, simply click the bookmark anywhere on your drupal_domain.</p>
<a href="javascript: (function(){ var user = 'username', pw = 'password', path = '/user/login', drupal_domain = '.example.com', domain = window.location.host, frame = document.createElement('iframe'), frame_length = frames.length; if(domain.indexOf(drupal_domain) !== -1){ document.body.appendChild( frame ); frame.src = '//' + domain + path; frame.style.display = 'none'; setTimeout(function() { frames[frame_length].document.getElementById('edit-name').value = user; frames[frame_length].document.getElementById('edit-pass').value = pw; frames[frame_length].document.getElementById('edit-submit').click(); setTimeout(function(){ window.location = 'https://' + domain; }, 750); },750); } else { alert('Wrong Domain -- must be at *' + drupal_domain); } })(); return false;">D6-Login</a>
<p>Tested in Chrome with Drupal 6</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment