lesscode.org


When Emacs and The Browser converge  

By Ryan Tomayko under Talk on 26. August 2005

I finally broke down a few days ago and decided to make Firefox my default browser. I’ve tried to move away from Safari a few times in the past but never made it longer than a day. Safari is a better OS X application in some very fundamental ways but I’m encouraged by the Firefox/Mac activity slated for Firefox 1.5 and beyond.

My reason for switching and my reason for holding off for so long are the same: my browser contains significant customization and personalization. I’ve built up a nice little toolset on top of Safari that includes bookmarklets, extensions, and URL searches, not to mention all of my cookies, passwords, and history. Once you’ve established a normal workflow around these customizations, it becomes hard to go without them. It’s not unlike trying to switch from Emacs (with a ~5,000 line .emacs file crufted over years of use) to vi.

But, as I said, the ability to customize the browser has become so important to me that I’m willing to take the hit to productivity and Macishness now to get ramped up on a platform with far greater support for customization. In other words, Greasemonkey. I’ve only just begun diving in but my experience thus far is promising. The ability to automate tasks and extend basic web content with simple scripts seems so insanely obvious that I’m having a hard time understanding how this wasn’t a built-in feature of the 3.0 era browsers. Greasemonkey may be the first signs of a long awaited convergence between Emacs and The Browser :) Now if I could just get an M-x prompt, we’d be in business (YubNub anyone?)

As with Emacs, I will now begin building an embarassingly unorganized collection of hacks. I spent an hour or so combing through the massive repository of user scripts just to get my feet wet. Notes and pointers to stuff I found useful as follows…

Auto Login Everywhere

The AllowPasswordRemembering and AutoLoginJ scripts can be used to get almost reliable automatic login anywhere that Firefox puts up the “Remember this password” dialog. When you hit a site that Firefox has login information for, the AutoLoginJ script goes ahead and auto-submits the form. I’ve tested it across a couple of different sites and it seems to work about half the time. My banking site, O’Reilly Connection, and Vonage seem to work well but none of Yahoo, del.icio.us, or flickr.com worked.

Video URLs

I hate multimedia on the web – especially video. There’s a special place in hell for whoever is responsible for the tiny embedded players with format/bandwidth selection and shite controls that are so common. I promise the experience would be dramatically increased if all video was reduced to a thumbnailed image linking to an actual real video file.

The Unembed user script gets me half way there by inserting a link to the video file under the video display. My first hack will be to have it replace the <embed> with an <a>.

If you’re looking for somewhere to test this script, I highly recommend This Spartan Life.

A Whole New Google

There is an immense set of useful Google specific scripts. I’m using Google Access Keys and Google Search Keys for quick keyboard navigation of search results. The Google Image Rewriter makes image search results link directly to the image instead of that weird framed thing.

Holy Crap, I can use Slashdot

The Slashdot Single Page View script provides thread expansion without requiring a page refresh, xSidebars removes the butt-cheeks, and Add Mirrors puts nice little Coral, MirrorDot, and Google Cache links next to every single link on the page. There’s more Slashdot specific scripts I haven’t tried yet.

Misc.

Other scripts I’ve found useful:

  • BetterDir beautifies Apache directory listings. It’s really not that big of a deal but it shows the types of interaction a user script can have with a page.

  • CookieMonster puts a little thing in the bottom left of the page that shows raw cookie data for the current page upon hover.

  • Nofollow display strikes links having a rel="nofollow" attribute. Mildly interesting sometimes.

  • SourcePlease removes some of the insanity of SourceForge file listings by linking directly to a specific mirror’s copy of a file, removing the need to wade through five pages of ads.

  • TextareaResize sounds cool but doesn’t seem to work.

  • SearchTermHighlighter gives you Google cache style highlighting of pages entered through a major search engine. The highlight is non-intrusive.

Come on, I know you guys have some gem recommendations – what am I missing?

14 Responses to “When Emacs and The Browser converge”

  1. Nicolas Mommaerts:

    If you want resizable textareas, there is a firefox extension for it. It works great, except in GMail :(

    comment at 26. August 2005

  2. Neil Greenwood:

    Book Burro is a nice addition to Amazon pages, although I’m in the UK and it didn’t seem to work properly when I first tried it yesterday…

    BTW it might be nice to have a preview on the comments, since I’ve never used Markdown before and I’m not sure I’ve got it right.

    comment at 26. August 2005

  3. Neil Greenwood:

    OK, so it’s fairly simple and obvious! :-)

    comment at 26. August 2005

  4. Kevin Dangoor:

    Assuming you can use Greasemonkey with it, I’d really recommend that you use Deer Park. It’s got a much faster feel, and there are a few other niceties.

    comment at 26. August 2005

  5. Bill Brown:

    I’ve found the Paul Graham scripts helpful and frequently apply to non-PG sites as well.

    comment at 26. August 2005

  6. Where Are The Wise Men?:

    When Emacs and The Browser converge [@lesscode.org]

    When Emacs and The Browser converge  has a great list of Greasemonkey scripts
    

    trackback at 26. August 2005

  7. Mark:

    I’m biased, of course, but I like

    Others have mentioned Book Burro. I also like GMail Tweaks

    Firefox is the new Emacs. JavaScript is the new LISP. Greasemonkey is the new .emacs file.

    comment at 26. August 2005

  8. Tim:

    I hacked together a version of the Unembed script which visually replaces the embedded video, with the option to download the file or re-show the embed object.

    It still needs fixing (it currently re-writes object IDs which is a bit dodgy), but it is workable…

    http://gfxmonk.sysprosoft.com/unembed.user.js

    comment at 26. August 2005

  9. Ryan Tomayko:

    Mark, this del.icio.us assistance GM script is sick! Sick! Ghhaa! Wow!

    comment at 27. August 2005

  10. Masklinn:

    Mark > I think it’d be much more fun to just have List avaible in Firefox (or another powerful interpreted language, I’d go for Python myself since I’m quite far from lisp fluent, and Python is a bit more readable than common lisp).

    In fact, I’m wondering if it ain’t time to get a better, stabler, more powerful, more coherent langage to script web pages.

    As simple as JS, but less forgiving, allowing less obtrusiveness (promoting unobtrusive scripts by design), and with much more powerful types… and the ability to import modules which JS clearly lacks.

    comment at 27. August 2005

  11. b7j0c:

    there actually is an extension that provides full keyboard access for firefox - meaning you do not need to use a mouse, ever.

    comment at 27. August 2005

  12. Julien Couvreur:

    What problem did you run into with ResizeTextarea?
    There are two limitations with that script, afaik:

    • GMail textareas don’t work,
    • textareas that are sized with “width” and “height” instead of “rows” and “cols”.

    I should be able to fix that second limitation, but haven’t got to it yet. Ping me if you think that is the problem you ran into.

    Also, my other scripts are available at http://blog.monstuff.com/archives/cat_greasemonkey.html

    comment at 29. August 2005

  13. Joe Grossberg:

    “TextareaResize sounds cool but doesn’t seem to work.”

    In general, if a Greasemonkey script doesn’t work, check for JS errors. It’ll help you narrow down what’s wrong.

    comment at 29. August 2005

  14. genehack.org » Blog Archive » Laptop tab dump:

    […] When Emacs and The Browser converge — mental note, check out Greasemonkey […]

    pingback at 05. September 2006