Over the past year and a half I’ve been spending more and more of my time working with Mozillas latest project, Firefox OS. During that time I’ve fallen in love with the project and what it stands for, in ways that I’ve never experienced with a technology platform before.


What is Firefox OS?

For those of you wondering what on earth Im on about, let me bring you up to speed.

Firefox OS is a new mobile operating system developed by Mozillas Boot to Gecko (B2G) project. It uses a Linux kernel and boots into a Gecko-based runtime engine, which lets users run applications developed entirely using HTML, JavaScript, and other open Web application APIs.

— Mozilla Developer Network

In short, Firefox OS is about taking the technologies behind the Web, like JavaScript, and using them to produce an entire mobile operating system. Just let that sink in for a moment — its a mobile OS powered by JavaScript!

To do this, a slightly-customised version of Gecko (the engine behind Firefox) has been created that introduces the new JavaScript APIs necessary to create a phone-like experience. This includes things like WebTelephony to make phone calls, WebSMS to send text messages, and the Vibration API to, well, vibrate things.

But Firefox OS is much more than the latest Web technologies being used in crazy ways, as awesome as that is, its also a combination of many other projects at Mozilla into a single vision — the Web as a platform. Some of these projects include our Open Web Apps initiative and Persona, our solution to identity and logins on the Web (formally known as BrowserID). Its absolutely fascinating to see so many different projects at Mozilla coalesce into a single, coherent vision.

Ill leave the description there as this entry isnt about explaining the project in fine detail, though more information can be found on the Firefox OS pages on MDN. I definitely recommend checking them out.
Why Firefox OS?

So you might be thinking, This sounds great, but why use JavaScript to build a phone? And youd be right, thats a really important question to ask. The good news is that there are plenty of reasons why this is a good idea, besides making Web developers weak at the knees.

The two major reasons are that Firefox OS fills a gap in the mobile market, and that it provides an alternative to the current proprietary and restrictive mobile landscape.
Closing a gap in the mobile market

Its no surprise to anyone that smartphones are often ridiculously expensive, even in areas of the world that are perceived to have high levels of income. But if you thought they were expensive in countries that have the disposable income to afford them, consider for a moment that a 16GB iPhone 4S costs the equivalent of £615 in a developing market like Brazil — thats over £100 more expensive than the same phone in the UK!

Now, those inflated prices in Brazil are mainly down to high levels of import tax. Apple are apparently working to avoid that in the future by building local production lines in the country. Regardless, it points out a key issue in that expensive, high-end devices arent always an option in all areas of the world. Let alone the fact that in some societies you might not want to publicly brandish a phone the price of a small car.

So what do you do if you want a smartphone experience without shelling out a stupid amount of money? You could turn to the cheap Android devices but they tend to run poorly.

Fortunately, this is where Firefox OS comes in…

The goal of Firefox OS isnt to compete with high-end devices, but to offer entry- to mid-level smartphones at feature phone prices.

— Bonnie Cha

Firefox OS fits this gap in the market perfectly. It offers a smartphone experience on cheap, low-end hardware that is comparable to an Android experience on mid-range hardware. That is not a joke.

For example, I am currently testing JavaScript games on a Firefox OS device that costs £50 (arguably, a very low-end device). You may expect them to run pretty poorly but they not only run much faster than the same games running in an Android browser (Firefox or Chrome) on the same device, they run as fast, if not faster than the same game running in an Android browser on a much better device that costs 4 or 5 times as much.

Why the huge performance improvements over browsers in Android on identical devices? Its because of the lack of stuff going on between Gecko and the hardware, meaning things like JavaScript can run at full pelt. So much for JavaScript being slow!

This JavaScript performance on such cheap hardware is one of the reasons why Im convinced that Firefox OS is the beginning of something huge.

I should point out that Mozilla isnt necessarily launching with a £50 device, its just one that were currently using for development and testing.
Providing an alternative, open platform

The second reason for Why Firefox OS? is that its an attempt to not only provide an open alternative mobile platform, but to stand up to and try and influence the big proprietary mobile players to change things.

Mozillas mission since its outset in 1998, first as a software project and later as a foundation and company, has been to provide open technology that challenges a dominant corporate product.

— Steve Lohr

Mozilla is attempting to replicate its success with Firefox, in which it stormed the browser market and showed users that there is an alternative, one that lets them be in control of how they use the Web.

This time, its the mobile Web thats threatened, not by Microsoft but by Apple and Google, the leading smartphone platforms. With their native apps, locked-down platforms, proprietary software stores, and capricious developer rules, Apple and Google are making Web technology less relevant.

— Thomas Claburn

On mobile, one of the main areas that needs improving is application portability…

For all the excitement around mobile apps, they seem a step backward in one respect: they tie users to a particular operating system and devices that support it. The Web, by contrast, evolved so that content is experienced much the same way on any hardware.

Mozilla, maker of the Firefox Web browser, is determined to make the same thing true for smartphones.

— Don Clark

What Firefox OS aims to do here is to use the native everywhere-ness of the Web to provide a platform that allows applications to be enjoyed on a mobile device, a desktop computer, a tablet, or anywhere else that has access to a browser. Wouldnt you want to be able to pick up your Angry Birds game on the desktop where where you left it on your phone? I certainly would!
A hackable dream for developers

