Skip Navigation

Greasemonkey User Scripts

Greasemonkey is a truly impressive addition to Firefox and will be IS a nice addition to Opera 8. In simple terms, it allows you to write custom JavaScripts to run on any sites you like (or even all sites). There is a fairly healthy group of scripts already available, and many more surely on the way.

I've been writing a few small greasemonkey user scripts so far, and this list should serve as a nice simple way to find them on the site:

  • Number Google Results
    This script will automatically number all Google search results for you.
  • Number MSN Results
    This script will automatically number all MSN search results for you.
  • Auto-Save Forms
    This script saves all text in forms to a cookie for you as you type. If you any reason you lose the data in the form (eg your PC crashes, your session expires, etc), you can click the "Repopulate Form" button and your text will be restored.

Also highly recommended:

  • CSS Signatures on Every Site
    Page contains a script that will give every site a body id tag, allowing you to write site-specific stylesheets using the body id as a handle.

11 comments

Helen
United Kingdom #1: April 20, 2005
Love your Autosave Forms script! However I found a bug. In start() the first 'for' loop loops to i.length, it should be looping up to f.length (on some pages, this prevents the script from getting as far as setting the save events) Cheers!
Hi Helen - glad you like it! Thanks for the bug fix too - nicely spotted! :)

Fixed now.
Pete_L_P
United States #3: May 19, 2005
I've been trying to use this script and have not been able to get it to work. I can never find a "repopulate" button.

I'm assuming that this comment box is a form, and that the "reply to message" pages on various BB sites are forms and that they're all eligible for auto save forms.

I have asf enabled in grease monkey, and have the default * page enabled.

Is there any more documentation?

Am I doing something wrong?

Pete
Pete_L_P
United States #4: May 19, 2005
OK

It's working now. Don't know what was wrong.

I really love this script, and have been immensely frustrated by lost form data countless times.

I'm writing a lengthy reply and tweaking the words to get it just right, something happens, like hitting a wrong key, and bam I've lost everything.

Wonderful script

Thank You.
Finally, numbered Google results! Thanks Dave, you're great :)
Pete_L_P
United States #6: June 1, 2005
I’d propose not clearing the saved form data on the submit.

In a number of cases that data can be desired after submitting. For example, there are BB’s that discard your form data if you attempt to post a message before having logged in. It just happened to me with a very long message, and I was so happy to have auto save form. Only to discover that the data is also discarded by ASF on the submit.

Any real downside in letting the data survive?

I modified the script for my personal use, but just thought I'd mention it here.

Pete
Another Dave
United States #7: July 12, 2005
I appreciate Autosave Forms, and have updated my copy to bind the cookie to location.pathname (the page containing the form), as opposed to the hard-coded "/" of the original script. That way, data for sites that have more than one form doesn't get clobbered. The change consists of changing this:

"; path="/;";

to this:

"; path=" + location.pathname + ";";

at the end of the last line of the clear and setCookie functions.

I also moved the repopulate box further into the upper-right corner of the page, because (even as small as it was), it was in the way.

That's the beauty of the monkey: anyone can get a little grease under their fingernails.
Googly Eyes
United States #8: July 12, 2005
I installed both your Number Google Results (very righteous) and some other Google customizing extension (maybe CustomizeGoogle extension [customizegoogle.com]), because Google is my universe.

I ended up turning the extension's results numbering *off* because they obviously don't get it, while you obviously do. They numbered only the results that were not indented (the first hit for a given site), so that a page of 100 results was numbered from (say) 1 to 75. Very strange.

Thanks for getting it right.
Looking into getting a comment box [maybe one such as this] for my site.
THANKS!!!

I've added this function to the (free) blog hosting service I created. My members are gonna be quite happy! :)

(http://vidman.ca/members)
Randy
United States #11: January 5, 2006
Autosave script.

Do I add this script to the default domain page?

Where in the script would I do this.

I have some survey forms that are created on the fly from a database and this would be a great add on should I be able to get it to work.

Randy

Comments Disabled

Sorry, but comments are no longer being accepted on this post. This is usually because a post has become out of date, or has become the target for an unusually high quantity of comment spam.