Cesar’s Vanilla Blog

White and creamy wtf

Refractor, aka prism-ext, aka Prism for Firefox, aka…

Whatever you call it1, it is finally here (yeah, this is coming a few days late. But if it wasn’t so high on my to-do list, this would come 2 weeks later). Congratulations to everyone who helped push this release. Mozilla Labs did a good job of outlining the features, though only briefly mentioned one of the most valuable (this is subject here) feature of the extension: easier webapp distribution.

Refractor makes use of the link tag in web pages to identify webapps. The line itself is quite simple

<link href="gmail.webapp" rel="webapp" title="Google Mail">
Yeah, no </link> or />. That’s HTML for ya’!

Not to say that sharing webapps before was in any way difficult, but I think being happily notified is nicer than finding and downloading and running and installing. Especially if there is a lot to try.

There are still some things left to be done. I want to see

  1. Recommend addons/plugins with certain webapps (ie. google gears with google reader for offline support, flash for youtube)
  2. Choose website styles/themes
  3. World Domination

I would also like to see some things done to Prism :

  1. Greater interaction with the desktop. I want to double-click a odt and open it up in google docs. No excuses!
  2. Linux requirements says that hal and dbus are required. Maybe we can do something cool here with webapp.js?
  3. Allow people to change their preferences such as proxy and access things like password manager

This is a prototype, with plenty of bugs (I found one just doing this post), but we fix them as we get them.
[1]Refractor, if I recall the story correctly, was coined by Mark Finkle as it reminded him of what happens when light hits a prism : it refracts. Well, it was certainly more creative than prism-ext, while being less obtuse then Abbe prism.

Update : Thanks Percy Cabello for pointing out a mistake

March 12, 2008 Posted by | Mozilla, Seneca | , , | 8 Comments

Customizing the Web

WARNING — An overenthusiastic developer with ksnapshot post.

Something fun I came across while watching Prism being developed is adding bits of Javascript to pages to change their behavior and look. Greasemonkey is a Firefox extension that helps you manage these Javascript files and applies these files to web pages. While fun and sometimes handy, I haven’t found it overly useful.

I then came across Stylish, another extension except this one changes CSS. When combined with some good stylesheets, they make for a good, sometimes drastic changes (click on the preview for a bigger picture) :

stylish facebook

stylish ftp

Google reader with a Mac OS theme. Oooh, pretty.

stylish google reader

stylish Wikipedia

Youtube. Despite not having Flash in this profile, I couldn’t resist.

stylish youtube
After finding a few cool ones for google maps, I made it into a prism web bundle (not perfect) to make it look more like a desktop application.

Prism Google Maps

What’s really nice is that Google maps did not change, I changed Google maps. If this was a Flash application, I certainly wouldn’t know how to do it. I can guess that it would be a lot more work. Then again, Flash can do things that the web yet can’t. But we’ll get there.

November 9, 2007 Posted by | Mozilla, Seneca | , | 1 Comment

How to get into Open Source

This isn’t easy to explain. I tried today, and I sorta lost myself and cut it shorter than I should have. But why is it important? Because people actually believe that you cannot get started unless you are already involved.

My involvement in open source begins Summer of ’06. While I was already working with the Linux OS and in the Linux club, I never got involved in anything else. My good friend Tom got word that Mozilla (he was partially working on it, I don’t know the exact involvement of how he came into it), was looking to port distcc to Windows and use the Microsoft Visual C++ compiler. I thought it was an interesting idea (actually, deep down, I honestly didn’t think we were going to take it as far as we did. I think that without that Open Source course, it may have never happened), and went with it. In the beginning, it was hard to be enthusiastic about something you cannot say you made, and you don’t understand. I didn’t make distcc, I was reading its cryptic code (cryptic at the time. Now I would love to write code like they did). Once we chose it as our course project, the deal was cemented. I had to work on it, commitment was mandatory.

And that commitment gave me many highs and lows. The high we got when we finished porting all the functions and passed all the testcases, and the low we got when it didn’t work for the first time. The excitment of distcc building Mozilla over Cygwin, the whimper after it failed midway. The orgasmic feeling after a four line patch did it, and it built, and we could finally go home. Happy. That was after months of work on the project.

