After my IUI Maemo Microb hackery the other day I started pondering making the browser lie to say it was an iPhone. More cause I wanted to hack around some with extensions and Microb than because I really find myself using iPhone sites all that often (though I will say that ShifD on the iPhone is way way more pleasing than it is on any other device).
I expected it to be no problem, there’s a Modify Headers extension for Firefox, there’s documentation about how to package an extension, there’s a working set of extensions to start from. Yet still I have failed.
Microb doesn’t support XUL, so I knew I couldn’t rely on the stuff for preferences and additional windows, etc. I just created a version of the plugin that held a static Modify user-agent rule to make the browser emit the same UA as an iPhone example I pulled from my logs. I loaded the xpi into my desktop browser, and sure enough when I restarted it was telling everyone it was as iPhone. W3wt! Used the instructions from the Microb site to package the extension, but there the browser behavior didn’t change. The extension wasn’t listed. I must be doing something wrong says me, how can I test this out?
Fast forward to some time hours later and way way into the wee hours of the morning. I’ve stripped out all the chrome, rewritten the install script, repackaged the browser extra packages to make sure things weren’t funky with my build system, pored over the adblock source, merged modify headers /components directory into adblock to get it to load that way, compared the installed files to my starting files, and attempted installing the extension by hand.
I know a hell of a lot more about Mozilla extensions than I did before, but I can’t help but feel much of it was in vain. Why do all these extensions work no problem on my desktop browser but fail to load on Microb? Is there a way I can get some kind of console or debugging info out of Microb? Should I be running Microb on my desktop when debugging these things? I would love to be able to just hack out Microb extensions on a whim. The way this worked out in my head was actually that I could have a few bits of pieces of stuff I liked to use and I could hack the extensions right on the device. Totally p1mp, I might even have to get a new velvet coat to wear while I do it if I can get it working. But my experience is running very counter to my expectation so far.