XUSH (.01), you know it’s fun to say.

Over the past 8 months I have been neck deep in XUL and XPCOM and with Venkman being as unintuitive as it is I have badly needed a shell with access to the trusted space in the browser. I also had a couple more requirements, which were that it was super easy to get at (keyboard shortcut), and that it looks awesome (transparency required).

Since making things looks really nice in XUL is really hard, I decided that I would build the UI in the current Firefox content window (sorry tbird etc, but I built a less shiny version of this into Mozmill trunk for all of you).

Some of the functionality that I decided was a top priority was some slightly abstracted access to the window mediator which I am calling ‘windows’, and is simply an array of all the different windows available in the whole browser. The other big one is dir(), I am constantly looking for a property in one of the many, many objects I am trying to access and now that is really easy.

All of that goodness combined with enough space to stick real code blocks and a full history (which you can access using the shift key and up/down arrows), I find myself pretty comfortable.

After installing the extension, you can simply press ‘meta (cmd on mac) + shift + s’ and you should be greeted with the following (toggling will show/hide the shell):

UPDATE: It was pointed out to me that on windows meta may not be bound, so I have updated both the extension and git, please try ‘alt+shift+ctrl+s’ or ‘ctrl+shift+s’ on windows/linux, (I am testing in a VM so it’s a bit strange. Sorry about the confusion!) 

 

Welcome to XUSH

Welcome to XUSH

To get started, you can type ‘help’ to see what is available to you.

Help Menu

Help Menu

 

 

Other available functionality includes a big chunk of the mozmill controller for driving user actions in the browser, as well as elementslib — which gives you all kinds of powerful features for looking up nodes in the browser.

ElementsLib

ElementsLib

As I mentioned above, the windows helper can quickly give you an idea of what is open in the browser and let you directly access the objects in the windows[x] array.

Windows Helper

Windows Helper

 

The nice big console gives you enough space (and using shift) you can do multiple line commands to actually execute code snippets:

Code Blocks

Code Blocks

My next round of features will include some more helpers, including tab completion and any bug fixes I find, please let me know of any that you find!

If you would like to play with the source, I have it on github and have a python script that uses mozrunner to launch it in dev mode (with venkman installed, although now I don’t really need it), but saves you from installing and uninstalling the extension every-time you want to try out your latest code changes:

python xush.py

That should launch Firefox with XUSH and Venkman both installed and allow you to hit the shortcut and wham, test away.

After another round of bug fixes I will be submitting this to Mozilla AMO.

Other projects you might be into if this interests you:

Thanks for your interest!

Spread the Word
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Fark
  • Pownce
  • Reddit
  • StumbleUpon
  • Technorati
  • Live
  • Slashdot
  • TwitThis
  • YahooMyWeb
Share This Post
Posted on January 28, 2009 at 6:57 pm by adam · Permalink
In: Firefox, JavaScript, Mozilla, Open Source, Python, Web · Tagged with: , , , , , , , ,

10 Responses

Subscribe to comments via RSS

  1. Written by J B
    on January 28, 2009 at 8:07 pm
    Permalink

    what’s the equivalent of ‘meta’ on a windows’ keyboard? I’ve tried Alt, Ctrl and the Windows’ key. Interestingly enough, when I do Ctrl+Alt+Shift+S I go to MySpace! WTF? I kid you not! Ha! Maybe that’s your extension :)

  2. Written by adam
    on January 28, 2009 at 8:13 pm
    Permalink

    Yikes, thats a good question — I actually didn’t try it there, I thought Windows automatically took ctrl as meta, testing now.

  3. Written by adam
    on January 28, 2009 at 8:35 pm
    Permalink

    Alrighty, extension and github are both updated — try ctrl+alt+shift+s on windows and everything should work, still cmd+shift+s on mac. Thanks for the heads up!

  4. Written by adam
    on January 28, 2009 at 8:40 pm
    Permalink

    If you don’t find that to work try just ctrl+shift+s, I am testing in a VM so things are a bit different.

  5. Written by Ted Mielczarek
    on January 29, 2009 at 11:36 am
    Permalink

    I generally just use the copy of Jesse’s JS Shell (http://www.squarefree.com/shell/) that is shipped with my Extension Developer’s Extension:
    http://ted.mielczarek.org/code/mozilla/extensiondev/

  6. Written by adam
    on January 29, 2009 at 3:53 pm
    Permalink

    I’ll check that out, thanks!

  7. Written by david dahl
    on February 2, 2009 at 5:28 pm
    Permalink

    I tried Xush, and it is pretty cool, however, it seems to intercept the “Enter” key, making it send nothing in any textarea or input form element. I am running Linux with a Trunk build.

    Regards,

    David

  8. Written by adam
    on February 2, 2009 at 6:02 pm
    Permalink

    Thanks David, that certainly sounds like a bug — I will fire up my VM today and see if I can fix that.

  9. Written by adam
    on February 2, 2009 at 6:20 pm
    Permalink

    Thanks for the bug! It’s fixed in github and I pushed the new XPI to http://www.adamchrstian.com/stuff/xush-01.xpi

  10. Written by david dahl
    on February 9, 2009 at 2:43 pm
    Permalink

    Adam:

    I also started to hack a little on Javascript Shell. I got ctrl-a and ctrl-e working. http://daviddahl.blogspot.com/2009/02/tinkering-with-javascript-shell.html

Subscribe to comments via RSS

Leave a Reply


Get Adobe Flash playerPlugin by wpburn.com wordpress themes