But through that, people did take notice. Mike Shaver(++) did, and was so happy/grateful/pressured, he even offered me an internship at Mozilla. That experience made all the pain of looking through megs of distcc log files worth it (I’m sorry to say that Tom was done school by the time my internship started. I also owe him a big thank you). What made the Mozilla experience unique, is that they wanted you to see what Mozilla was really about. After all, who takes you on a plane and fills out your visa work, and sends out thousands of miles away to do work? Mozilla did, and it ended up being one of my most wonderfully enriching personal experiences.

Once I got there, word spread around. I was actually glad that some of the build team mentioned distcc. Though, as far as I know, its not being used for tinderboxes (this may be due to the introduction of dual-core and quad-core processors, and the overhead of sending this over desktop machines, inefficient. I honestly don’t know if MSYS is the savior for this), its nice getting recognition for something you have done.

And it is that internship that pushed me towards the deeper end of the Mozilla platform. I still have a long ways to go before towards understanding how things still work, but I’m getting there.

Working on Open Source still requires a fair deal of effort, and you really need the motivation to keep you going once you get started. It is incredibly easy, and sometimes tempting to give up. But true character comes out when you spend days on a problem, that shows determination. Anyone, can just give up. And so many people do. I even do it sometimes.

I invite others to post on their blog on how they got involved. Show some other people you didn’t spontaneously spawned and just knew what to do.

October 5, 2007 Posted by | Mozilla, Seneca | , | 4 Comments

WebRunner in the works

I have been spending a bit of time in the Mark Finkle‘s idea of WebRunner. There has been a few discussions on it how far along to take it, and even what we should do with it.

There has been some discussion about shipping it with Firefox 3, but I think that has been put behind in favor of an extension to Firefox so we can follow our own timeline. Luckily, FF3 has a new neat feature that allow you to pass the -app parameter to run a xul application. Nifty.

So I am releasing a very beta release WebRunner Extension. It comes bundled with the latest stable release of WebRunner. It is also a simple demonstration of what I think might be the right direction, but I may be totally off. I look forward to comments and constructive criticism, not for a tongue lashing and threats of bodily harm (unless you attended the webrunner meeting).

There are two ways to start WebRunner: On the fly and tagging a bookmark.

If you tag a bookmark as “webapp”, the next time you visit that page you will be prompted if you want to open that page in webrunner. This suffers from slow response and a few bugs, which consequently will cause two prompts to come up (simply cancel the second prompt). This also doesn’t allow you to specify whether you want to show the navigation/statusbar/location bar.

The other way is to do it on the fly. Under the tools menu, there is a “WebRunner” menuitem which will prompt you for things to show. It will open Webrunner after you click ok.

Neither method is as flexible as .webapp files, at this point in time. I’m trying to stay away from .webapp files, since the implementation is still volatile. This might be used as a desktop application, or not. I don’t know.

You can give it webrunner_ext.xpi (linux, windows) a try. You need a recent trunk build of FireFox however, or grab a nightly. Please also note that WebRunner uses a different profile than your Firefox when running, so none of your preferences/saved passwords are transferred.

August 23, 2007 Posted by | Mozilla, Seneca | 7 Comments

MAR generator release 0.3

This is pretty important, since the last two had a nasty bug in them that could cause the world to implode, and the MAR file to hold the wrong data. Sorry.

Here are some of the highlights :

  • Fish-like mascot
  • You can now localize it
  • More modular. You can probably work on it now 😉
  • You can extract MAR files to a directory.
  • Bugs fixed, and bugs created

I did a test with another MAR files taken from Mozilla’s ftp site. When I extracted/recreated the MAR file, there only seemed to be one small difference between them. For some reason, update.manifest’s permissions shows up as 0666 rather than 0644.

But the file sizes/names/count all seem to be equivalent. Go figure.

There is still the issue of doing partial MAR files. This may end up coming later, or sooner if someone wants to send in a patch.

In the meantime, here is the source and linux(!) build :

MAR generator v0.3 – source
MAR generator v0.3 – linux

August 7, 2007 Posted by | Mozilla, Seneca | 2 Comments

Release early, release often

I got grilled by David Humphrey today for my lousy first release, but I know he was just trying to encourage me to do better in the special way that I require. Here is an excerpt from our conversation :

