SOS

Shane O'Sullivan's technical blog… really ties the room together

Using dojo.query & Greasemonkey to skip welcome screens

Posted by Shane O'Sullivan on May 2, 2009

I posted a couple of weeks ago on how I used the Sizzle CSS selector engine in a Greasemonkey script to skip annoying “Welcome Screens”, see it here, or check out the very handy script here.  However, there were a couple of issues with using Sizzle:

  • It had to be inserted in the main page’s JavaScript context, otherwise it would not work.  This is obviously bad as it takes it out of the Greasemonkey sandbox, and potentially could break functionality on the page in question.
  • On some pages it crashed the browser.  Not good.

So, I’ve replaced it with the Dojo standalone library, Acme.  Some advantages it has over Sizzle:

  • It’s arguably faster
  • It doesn’t have to be put outside the Greasemonkey sandbox, so no interfering with the page code.
  • It doesn’t crash the browser :-)

You can get the uncompressed version of Acme here – http://archive.dojotoolkit.org/nightly/checkout/dojo/_base/query.js

If you want a compressed version, that works independantly of Dojo, you can compress that file to a single line using the YUI compressor at http://www.refresh-sf.com/yui/

About these ads

3 Responses to “Using dojo.query & Greasemonkey to skip welcome screens”

  1. […] O’Sullivan, recently minted as as Dojo committer, has updated his GreaseMonkey script for skipping welcome screens to use Acme instead of Sizzle. Short story: fewer browser crashes and better […]

  2. Shane, the url pointing to the nightly _base/query.js uses a “built dojo”, so the file has a dojo._hasResource check added by the build. People likely want to download the /checkout/ version, or load it directly from subversion.

    Regards,
    Peter

  3. @Pete, thanks for that, the post has been updated with the unbuilt version

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 533 other followers

%d bloggers like this: