JavaScript Shell 1.3

Changes since 1.2.1:

  • Make the bookmarklet version continue to work when you reload the original page or go to another page on the same site. (Fix by Sebastián Marconi and me.)
  • Make the "clicking anywhere focuses the textbox" feature work in IE. (Fix by Jeremy Vinding and me.)
  • Fix most of the javascript.options.strict warnings. (Fixes by Jeremy Vinding and me.)

Updated shell, updated bookmarklet, diff for the curious

11 Responses to “JavaScript Shell 1.3”

  1. Ted Mielczarek Says:

    Nice, the strict warnings bothered me but I was too lazy to fix them. I’ll have to put out a new version of extensiondev when I get a chance.

  2. Jesse Ruderman Says:

    There are still some “deprecated with statement usage” warnings, btw. I don’t know how to avoid using the with statement in the JavaScript Shell.

  3. Edward Lee Says:

    Seems like there were plenty of cleaning up of variable declarations too ;)

    with statements should be able to be replaced by some temporary variable.

    with (stuff) {
    blah = 5;

    var tmp = stuff;
    tmp.stuff = 5;

    But it probably isn’t that easy.. I see some nested with statements in the shell.

  4. Jesse Ruderman Says:

    “Seems like there were plenty of cleaning up of variable declarations too”

    Yep, those were the bulk of the javascript.options.strict warnings.

    “with statements should be able to be replaced by some temporary variable”

    The JavaScript Shell uses |with| to allow variables/functions from the page, from the shell, and from _scope to be used. Eliminating |with| in the shell would require changing how it works. Brendan says |with| is deprecated; I wonder if he has ideas for alternatives the JavaScript Shell could use.

  5. Julien Couvreur Says:

    I looked at the diff, but didn’t quite get how the “keep shell working when page is reloaded” works. Can you give me some pointer?


  6. Jesse Ruderman Says:

    Julien, search the diff for “initTarget” to see the “keep shell working when page is reloaded” part.

  7. Follower Says:


    Just wanted to say thanks for all the work you’ve put into the JS Shell Bookmarklet, it’s probably been the single most useful tool for my explorations into the inner workings of Google Maps.

    Having been used to Python’s interactive prompt it’s also become useful for some of my “from scratch” web work as well.

    It’s cool to see the “persist on reload” function as it’s a feature I’ve thought would be useful but probably couldn’t be done–glad to be proved wrong. :-)

    Thanks again,


  8. avih Says:

    I think the autocompletion stopped working with firefox 1.04
    whenever i try to complete i.e. “document.” (WITH the “.”) i get a red message:
    [quote]EvalError: function eval must be called directly, and not by way of a function of another name.[/quote]

    completeing “docu” to “document works” most other completions don’t.

    cheers afor a really nice tool.

  9. Jesse Ruderman Says:

    avih, I saw that too. The problem seems to be gone on trunk (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050527 Firefox/1.0+) so I’m not planning to track it down and try to fix it.

  10. David Says:

    Any tips on making the shell stay on top of the current window when I click on it? It always loses focus when I launch it and the window I launched it from regains focus. Maybe just need to add window.focus() to the what’s write()en to the new window?

  11. Jesse Ruderman Says:

    David, if you’re using Firefox, that could be