Microb Browser Extension Testing

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.

This entry was posted in Browser, Maemo, Open Source, ThisIsMobility. Bookmark the permalink.

10 Responses to Microb Browser Extension Testing

  1. Alendit says:

    it’s funny thaat i tried the same thing recently, with the same result. I even wrote a mail to microb port team, no response yet. I solved the problem by installing privoxy and using add-header/hide-user-agent.
    If you just want to change your UA, go to about:config?prefname=general.useragent.override&prefvalue=Mozilla%2F5.0+%28N8x0+like+iPhone%3B+U%3B+Linux+like+Mac+OS+X%3B+ARM%3B+en%29+AppleWebKit%2F420%2B+%28Gecko%2C+like+KHTML%29 , this will change your UA to that of iphone.


  2. Miguel A. Arévalo says:

    What about Google Gears for MicroB ? Is it possible ?

    Having Google Readers on my 770 for online filtering my news while on the subway going to work would be great.

  3. James says:

    @Alendit you beat me to the about:config tip. You can easily set it as a bookmark to change your user agent whenever you want. I was worried it could be abused if websites linked to about:config urls, to for example change the home page, but fortunately this doesn’t work.

  4. James says:

    Well, wordpress killed that link, but I’ve tried accessing about:config from an external site with links, iframes and javascript and it appears to be secure

  5. tonikitoo says:

    mike: all ported extension so far (greasemonkey, spellchecker, flashblock and adblocker) required major manual work apart from “dump”s on debugging to find out which specific piece of code was breaking it … the lack of xul, overlay, xbl makes ports really harder … what i can tell is that currently all development is done/tested on i386 env and only after getting everything working on it we start making tests on the device … it also worths to say that microb’s codebase is dated from firefox3/a5 frametime, when many problems existed on xpcom startup, extension manager and maybe further important components for extension development … which makes all this process harder.
    alendit:I didnot recall your email for browser-extras mailing list =/

  6. timeless says:

    Sorry to hear about your problems. Could you possibly send me a link to version(s) of your extension? I’d like to look.

    Alendit: I don’t recall such an email, what address did you use?

    Miguel A. Arévalo: Rumor has it that Google will publish it.

    James: thanks for investigating, I wrote the feature and I’m glad to hear it works as it should.

  7. miker says:

    Hey Alendit and James, interesting, I didn’t know you could make a bookmark do change the config. I thought that removing the override would be a pain (cause you can’t really remove an item can you? You have to set it back to the default). But bookmarking the change is a nice elegant solution to that.

    @timeless, sure thing, Here’s a hacked up version of adblock that had the change header in there as well:


    a direct modify headers package:


    and another of the experiments, mostly modify headers based:


    I didn’t realize the Microb stuff was so far divergent from the desktop, maybe I’ll just drop it and fool around with minefield instead.

  8. Alendit says:

    @all from browser-extras
    Sorry, was my fault, I’ve sent mails to a wrong address. Thanks for packaging Modify Headers.

    P.S. This was my mail, if someone is interested

    Hi, all
    is it possible to port ‘Modify Headers’
    (https://addons.mozilla.org/en-US/firefox/addon/967) to microb? I’d do
    that, but I have no idea what the differences between firefox and
    microb are. Some links to this subject would be nice.

    If someone know an easier way to add x-wap-profile string to microb
    header i’d very appreciate it.

    Another question (a little off-topic, maybe): is it possible to turn complitely off https/ssl on microb? My Wap-Flat doesn’t include https so I can’t read my mail or feeds.


  9. I had assumed that FF and nicroB were much more similar than not, but after reading this and the comments, I see that I was indeed wrong on that note. It seems that microB was built on a considerably unoptimized archecture (probably released too early?) and that’s part of the reason why these extensions are not so easy to develop. It would seem then that there could be no certainity on developing extensions on mircoB until the extension support for FF3 is finished (which is a while yet I think).

    Had I know this, I probably wouldn’t have bugged the developers that I have about their respective plugins. Now I know that I better bug the microB developers and see what can be done there ;)

    To the commenter above, there is a Google Gears install for microB available: http://www.internettablettalk.com/forums/showthread.php?p=147784

  10. Write more, thats all I have to say. Literally, it seems as though you
    relied on the video to make your point. You obviously know what youre talking about,
    why waste your intelligence on just posting videos to your weblog
    when you could be giving us something informative to read?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">