2008-05-03

Dear Luis:

FOCUS, YOU BABOON!

2008-04-30

Love On Tax Holidays

Honorary cheetah and explorer extraordinaire Robert 'Hawk Killer' Love tells it like it is.

2008-04-23

Easy Binary Components (again)

I've updated the binary XPCOM component starter kit to version 0.2. Thanks to Mossop and Benjamin for helping me understand the Gecko SDK a bit better. There is no longer a requirement to copy mozilla-config.h (mistyped as 'mozilla-build.h' in my last post, heh). To build a binary component you simply:

  • Download the Gecko SDK, place it anywhere you like.
  • Download the starter kit and unpack it into your extension (it'll create a src directory).
  • Run 'make sdkdir=/path/to/sdk install' inside the src directory.

Then restart Firefox (which you hopefully already have configured to point to your extension), and the new component will be automatically loaded. You can test by opening the error console and executing this line:

Components.classes["@mydomain.com/XPCOMSample/MyComponent;1"].name

If you get the name back, it's working! If you get an undefined property error then something is wrong. Let me know if it's something I can fix in the kit.

I hope this makes it easier for other people get started writing binary components. I particularly like that it doesn't require having full mozilla source/objdir trees, that should make it easier to integrate a new component into an already-existing extension.

Happy hacking!

2008-04-18

Binary Components In Extensions

So, you've decided you need a binary component in you add-on? Great! read this. Okay, that's a little long and complicated (sorry, Matt). How about this? Ah, that does look simpler, but it doesn't work on a recent Mozilla build, you say? Fear not, I have for you:

The Binary XPCOM Component Starter Kit

The actual component is the same from Alex Sirota, so do read his page, it has a ton of useful information. My version has an updated makefile (not yet tested on windows, I plan to do that soon), and is designed to be unpacked directly into your extension. It will create a "src" directory with sample sources.

What you need:

  • An already set-up extension, already set up to be loaded on some profile you test.
  • The gecko SDK. If you have a mozilla build tree, that's in objdir/dist/sdk
  • A mozilla-build.h file, see this bug for details. Copy it into sdk/include for now.
  • A mozilla build environment (compiler, etc).

Once you unpack the tarball into your extension, go into the src directory and run 'make sdkdir=/path/to/sdk'. If all goes well, it should build the component and place it into a platform-specific directory in your extension (did you know you can include multiple builds of a binary component, for each platform, in the same extension?).

It's pretty rough, I just spent some time on the makefile yesterday and haven't tried to make it work on Windows yet. But it's a start!

2008-04-14

I Am Shocked

and appalled to learn that my coworker myk runs safari.

Me Too

I switched laptops recently, so I'm not sure how accurate this is, but here goes anyway:

$ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
143 ~/Apps/Firefox.app/Contents/MacOS/firefox
85 ls
57 cd
53 hg
40 rm
20 ssh
10 mv
10 ln
8 less
8 grep

Update: Fixed up the newlines. The meme came to me from planet.gnome.org, for any who are curious :)

2008-04-11

Yay, Goodies

Today I had to go to the management office of my apartment complex. It turns out that when my rent went up a couple of months ago I updated my bank's auto-pay only for the next payment... so after that they reverted to the old amount.

That's the second time it happens to me (last time it was a few years ago, back when I lived in Newton). The thing that bugs me is that I was sure I'd done it right this time. The web app for managing bill pay is very unintuitive to me.

On the plus side, I picked up two amazon packages waiting for me at the office: one with GTD and Presentation Zen, and another with Home Movies, Season Four. Woot!

2008-04-08

Add-on Helper Modules

Over the course of Weave development, there have been several JS modules that I've written or integrated into the add-on, but which could also be quite useful to other extension authors. These include modules for logging and asynchronous operations, for example.

I've been meaning (and a mfinkle keeps reminding me ;) to put these modules out there for others to reuse, and I'm finally ready to start doing that. The modules are by no means frozen in any way, but will hopefully be useful to someone.

So, without any further delay, here is a wikimo page I have started with the first module, a log4*-like service: JS Modules.

Feedback (and/or patches) would be most welcome!