20:55 <@dave> "I haven.t done extensive testing yet. Though, its simple enough that it probably won.t break on you." (Cesar)
20:55 <@dave> come on!
20:55 <@dave> https://cesarmoco.wordpress.com/2007/07/30/a-mar-generator-release/
20:55 <@dave> I also can't go on vacation with students writing things like that!
20:55 < cesar> ;)
20:56 <@dave> "Needs some documentation. But at this point, you can probably figure it out."
20:56 <@dave> it gets worse
20:56 < cesar> its a first release. Hey, release early release often right?
20:56 <@dave> I'll be waiting on the "often"
20:56 < cesar> when did I write that?
20:56 <@dave> yesterday
20:56 <@dave> !?!

In hopes of generating more steam, I worked some more on this little XUL app and come with you with pictures and a release.

First, the screenshot. Although not appealing, please do notice that I have tabs and a proper menubar. Classy

version 0.2 screenshot

Also, the help menu has a contents submenu that may actually help. There is also a progress bar, which didn’t work/exist in the previous version. There is also some bug fixes, but it isn’t documented anywhere.

Anyways, I did a MAR archive of a mozilla object directory of a debug xulrunner build. I got a 255MB MAR (mind you, this is including libraries as well as object files, Makefiles, and pretty much everything), and it –seemed– to work (ie. it finished). However, I still don’t have extract functionality. Hopefully I will have another release this week.

Here is a breakdown oh what’s going on :

  • Explanation of application appearing to ‘hang’ in the help menu. As well as documentation, both code and user
  • Better (still needs improvement) structure of code
  • Stuck an observer pattern in there for those brave enough to venture into the code.
  • Visually kicks more ass.

Wish me luck!

Linux : MAR_generator-v2.tar.bz2 – version 0.2

I am getting closer to getting a mini-mac and windows. Apologies to those developers who want to try it out.

August 1, 2007 Posted by | Mozilla, Seneca | 1 Comment

A MAR generator, release

I have received some comments on the MAR component patch. Most of it regarding a Interface change, which I am not prepared to do at the moment. There is also a bzip2 issue that still needs to be addressed.

So while wondering how to get that issue resolved, I decided to create a small (a little on the ugly side) XUL app that will generate a complete MAR file that is compatible (I believe that to be true right now, unless I overlooked something) with the Mozilla update system. That is, files are bzip2’d before being put inside the archive.

I haven’t done extensive testing yet. Though, its simple enough that it probably won’t break on you.

There are known issues with it right now that will be fixed with time :

  • Its not localized yet, as I hardcoded all the messages.
  • It’s one xul file with js in it, so the project still needs to be structured properly.
  • One thing you may have to change is the location of the bzip2 utility. Until the bzip2 issue is resolved, the xulapp calls an outside process to handle the compression. The default is /bin/bzip2. If your system has it in a different location, you will need set the appropriate setting in defaults/preferences/prefs.js (there are only two setting at the moment).
  • I don’t know how to properly use threads, from JS. I can’t create JS threads, and settimeout() won’t work for what I need to do.
    Until that is resolved, the xul window will appear to freeze until the MAR file has been created. This is normal.
  • Needs some documentation. But at this point, you can probably figure it out.
  • The MAR file should be created in a temporary environment. After you copied the mar file, feel free to delete the remaining files. You can’t specify where to save yet
  • It will recurse and copy all files from the root directory and above. There is no way to select certain files, yet.
  • You cannot extract MAR files yet.

If your feeling brave or just interested. You can grab a linux build

MAR_generator.tar.bz2 – version 0.1

Windows and MAC builds too someday. Hopefully soon! *hint hint, nudge nudge*

July 30, 2007 Posted by | Mozilla, Seneca | Leave a comment

A long overdue update

Just because I haven’t blogged in a while, doesn’t mean nothing has been going on. Hopefully, blogging isn’t any indication of how much work your doing (in fact, the people that tend to get the most done tend to blog the least!).

Personally, I’ve been keeping busy. I set up a Picasa photo album on Google (only 1 gig of space?) and put up a bunch of photos of all the interesting things I have done.

Professionally (yay), I’ve been working on creating a MAR component as a first step towards hopefully making it easier for xulapp developers to easily update their xulapps. It won’t get into the tree (as it probably shouldn’t), but there are several xul applications out there that don’t have the ability to update to the next version without completely reinstalling the application.

