Bookmarklets are links containing Javascript code. They are useful when you save them in your bookmarks, in order to achieve some processing on the current page displayed in your browser.
It is possible to create bookmarklets authenticating you on a site with a login form. Note that it requires storing your login and passwordin the bookmarklet source code.
The bookmarklet code on several lines:
javascript: document.body.appendChild(document.createElement('div')).innerHTML=' <form name="BletForm" method="POST action="http://www.woozweb.com/loginctrl"> <input type="hidden" name="login" value="MONLOGIN" /> <input type="hidden" name="pass" value="MONPASS" /> </form>'; document.forms['BletForm'].submit();
This code generates a POST HTTP request with two parameters, from your bookmarks. Writing this kind of code is easy for Web developpers, but hard for regular users.
So I wrote a bookmarklet that itself can generate login form bookmarklets, easily.
It’s very simple:
- Drag the generator bookmarklet in your bookmarks:
generator - Open a web page with a login form.
- Click on the generator in your bookmarks: a message appears next to the form.
- Fill in the login form.
- Click on the generation link: the bookmarklet appears.
- Drag the generated bookmarklet in your bookmarks.
- Finally, test your automatic login bookmarklet!
The generator bookmarklet even works with the login screen of my bank account. Obviously, your login information is stored directly in the bookmark, which is not very secure…
Notes:
- Only tested with Firefox. Some work to make it compatible with Safari and IE.
- Find a way to use Firefox password storage to retrieve the password.
- If the bookmarklet doesn’t work for you, give me some feedback.
Links:
- The bookmarklet in clean .js file: blet.js
- Good doc on bookmarklets: http://subsimple.com/bookmarklets/
- A bookmarklet directory: http://www.marklets.com