One final, extra reason why Firefox OS is needed is that we dont really have a comparable hackable mobile platform at the moment (you can sort of customise Android but its not easy).

Because Firefox OS is constructed using HTML, JavaScript and CSS it means you only need basic Web development skills to reach in and completely change the device experience. You could literally change one line of CSS and completely change the way the icons on the homescreen look, or re-write some core JavaScript files that handle phone-calls.

Its truly a platform for developers and Im most excited about seeing where they take it beyond Mozillas vision.
Perfect timing

Something that Ive been fully aware of during my year-and-a-half at Mozilla is how fortunate I am to be here for the beginning of the Firefox OS project. If I remember right, it was announced (as Boot to Gecko) internally during my first few weeks on the job.

Things were exciting back then but boy have they become even more exciting over time. Firefox OS is literally the number 1 thing that Im working on at the moment and I honestly love it, I actually feel privileged to be a part of it.

Ive wondered many times if this is how it felt to work at Mozilla during the initial launch of Firefox; the excitement, passion, nervousness, and inability to explain quite how amazing it all is and why people should care.

To be honest, I dont think many people will truly understand whats happening with Firefox OS and why it really matters until long after it has launched. A little like Firefox, I suppose.

For now, Im happy to be at Mozilla at a very interesting point in its life.
Blown minds

The people who do get it right now are the developers that have been hands-on with the demo devices that occasionally come with Mozillians to events. Theres not much I enjoy more than watching their expressions as they go through the various stages of emotion while playing with the devices…
It starts with mild confusion — a sort of Why have you just given me an Android device? look
Following confusion is sudden realisation that this isnt Android, its built using JavaScript
After a short while the excitement starts in a sort of Holy shit! mind-blowing moment
A while longer and theyre deep in concentration, exploring every corner of the device and asking lots of questions
The last stage is slight reluctance as I ask for the device back and a final That wasnt half bad, Im impressed! as they hand it over

Youd think I made that up to make things sound all rosy and amazing, but I honestly get those exact reactions from so many people that I show the devices to. Its actually quite funny.

What Ive come to realise is that the more I see others play on a Firefox OS device the more Im convinced that its a real game-changer. It just seems blows minds left right and centre, with barely any explanation needed from me.
Plenty of challenges

It wouldnt be fair to talk about the greatness of Firefox OS and the things Im working on without covering some of the challenges that we need to solve.

On one side there are the more general issues, like how to manage an apps ecosystem thats open and unrestrictive, or possible device fragmentation like there is with Android. Those issues are important but are ultimately uninteresting to me.

However, what Im most interested in is the challenge we have with HTML5 games on mobile devices — both the perceived and very real performance issues that developers often complain about. This is by no means an issue specific to Firefox OS (Android and iOS are just as bad) but right now Im purely focussed on Firefox OS and how we can improve things there.

As it stands, the majority of pre-existing HTML5 games for mobile either run really poorly (0—20FPS), or sort of alright (20—30FPS). Most of the time these games dont run at a stable frame-rate either, which makes the experience not very enjoyable.

Whats interesting is that a lot of the issues dont necessarily seem to be with the device or with JavaScript. There are a few intense games, like Biolab Disaster, that perform stunningly on even the £50 low-end device that Im testing on — were talking between 40 and 60FPS.

Its definitely clear to me that, although the devices and platform are sometimes to blame (not as often as some would like to make out), there is a lot we can learn from the games that do perform well on the low-end devices to see what techniques theyre using and how best to educate other developers looking to target HTML5 on mobile devices.

I truly believe that quite intense HTML5 games can run well on mobile devices, even low-end ones. Why am I so confident about that? Because people are already making those games today. There are 2 things that I trust most in my life… my eyes.

Well get there.
Beyond the mobile phone

What excites me most about Firefox OS has nothing to do with the mobile device that were launching next year but is instead about what the future holds. I touched on this earlier when talking about Firefox OS being a hackable dream, how others could take it and extend it beyond Mozillas vision.


The great news is that this is already happening today. We already have a port of Firefox OS for the Raspberry Pi, as well as one for the Pandaboard. They aren’t perfect, but whats awesome (Ive tried so hard to avoid that word) is that this has all happened before Firefox OS has even reached its first release.

You also have the ability to run Firefox OS via a desktop client on Mac, Windows, and Linux. While not giving you the same hardware access as you get on a device, the desktop client allows you to benefit from the other features of the OS (like apps running in separate processes) and is fairly easy to set up.

I can just imagine a day in the not-to-distant future where the Gamepad API has landed in Gecko and can be accessed via the Firefox OS desktop client. Whats so cool about that? Well its not a giant stretch of the imagination to see that desktop client being run on a device connected to a TV, with the OS customised to use gamepad input instead of mouse and touch (its all JavaScript, remember).

What youd have there is the beginnings of a HTML5 games console, and its actually something Im keen to explore in my free time outside of Mozilla.

My point here is that were coming to a point in time where devices can now be powered by the same technologies that we would normally use to build websites. What could we do with a world full of devices powered by those technologies, that can all access and communicate with the same APIs?

I’m desperate to see what that world looks like!



Please enter your comment!
Please enter your name here