Category Archives: Mozilla

Picture a Mozilla geek standing on the shoulders of another to reach an electric outlet in the ceiling, then expecting to be returned to firm floor and instead being shuttled elsewhere to the reason of “one more outlet to gooooo!”.

Picture the chatty signora who serves drinks and panini at the bar, getting asked tens of chairs first, then an old knife to be used as a screwdriver to assemble fans (no, not the human variety), then rags to clean above said chairs retrieved from the basement from above said geeks. Picture her respond with more lively chatter instead of increasing threats to kick us out.

Picture two guys who never gave a presentation together bantering/negotiating on stage, much to the audience’s amusement, which slides to skip to make time for an unplanned but ubercool presentation. (Of course I was right most of the time but Luca was tougher. :P)

You might think by now that the Mozilla Add-On Workshop had more than a bit of adventure in it, but our men in Florence Giacomo and Iacopo (from Mozilla Italia) as well as the headquarter agents Paul and William (from Mozilla Europe) plowed through every obstacle and got us safely to the heart of the workshop: an introductory talk on Firefox extension development, a hands-on tutorial, and a short finale on the tricks of the trade.

Despite many rough edges and a wealth of non-obvious material to cover (we went from zero to a Twitter-search extension to interactive development in less than three hours), almost fifty people gave us full attention and support, which is a testament to the rising interest on the subject in this country (or to the seldom sung quality of Italian patience (or both)).

If you were there and your questions went unasked or unanswered because of time or because you couldn’t hang out afterwards; or you want us to keep you in the loop about this Fall’s initiatives; or you just want to say hi, feel free to get in touch with us or leave a comment here or on the Italian version of this post.

In October I introduced custom interactors and someone asked what can be done with them other than application inspection.

Here‘s a practical application that turns Firefox into a screenshot server. It lets you request e.g. http://localhost:4242/screenshot/http://en.wikipedia.org and receive a PNG screenshot of Wikipedia homepage. (Instructions to run it are at the bottom.)

Features and things to note:

Every page is loaded in a new tab, meaning that multiple screenshots can be requested concurrently.

You can have MozRepl listen to outside requests and thus have the server run on a machine (or machines) other than the one requesting screenshots.

This is no finished product but it should give a hint of the possibilities. Known issues: since it takes the screenshot upon DOM load event, pages that use the same event to build sizeable portions of the document (such as iGoogle) might turn out incomplete or just white. Also, Firefox 3.1 seems to hang when the same browser instance is both the requester and the receiver of the screenshot (ok, not the most useful scenario, but still).

(Flashback: MozRepl is an interactive shell for Firefox and other Mozilla apps. You connect to Firefox with telnet or similar, type some JavaScript code, and it gets executed on the fly.)

I patiently explained how a command line inspector would look like. More or less like:

First guy: “Well, and how do you get this in MozRepl?”

I (im)pantietly explained that there was no inspector yet.

First guy: “Why not?”

I (im)patiently…

Second guy, out of nowhere: “Yeah, why not?”

You know that you’re in trouble when even the nicest guy in the place teams up to nag you.

Then I spent some time not to write an inspector, but to make it possible (and easy) for third parties to write new interaction modes for MozRepl, so that the onus of writing the damn inspector would be on the above guys. (The best thing you can do with challenges isn’t winning them, it’s turning them upside down.)

However things quickly got fancier while I explored, because the same request/response pattern interactive interpreters are built around is common to a lot of applications. Object inspectors, sure. Even text adventures (“You’re in a dimly-lit browser, surrounded by menacing angled brackets and curly braces”).

But also HTTP.

One custom interactor later, there it was: Firefox understanding HTTP and browsing itself.

Where to go from here? Once there’s a halfway decent implementation of HTTP (hint: mine isn’t), you may be able to drive Firefox with XML-RPC, JSON-RPC, REST-style manipulation of resources, and who knows what else. (Oh, yeah, I guess server-side long-timers in the audience will know what-else very well.)

Support is available in the new stand-alone MozRepl package. To try out the http-inspect mode, just go to about:config and set the “extensions.mozrepl.defaultInteractor” pref to “http-inspect”, then point the browser to http://localhost:4242. Documentation on how to write custom interactors is on the wiki.

This blog used to be mostly about SamePlace. If you’ve been reading it long enough to remember that, you’re probably one of the early adopters, so please virtually celebrate with me this little bit of news.

SamePlace won a grand prize together with Shareaholic and Minimap (the announcement lists them in alphabetic order with a numeric bullet and they look like first/second/third prize—they’re actually co-winners, just like the twelve runners up.)

And it seems it’s been a productive time for Italy: my friend Davide is there too with Table2Clipboard. Not bad for this old little country.