mozrepl is the most exciting firefox extension I have ever seen

mozrepl seems astonishingly powerful.

Although I’m not currently developing in js,  I think mozrepl will be a game changer,  having a real repl with access to every nook and cranny of firefox is an amazingly powerful tool ,  It makes firebug irrelevant for me.

I never wanted to do any serious coding in the firebug repl,  not when I used vim as my everyday editor, not now when I use emacs as my everyday editor.   The problem with the firebug repl is multiline functions, it was utterly frustrating to write them the multi-line editor pane, from my memory had no easy way to e   .   Then once you did write a useful bit of code in firebug, you had to copy and paste that back into your text editor, almost completely defeating the purpose of writing it in the first place.  Not so with emacs, which gets repl interaction so right (vim never really tried).  Firefox is a great start for a tool,  it has saved me much time during debugging,  but it alway seemed innacessible to me.
On top of a clunky ui, firebug also only played in the web js playground.  You couldn’t fiddle with firebug itself via firebug.  try this in firebug

>>> console.log.toSource()
"(function anonymous() {return window.console.notifyFirebug(arguments, "log", "firebugAppendConsole");})"
>>> window.console.notifyFirebug.toSource()
"(function (objs, methodName, eventId) {var element = this.getFirebugElement();var event = document.createEvent("Events");event.initEvent(eventId, true, false);this.userObjects = [];for (var i = 0; i < objs.length; i++) {this.userObjects.push(objs[i]);}var length = this.userObjects.length;element.setAttribute("methodName", methodName);element.dispatchEvent(event);var result;if (element.getAttribute("retValueType") == "array") {result = [];}if (!result && this.userObjects.length == length + 1) {return this.userObjects[length];}for (var i = length; i < this.userObjects.length && result; i++) {result.push(this.userObjects[i]);}return result;})"

See those anonymous functions, it feels like you are oh so close to being able to change firebug's behaviour, but you can't really touch that code You can't access the variables because they are in closures.  This is actually much less opaque in 1.2.1 then it was in 1.0 or 1.1 (I can't remember which version I used to run.
MozRepl doesn't seem to suffer from those problems. You seem to be able to change anything in the browser, including the url, including which tab you have currently selected.   This opens up a whole new realm of possibilities for what you can do with your browser.

As a side note, on the moz-repl  wiki, for emacs integration it is recommend that you point your browser to  chrome://mozlab/content/mozrepl/javascript.el to get the javascript elisp file necesary for emacs integration.  The problem is, that with FF 3.0 at least, accessing that url gives a blank page.  to get to javascript.el you need to download the xpi file (firefox's extension format) and unzip it (xpis are compressed and packaged similar to apple dmgs).  Once you do that, you will be able to find javascript.el and other files.


to get to javascript.el and moz.el

first unzip mozrepl.xpi

then unzip chrome/mozrepl.jar

there you will find the two emacs files

Matt says that you can also download the files here

3 Responses to “mozrepl is the most exciting firefox extension I have ever seen”

  1. matt says:

    I unzipped mozrepl.xpi , and found no .el files. Can you put it up on github or something? BTW, switch to git, also. It curb-stomps subversion.

  2. bard says:

    I fixed the wiki so that it points to *.el files online, not on chrome://. Thanks for pointing it out!