Kilian Valkhof

Building tools that make developers awesome.

Twitter search in sidebar using Greasemonkey

Javascript, 6 October 2008, 2 minute read

Twitter’s recent redesign is great, but quite a few people missed the Twitter people search, or hoped it would add the new in the sidebar. As I hadn’t done anything with Greasemonkey yet, but wanted to play around with it for some time, I decided to combine the two.

Twitter search in sidebar

Click the link to install it using Greasemonkey: twittersearch.user.js

And this is what it looks like:
screenshot by Robert Gaal


There is one awesome thing about doing stuff with Greasemonkey: it’s easy. You’re just writing regular javascript and some comments that tell Greasemonkey the name and description, which websites to apply to (or not to apply to) and that’s it. The above script took me about an hour, including eating my dinner.

If you need to do heavier stuff and want to make use of library’s, you can do that, too. The only gotcha I really had, had to do with innerHTML (shock!) that acted a bit icky with onfocus functions and parameters in quotes. Solution: remove the quotes.

Onfocus? Not event listeners? Well, no. Greasemonkey script themselves are javascript already, so if it’s in the page, then the user has javascript on. Using an onfocus then is just much easier :)

There are a couple of websites I looked around to find info on Greasemonkey:

If there’s an annoyance with a website you use often, and you think you could fix it easily, then Greasemonkey is an excellent way to do that fast and easy. Do you have any tips for Greasemonkey?

Polypane browser for responsive web development and design Hi, I'm Kilian. I make Polypane, the browser for responsive web development and design. If you're reading this site, that's probably interesting to you. Try it out!