Greasemonkey Hacks

The best part about this book, I’m not quite sure about yet. Thus far it looks to be very informative and useful as a resource, but there’s much more to this book for me.

Before the book was published, sometime mid-summer, I got an email from Mark Pilgrim asking for permission to use my Smart Firefox Greasemonkey script in his book (the script is featured on pages 86-89). Although I would have consented immediately regardless, Mark offered in return a free copy of the book when it was published and a small paragraph about me in the credits section. Thus, for writing a free Greasemonkey script, I got a free book and some publicity (as my web address is printed in the “about me” paragraph). Is that cool or what?

November 30th, 2005 | Remark

Don’t Click It Update Again

What’s new?

  • Hold the Shift key to halt all functionality; you can click or right-click objects during this time. As long as you hold down the Shift key, putting your mouse over an item won’t invoke its action.
  • Hold the Ctrl key to open links in new windows/tabs. Note that this only works if your popup blocker is disabled, due to the use of the window.open() command.

You can still grab the script at the same location as before.

June 22nd, 2005 | 12 Remarks

Don’t Click It Update

Here’s a list of the changes.

  • Hold Shift key to halt functionality — links will only be “clicked” on mouse over when you are not holding the shift key.
  • Form field select — instead of just focusing on a field, Don’t Click It now automatically selects text within text fields.
  • I was thinking about adding a timeout-function for buttons, but then I decided otherwise. Advanced uses can uncomment that part of the code in the script to enable the timeout functionality.

You can still access and install the script at the same location as before. There are going to be even more major enhancements coming soon, but I thought I should release what I worked so far.

June 20th, 2005 | Remark

Grease Support

Would anyone be so kind as to point me in the direction of a Greasemonkey (or at least highly Greasemonkey-aware) forum, where I can ask questions in the presence of a community in the future? Is there even such a place?

Maybe if there isn’t a Greasemonkey forum, someone can answer my question… How do I open a new window/tab with a Greasemonkey script? I’d normally use window.open (and Firefox will open new windows in new tabs automatically, right?), but according to Firefox the script originates from the page it is executed on thus disabling the window.open feature. Is there a way to force it to automatically open a new window/tab like an extension would be able to do? I can’t find answers anywhere.

June 18th, 2005 | 8 Remarks

Don’t Click It!

There’s this site called DontClick.it — basically it’s a Flash-powered user-interface approach that avoids the necessity of clicking for navigation and other functionality. The web site claims that there is a small gap of time between clicking that can be eliminated by omitting the clicking process altogether. While this may be the case, I don’t think that the omission of clicking would be beneficial to many users who are often uncertain whether they want to select a particular item (be it a link, input field, or something else). However, for advanced users of the Web, clicking may actually be a hindrance to productivity — I can’t confirm this, though, because I’m much more experienced with clicking than with hovering. In order to decide which is truly more efficient, I have to evaluate which is better after I’ve acquired a good deal of experience with them both. This means I’ll have to have some way to evaluate both of them; clicking I’m already experienced in — I do this every day, all the time — but how do I avoid clicking on every site I visit?

Introducing Don’t Click It!, a Greasemonkey script for Firefox power-users. Install this little bugger and your clicking is over, unless you decide that you’re more productive with clicking (but like I said, you should evaluate the usefulness of a click-free interface objectively rather than assume it’s too difficult because you’re “not used to it”). I’d look into giving it a try — there are some things that may not work (e.g., file inputs that can’t be accessed by JavaScript and I noticed a problem with a Yahoo! Mail drop down menu), but it’s a good start, anyway. Enjoy, and don’t forget to tell me what you think or suggest improvements! There’s always room for that!

Update: it seems that I have troubles controlling my mouse (especially when I’m using my laptop’s mousepad), so perhaps clicking would be better just if everything (including very small links) were easier to click. Hmm, I feel yet another Greasemonkey script coming on…

Update 2: something really cool that I noticed earlier was that I could be talking on instant messaging (on a seperate monitor on the same computer) and browsing the Internet at the same time because the instant messaging window would stay focused, but I could still browse the Internet at the same time. Pretty cool, huh? The 19th (or 20th) I should be releasing a much better version of this Greasemonkey script, so hang tight for that!

Update 3: I’ve updated the script. What do you think of the updates?

Update 4: More updates

June 17th, 2005 | 7 Remarks

The Data URI

I used a background image, that much is clear, but it’s not a remote link to an image. That would consume bandwidth, and what if I changed the address or something later on? It’s just unreliable to do such a thing. Instead, I embedded the image in the Greasemonkey script.

How in the world would I do that? Well, it’s not something you see everyday (probably because Internet Explorer, our loving, caring friend, doesn’t support it), but there’s a URI scheme called “data.” You know how there’s “javascript:” and “about:”? It’s the same thing (and, it’s part of an official RFC specification). By using this URI scheme, we can have the browser interpret a string as binary data (and even non-binary data, and even data inside of data — check out an example, and yes that’s a data URI link). Very cool. (If you look closely, the second level’s LINK tag is to a data URI which is a stylesheet, and in that stylesheet is a data URI with a rainbow gradient image.)

Oh, you want to know how to use it, do you? It’s nothing difficult. Basically anywhere you would normally place a URL to a file or a file itself (be it in a CSS background property, a web page itself, a link to a CSS stylesheet, etc.) you can put a data URI object there instead. To compress a file or some data into a data URI, head to the data URI kitchen and give it a shot. What think you?

May 28th, 2005 | 4 Remarks

Smart Firefox

Introducing Smart Firefox, the Greasemonkey script that automatically educates your text when you submit a form. Smart Firefox will convert all quotes, dashes, and apostrophes to their correct entity replacements. It only processes textareas (to avoid compatibility issues with input fields, for example if you’re searching Google), and runs onSubmit (but won’t overwrite any current existing onSubmit functionality). By default, this script runs on every page with a textarea, so if you’re working in an HTML editor or other, you will need to exclude that site on the list of sites to be processed by Smart Firefox (a simple task). Oh, it also ignores anything inside of [CODE], [PHP], or [HTML] UBB tags, and any quotes inside of HTML tags are also ignored.

So, how do you get it? Make sure you’ve got Greasemonkey installed and running, then grab the script (you can right-click and select “Install user script,” or left-click and select “Install user script” from the menubar in the top of your browser). Enjoy, folks!

Update: I’ve updated the Greasemonkey user script. Smart Firefox now converts “<-" and "->” into “←” and “→” respectively (thanks for the suggestion, Rasmus).

May 21st, 2005 | 17 Remarks

Delicious Banner

If you take a look at all the existing skins for del.icio.us, you’ll notice that all of them (at the time of writing) make the “delBanner” at the top float over the page (via “position: fixed”). Each and every one of these skins suffers from a problem, though: the “delRight” sidebar overlaps the banner, making almost half of the navigation inaccessible. Instead of having to do this manually each time you load up a new skin, I think people should be able to decide if they want that banner to float or not. So, I’d like to see more delicious skins, but CSS-only ones (and no floating banners). If anyone wants the banner to float, they can make it float on their own. How? Take a greasy ride and look at the del.icio.us floating banner. Let me know if you have any problems with it (I noticed a bug at one time, but I think I fixed it since I can’t reproduce it). Oh yea, and if you’re interested in more Greasemonkey scripts, I’ll tell you I’m working on an almost complete Ajax/Del.icio.us enhancement script. Keep an eye out!

May 17th, 2005 | Remark