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).

Newsvine | Del.icio.us | Digg
In Web, Firefox, JavaScript, Greasemonkey on May 21st, 2005 | 14 Remarks

14 Remarks to “Smart Firefox”

  1. David Brent remarks:

    Bit of an obsession with Greasemonkey scripts eh Jonathan? ;)

  2. Jona remarks:

    I LOVE IT!! I NEED MORE!!! Also, I had to make an entry about it to add it to the Greasemonkey user script wiki. Fear not, I’ve another Greasemonkey script (less general-purpose, though) coming soon.

  3. Rasmus remarks:

    What about making replacing “–>” with →? That would be nice

  4. Jona remarks:

    Thanks for the idea, Rasmus.

  5. Rasmus remarks:

    Will you write if you update it?
    Also, I forgot to to say that it is a mighty good script you have ‘cooked’ together here :) Thanks!

  6. Jona remarks:

    Rasmus: I updated the script per your request; I also made a new blog entry about it.

  7. Mathias Bynens remarks:

    Perhaps you could add // @exclude */wp-admin/* to the script? That surely would’ve caused me less annoyance after editing a 20+ kB WordPress template :)

  8. Mathias Bynens remarks:

    Oh, and by the way, could you make it ignore everything inside <?php ?> as well? That would’ve fixed my problem as well, and I think it’s a nice addition anyway. :)

  9. Jona remarks:

    Hi Mathias,

    I simply included every page because I chose to leave that configuration up to the user. I do realize that it’s easy to forget where the script executes (I really screwed up the Greasemonkey Wiki once with it), though. I’m not sure what to do about that. Generally, I only use Smart Firefox on forum sites because most blogs format quotes for me automatically, so I usually don’t have to worry about it then.

    The script already doesn’t process anything between < and > and that includes PHP- and ASP-style tags.

  10. Leav remarks:

    I’m not sure if this is where youre going with the script, but could you add a UBB code to HTML changer?

    or is that a project of it’s own?

    lots of forums disabled the UBB, but many users still use it, so you end up with text like [b]bold[/b] and [i]italic[/i] instead of bold and italic

    -Leav

  11. Jona remarks:

    Leav, would you be so kind as to elaborate? A different Greasemonkey script may be in order if you’re looking to convert all instances of UBB on a web page into its HTML (except where in specific tags such as code or pre, for example), but there are already existing Firefox extensions (yes, more than one) to automatically insert specific UBB at any forum you visit so you don’t have to type it in. Is this what you mean?

  12. Brian remarks:

    Awesome. Cool code!

  13. Nicholas remarks:

    Hello there,
    This post is really old, but still useful to me. There is only one problem. Is it possible to update the script, so it DOES convert the HTML and other codes inside . Or at least help me to do it myself.
    Thank you in advance,
    Nicholas

  14. Nicholas remarks:

    I ment to convert the those codes which are inside PRE

Leave a Remark

 

Note: HTML is allowed. (<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> ).