Pragmatic Paddy

November 22, 2008

mozrepl is the most exciting firefox extension I have ever seen

Filed under: Uncategorized — Paddy Mullen @ 6:31 am

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.

EDIT

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

http://github.com/bard/mozrepl/tree/master/chrome%2Fcontent

November 19, 2008

Open Sourcing chartWidget

Filed under: Uncategorized — Paddy Mullen @ 5:23 pm

November 17, 2008

python debug mode in emacs

Filed under: Uncategorized — Paddy Mullen @ 7:37 am

November 8, 2008

How I moved to New York City

Filed under: Uncategorized — Paddy Mullen @ 9:09 pm

November 2, 2008

Ani Difranco

Filed under: Uncategorized — Paddy Mullen @ 9:41 pm

March 29, 2008

smart people

Filed under: Uncategorized — Paddy Mullen @ 10:18 am

March 25, 2008

Axemen on the history channel

Filed under: Uncategorized — Paddy Mullen @ 1:50 pm

March 19, 2008

The advertising club of New York

Filed under: Uncategorized, startups — Paddy Mullen @ 10:55 am

May 2, 2007

Blinksale highly recommended

Filed under: Uncategorized, startups — Paddy Mullen @ 2:54 am

April 23, 2007

An interesting site about music production

Filed under: Uncategorized — Paddy Mullen @ 4:10 pm
« Newer PostsOlder Posts »

Powered by WordPress