You may have heard the saying "If you can't open it, it's not yours." Because Firefox is open in so many flavors of Open, you can really say it's totally yours.

Nintendo Wiimote and Firefox

Mozilla has been designed with extensibility in mind. It means you can enhance, hack, bend, fix Firefox or websites in infinite ways:

  • First, it's a FLOSS project. You can read the source code, modify it, and even roll your own version of Firefox.
  • Additionally, you can write extensions. Extensions and Jetpacks give you a way to do almost anything you want. Change the UI, add new features, fix bugs, or make your life easier as a user.
  • And finally, you can make websites your own. Through Jetpack, GreaseMonkey, and Stylish you can change a website behavior and/or presentation with a few lines of JavaScript and CSS.

Everybody has his or her own reason to hack Firefox. Mine is usually: "just for fun".

So, "just for fun", and to show how far you can go with the extension mechanism, here is a little useless extension I wrote: a Nintendo Wiimote driver for Firefox.
What does it do? It brings Wiimote events to web content. You can change tabs with a "forehand/backhand" tennis drive and, in your web page, make your elements move using Wiimote events (rotation, g-force, position, etc.). Web pages, of course, do not support this API. But, with another extension, such as a Jetpack or Greasemonkey, you can "hack" a website to add support for the Wiimote.

Let's see what it looks like:

(I know, a Flash Video. GandiBlog doesn't allow the video tag. Ogg/Theora version here)

What I do here is:

  • Change tabs by moving the Wiimote quickly
  • Rotate the Firefox logo by rotating the Wiimote
  • Move a canvas "cross" by moving the Wiimote
  • Zoom the Firefox logo by moving the Wiimote closer or farther away from myself
  • Use the Wiimote as a controller with this canvas game, which has been adapted with a Greasemonkey script

Feel free to grab the code and look how a C++ extension works with the Mozilla build system. See the readme for build instructions.

This extension only works for Linux as of now. I probably won't have time to port it to other platforms or to work on it further. But maybe you can :) Feel free to make this code your own and make it work for other OSes.

"Happy hacking" ;)