Of course, my work doesn’t solve the problem completely. There is still the question of developers uploading MARs and the infrastructure in place for users to get them (aus3 anyone?).

One step at a time.

July 24, 2007 Posted by | Mozilla, Seneca | Leave a comment

Thoughts on Javascript

In one of my courses at school, I had to do a project that involved a ton of web work. I have done enough web work before, using php/perl/asp, and I even had a course that explained a bit of javascript. After going through that, I came to the conclusion that php/asp are here to stay and perl/javascript are going to die soon enough (in fact, I was with two profs when they were talking about organizing one of the other diploma programs. They were thinking of replacing a perl course with python. AFAIK, they haven’t done it yet).

Right now, of course, I’m nose deep in javascript, and with that exposure I am beginning to think about it in a whole different way.

When I did server-side programming, I never thought of actually incorporating javascript into the application for anything else other than simple validation. That was what I was taught, do client side validation using javascript … then do it again on the server side in case they turned javascript off or something.

With such redundancy, it wasn’t even worth the effort, other than saving a call back to the server. Coming into Mozilla, I never understood the attraction to the language. It’s too simple, ugly, confusing, and just.. well, going back to the punch card. It seemed obsolete, and I wondered how far this joke of improving the language was going to last.

Then again, I was (and still am) completely ignorant about AJAX and the power of the language. The most exposure to AJAX I got pre-mozilla was when we incorporated a calendar and ajax popup into a web page. And that was so far off from client validation, that I didn’t even think of it as javascript.

With new libraries coming out like FUEL and jQuery, it seems worth it to take another look. Especially once you realized that javascript, and the Mozilla Platform has been even been used in some complex applications.

One of my favorite demos yet, and something that I was trying to reproduce is the image gallery javascript demo. I started a subproject (called photowheel), which sucks compared to the link. This started after a few people recklessly put up images using flash.


You know who you are.


Next you’ll be asking me to download Air to view your text-only document.

I don’t think javascript is perfect. Javascript heavy websites (zimbra, gmail) are pretty slow to load up. This may be for a number of different reasons, but its not pleasant to wait for your browser to respond to a new tab and take up >50% your CPU.

July 5, 2007 Posted by | Mozilla, Seneca | Leave a comment


Passively Multiplayer Online Game. That was a brown bag topic here at Mozilla, which I have rather forgotten a good portion of it. But the goal sticks; reward people for surfing the web.

The most attractive aspect of the game is that it is passive, which is rather unique. It doesn’t command, nor require your complete attention. So what’s the point?

In my day-to-day work schedule I rather view on a selected few sites. I may rarely visit more than a dozen sites. mozilla.org would be one, mozilla.com, xulplanet.com,… bugzilla, but that falls under mozilla.org… google.com,….google.ca,…. that’s about it. Far less than the dozen I estimated.

On my spare time, I visit my personal sites. I won’t outline them here, of course. I may visit a few more sites.

PMOG rewards people for exploration and exploitation. You earn points by visiting different websites, and exploit them by setting up ‘mines’ so other people lose points. You complete quests, which gives you even more points. (Is it just me, or is it starting to sound less like a passively multiplayer game?)

Once you have accumulated all these points, into the thousands, and tens of thousands, and heaven forbid the hundreds of thousands. You can have a beer, and say you waste your time surfing the internet.

PMOG is a firefox extension that tracks where you go on the web. As creepy as that initially sounds, they claim only to take the url and date/time and discarding the url afterwards. Although I wouldn’t earn many points. I don’t explore the web as much as some people do.

I took it out for a test run under a new profile, and did the drugs quest and the ‘tools of the web’-type quest. Although fun, its also very slow to load. I think the images are even pulled from the web.

One thing that is preventing me from using it, and others too, is the very nature that its tracking everywhere you go. Whether it discards the url afterwards is irrelevant (to me anyways). Although now its for targeted to people ‘like us’, I’m less than thrilled about something sending information to some foobot about where I go. Are my fears even justified? Have I no faith in these people? Everywhere I go, information can get tracked and logged.

June 25, 2007 Posted by | Mozilla, Seneca, Uncategorized | 1 Comment