Focus. Focus. Focus!
April 13th, 2010This may be a huge pet peeve of mine, but I couldn’t possibly be alone. Don’t you hate when you land on a web page that asks for your username and password (or any other required information) and you realize you have to click on the first text box in order to start typing? Wouldn’t the world be a better place if you just could start typing immediately upon landing on such an egregious web page? I decided today I no longer need to put up with these shoddy web design practices. Enter Greasemonkey.

This amazing add-on for web browser Firefox allows you to execute Javascript snippets that can customize the look and feel of any site. I quickly cooked up a script that now sets the focus to the first text box on any web page. This is the ridiculously simple code that does the trick:
var inputs = document.getElementsByTagName('input'); for(i = 0; i < inputs.length; i++){ if(inputs[i].type === "text"){ inputs[i].focus(); break; } }
If you have Firefox and Greasemonkey, click on this link to install Focuser (you’ll see the code if you’re using a different browser). If you’d like Focuser to only do its job on certain web sites, you can easily modify the pages that are affected using Greasemonkey’s scripts manager.
Simple hacks like this make my day every time.
Greasemonkey art found at falsepositives.com.



