Hands-on with Mozilla’s Web-based “Firefox OS” for smartphones

Launching a new mobile OS is a difficult project since the market leaders, Android and iOS, have such a big lead. Even Microsoft, with its near-infinite financial resources and vast ecosystem of complementary products, has struggled to gain traction. And new entrants face a chicken-and-egg problem: developers don't want to write apps for a platform without many users, while users don't want to buy a phone without many apps.

Mozilla, the non-profit foundation behind Firefox, believes it can tackle this dilemma. In 2011, it announced a new project called Boot2Gecko to build an operating system around its browser. Last year the project was re-branded Firefox OS, and Mozilla began preparations for a major push into the mobile phone market.

In February, Mozilla unveiled an impressive initial list of hardware and network partners. If all goes according to plan, Firefox OS phones will be available in a number of countries, mostly in the developing world, later this year. Firefox OS phones won't reach the United States until 2014.

To sustain any early momentum, Mozilla will need to convince developers to build Firefox OS apps. The company has a plan that's so crazy it just might work: Firefox OS apps will be built entirely using HTML5. According to Mozilla, the thousands of developers who already know how to build Web apps will be able to build Firefox OS apps with minimal additional training. And because they're built on open standards, Mozilla hopes that Firefox OS apps will work reasonably well on other platforms that support HTML5—which is to say, all of them.

Is it actually possible to build full-featured mobile apps entirely in HTML5? Earlier this month, Mozilla sent us a review unit of the Geeksphone Keon with a "developer preview" of its new OS, and we put the system and its "Web apps" approach through their paces.

The Web as first-class platform

Obviously, the concept of building mobile apps on top of Web standards is not a new one. The late Steve Jobs famously insisted that the Web was good enough for building apps for the original iPhone. But it wasn't long before he changed his mind and announced a traditional SDK for building apps with Objective C.

There's an important difference between Apple's pitch in 2007 and Mozilla's pitch today: Mozilla is much more committed to eating its own dog food. The Apple-provided apps on the original iPhone were not Web apps; they were written using APIs that at the time were not available to third parties. This was a clear hint that Apple wasn't that dedicated to the Web-only model. In contrast, Mozilla claims that absolutely everything you see and interact with in Firefox OS—from the phone app to the icons in the status bar—is generated by the same Gecko rendering engine that powers the Firefox browser.

Of course, until recently HTML5 didn't have all the features you'd need to build a full-fledged mobile OS. So when Mozilla says Firefox OS is built on "HTML5," that sometimes means it's built using Mozilla's own proposed extensions to HTML5 that it hopes will be accepted by the W3C (the Web's standard-setting organization) and implemented by other browsers. Here Mozilla is drawing on one of its strengths, as it has a lot of experience developing, proposing, and implementing new Web standards.

At a talk last summer, Mozilla Director of Research Andreas Gal described an example of this process in action. Like any other mobile OS, Firefox OS displays the current battery status at the top of the screen. Mozilla engineers realized this might be a feature that would be useful on other platforms as well, so they set out to make it a Web standard.

After some searching, Mozilla engineers discovered that someone had previously proposed an HTML standard for querying battery status information. They implemented a version of the standard for Firefox OS and then proposed it to the W3C. Discussion at W3C inspired Samsung to adopt Mozilla's proposal and add battery status functionality to WebKit, the open source browser code shared by Apple's Safari and Google's Chrome browsers.

"Two or three months after that, W3C actually passed a battery status API as a recommended standard," Gal said. "So today, the battery status API actually can be found on many phone implementations." Mozilla even added the functionality to desktop versions of Firefox.

In this sense, Firefox OS is as much a project to improve the Web as it is a project to build a new mobile operating system. Every Firefox OS API Mozilla can get adopted by other major browsers makes it easier for developers to convert vanilla Web apps into "native" Firefox OS apps, and vice versa. Even if Mozilla's OS never gains significant market share, the effort to flesh out a complete set of Web standards for mobile computing will help to push the Web forward.

Architecture

The Firefox OS architecture has three layers, dubbed Gonk, Gecko, and Gaia. Gecko is the rendering engine at the core of the Firefox browser. Below Gecko sits Gonk, a bare-bones Linux distribution derived from Android. Above Gecko sits Gaia, a touchscreen user interface not too different from those found on other mobile operating systems.

One reason Mozilla chose to make Gonk a derivative of Android is that many device makers already know how to make devices that run Android. "If you're an OEM, you already have basically all the capabilities to run our system," Gal said last summer.

He described a 2011 meeting between Mozilla and Qualcomm. "They had a reference device we had never seen before," he said. "They were curious: can you run Boot2Gecko on this system?" While Mozilla and Qualcomm executives discussed strategic considerations, "two engineers sat down, one was a Qualcomm engineer with the device and the other one was an engineer from Mozilla who knew the stack." The engineers removed the higher levels of the Android software stack and replaced them with the corresponding parts of Mozilla's software stack.

"In that meeting, the first version of Boot2Gecko ran on this phone device we had never seen before," Gal said. "So if you know how to build Android devices, you know how to bring up our stack."

Gal claimed that the architecture of Firefox OS gives it an important advantage over Android: faster software upgrades. Android's monolithic design means that in many cases Google needs help from the network operator to upgrade a device's software. Network operators often drop the ball, leaving users stranded on ancient versions of Android.

Mozilla hopes to solve this problem by pushing as much functionality as possible up to the Gecko layer of the software stack. Mozilla may still need help from carriers to upgrade Gonk, but it expects that to rarely, if ever, be necessary. Mozilla hopes all the stuff that does require regular updates will be in the Gecko layer, which Mozilla will have the ability to update itself.

Packaging and permissions

A key feature of a modern smartphone platform is its procedure for approving and distributing apps. To satisfy Apple's strict review process, iOS apps must not only protect users' privacy and security, but they must also comply with Apple's user interface guidelines and other requirements. Google's app store is more permissive. And Google, unlike Apple, gives its users the option to install software outside of its app store.

Once the phone was set up, we found that some of the core apps have achieved near-parity with their Android counterparts.

Because Firefox OS apps are essentially just Web apps, app developers are not required to use Mozilla's app store at all. A developer can distribute a Firefox OS app as a "hosted app," delivered from any Web server. Technically, an app's URL points to a manifest, a JSON file describing the files needed to run the app. The manifest can include instructions for caching the app to enable faster startup and offline use.

Alternatively, Firefox OS apps can be distributed in "packaged" form. A packaged app is a zip file containing the app's manifest as well as the other files needed to run the app.

Packaging is required if an app wishes to be designated a privileged app. These apps are allowed to access certain APIs that Mozilla has designated as sensitive. For example, only privileged apps are allowed to access contacts, music, images, and videos on the device's built-in storage, or to initiate a TCP connection.

Mozilla has reserved the most sensitive APIs for a third category of apps known as "certified" apps. These apps are generally distributed with the device. Certified apps can perform functions like making phone calls, sending text messages, and changing settings such as the time and power management. Mozilla's documentation currently says that access to the built-in camera is restricted to certified apps, though providing access to third-party apps is on the to-do list.

120 Reader Comments

Wasn't WebOS (Hint, WEB OS) all HTML5 too? It is amazing to me how many good ideas that OS had before failing. E.g., most of the recent concept videos about how Apple should redo multitasking in iOS essentially points to a remake of the WebOS Cards metaphor, complete with swiping cards off the screen to close.

Apple wasn't the only one shouting about HTML5 programming...if you recall, Microsoft was originally saying Windows 8 Metro apps were to be HTML5 (and JavaScript) only apps. Fortunately/unfortunately that quickly changed as well.

I am in the "wait and see for Firefox OS 2.0" camp to how this will go in the end.

Wasn't WebOS (Hint, WEB OS) all HTML5 too? It is amazing to me how many good ideas that OS had before failing. E.g., most of the recent concept videos about how Apple should redo multitasking in iOS essentially points to a remake of the WebOS Cards metaphor, complete with swiping cards off the screen to close.

And it's open source now.... if only Mozilla had decided to join that effort and make something really amazing.

I HIGHLY doubt this will get very far. Ubuntu Mobile, BB10, and perhaps even Windows Phone were all late to the market, which I believe has transitioned to a consolidation phase. The technical advantages of each are outweighed by rich ecosystems of Android and iOS. The killer apps are the 3rd party apps.

I DO see some good ideas here though. Making things more modular, in order to speed updates, is a good concept. It's something that Google has been doing to a limited extent. Hopefully, we can get to a point where the Linux kernel and drivers can be completely left alone while only upgrading the rest of Android OS

Apple wasn't the only one shouting about HTML5 programming...if you recall, Microsoft was originally saying Windows 8 Metro apps were to be HTML5 (and JavaScript) only apps. Fortunately/unfortunately that quickly changed as well.

I am in the "wait and see for Firefox OS 2.0" camp to how this will go in the end.

MS never said HTML5 would be the only option. They had a few slides in a presentation targeting non developers that only mentioned the HTML5 stack; but which said nothing about the others. MS refused to officially respond to "does that mean HTML5 only" beyond "we're not saying anything until the next developer convention"; but at the same time some bloggers with good internal contacts got off the record statements that HTML5 wasn't going to the only option during the official blackout period.

I HIGHLY doubt this will get very far. Ubuntu Mobile, BB10, and perhaps even Windows Phone were all late to the market, which I believe has transitioned to a consolidation phase. The technical advantages of each are outweighed by rich ecosystems of Android and iOS. The killer apps are the 3rd party apps.

I DO see some good ideas here though. Making things more modular, in order to speed updates, is a good concept. It's something that Google has been doing to a limited extent. Hopefully, we can get to a point where the Linux kernel and drivers can be completely left alone while only upgrading the rest of Android OS

It's not just pushing good ideas at the rest of the mobile industry; the FF browser as a whole is also being improved by this project. Getting enough performance out of Gecko to use it as the OS layer has required moving large parts of the graphics stack out of the main thread. As those changes are merged into the desktop build general FF performance and responsiveness should improve. The progress being made a month ago was enough that they're talking about process/tab again (initial effort was paused ~18 months ago) with an end of the year ETA.

"And because they're built on open standards, Mozilla hopes that Firefox OS apps will work reasonably well on other platforms that support HTML 5—which is to say, all of them"

If this is the case then what is the driving factor to embrace this new OS when one could simply say "Yeah, that's a really neat web app - but it will work on Android or iPhone too plus they have native apps as well"

"We are talking to Twitter," Eich told us. "They're going to do something more tuned for the experience" of Firefox OS. He said that Firefox OS provides the features Twitter would need to bring the more refined iOS experience to the platform.

I sure hope that Twitter's "tuning" simply means better standards support, in the context of HTML5. JavaScript, and CSS. Anything else is simply wrong, IMO, and Mozilla shouldn't even be suggesting it to any service provider. It's great that they're pushing the envelope and driving improvements not only in their own products but on the web in general, but there's also some risk in the use of all-new and as yet unapproved methods or APIs. How many times have we seen a standard start to develop, get submitted and start to be implemented by developers, only to to later be quashed or overhauled by a bigger, louder, richer player? "Best" doesn't always win, either. A Google, Apple, or Microsoft may come along and say, "yeah, cool, but we're gonna do it this way instead." And they "win" by default, stranding everyone else. Mozilla could very easily strand itself and its early adopters and developers, by going too far afield. /PessimistPrime

But I do like what they are trying to do, if only for improving or expanding standards. That's the most important word here, and we must keep it in sight.

With app lock-in, users aren't going to be jumping platforms. I've spent maybe $5 on Android apps in 2 years, because I know I'll want to try different platforms and don't want to lose that investment. For others, they'll invest in the platform and won't switch due to the investment. That's the barrier that someone needs to overcome (Win8 tablets).

After reading this I corrected my "no way!" opinion about this to "probably not"...

I mean, yes: You can do a lot of stuff with HTML 5 if you add some APIs. I also like the idea of "hosted" apps. But you will get a mess of chaotic apps, you never will get things that require native code (games!) and anyway, it's almost definitely too late.

I just don't see HTML5 working out for apps in the near to midterm. If everyone remembers Facebook's foray into an HTML5-based app on iOS (and Android, I believe), it ended being a slow and nasty piece of work. They ended doing a totally native re-write to get it back into decent shape.

I'm not sure anything Mozilla can do will be able to prevent that sort of thing with other complex apps.

This looks totally awesome. I would absolutely buy a basic handset if it were cheap and had good battery life.

Most of the stuff I want to do is either a core app or online, and anything more esoteric I want to do I can code myself.

Even a crap keyboard layout isn't a deal breaker, if you can just jump in and tweak it. I would hope Mozilla get all the core bits polished, but if they don't it won't be long till some Indian or Chinese whizz-kid creates something brilliant.

Presumably, even third party web apps will have to be open source as any web site is (even if it's minified), so patching things is going to be possible.

I wouldn't discard Mozilla's initiative as easily as some people here seems to be doing.

I think the premises of Mozilla's efforts are actually sound. If you think a bit about it, many smartphone apps that are not games are actually nice interfaces more or less adapted the OS native UI while actually relying on some website (which usually gives its name to the app) to get its content. So basically, all they are is a wrapper around the website to make it look more appealing and usable.But I already see a few websites (including Ars by the way) whose mobile website is already polished enough to be perfectly usable without any kind of native app.

And frankly, considering what I'm currently doing on my smartphone, I simply don't see many use case where using a native app would be a requirement, most of the time, the same functionality could be achieved with HTML5. I more or less prefer the native app because I prefer the Metro look and feel, but I don't mind using a website provided it's well designed.

The only thing Mozilla really needs to succeed is having web designers creating usable mobile versions of their websites. I don't think it's that much of a long shot, especially considering that platform proliferation may very well end up in developing for the common denominator that is HTML5.

Still, Firefox OS could have a big impact on the Web even if it never gains significant market share. By pushing the Web forward, Mozilla is helping to ensure that mobile websites will continue to be relevant even as developers create hundreds of thousands of proprietary apps. Firefox could lose the battle for the smartphone OS market but still win the war for open standards.

thats the point. and why mozilla pusues this... with the lockout from iOS & chrome OS, this is more about staying relevant and vigilant than anything else...

This is a product/technology that's desperately searching for a reason to exist. I can't see that it solves any problems that aren't better solved by other products. The only people who really could care about this are the people at Firefox and fans of the Mozilla project. It's not necessarily terrible, but it's pretty irrelevant to the rest of us.

I have used Amazon's horrid Cloud Reader web app on my iPad and wouldn't want to have all my apps work this way.

The Cloud Reader app randomly decides it wants me to log back in, even if I have only been away an hour or so. Sometimes when it does this it seems to clear whatever cache it has and it has to connect to the internet to re-download the book I was reading. I had that happen once on a flight (I had forgot my Kindle at home) and was stuck without anything to read.

I'm personally very excited to see where this OS goes. I don't think it should be that hard to create decent apps using HTML5. I find it hard to believe that we can get a HTML5 port of something like Quake 2 and the solid dynamic experiences of most of our favorite web-apps but somehow it'll never work in this context. Obviously it'll take some time for devs to figure out what works best, but I don't think that's much different then the early days of iOS and Android. Hasn't the general trend in this sphere been that where native clients go, eventually the web manages to follow? I mean, I don't think it was THAT long ago that people would have scoffed at the idea we could have Excel in a browser. Now we've got Google docs.

I have faith the devs can do it. I'm just hoping they WILL, and if there's any company I trust to really keep faithful to the principles of the open web, it's Mozilla.

Why will it distract? A browser is not an OS, and trying to bridge that gap is a major tangent.

I don't think it's too late at all. Consider that most people in the world still don't even own a smartphone. Then consider that a lot of people are actually willing to switch OSes and have no loyalty from one to another. This is essentially a recipe for diversity that should be nurtured. Phones can only get better by having a larger variety of options.

HTML5 definitely has some shortcomings and isn't quite to the level of native capabilities at the moment, but in the developing world where the phones are targeted this isn't as big of a hurdle. The largest hurdle here is probably games, but I'm sure they'll have an answer for that.

It doesn't have to garner a massive following to be successful. As others have said, simply pushing the limits of the web is a worthwhile cause. And concern over potential pitfalls is not enough reason to not try.

I just don't see HTML5 working out for apps in the near to midterm. If everyone remembers Facebook's foray into an HTML5-based app on iOS (and Android, I believe), it ended being a slow and nasty piece of work. They ended doing a totally native re-write to get it back into decent shape.

I'm not sure anything Mozilla can do will be able to prevent that sort of thing with other complex apps.

well today's world is totally different. SoC's are vastly more powerful, with asm.js mozilla will match java/c# performace (possibly when firefox os ships).

Plus apple really restricts what you can do with a HTML5 app on iOS... you don't even get a javascript JIT. no wonder HTML5 app performance on iOS is abysmal.

This is a product/technology that's desperately searching for a reason to exist. I can't see that it solves any problems that aren't better solved by other products. The only people who really could care about this are the people at Firefox and fans of the Mozilla project. It's not necessarily terrible, but it's pretty irrelevant to the rest of us.

I think that's too narrow. This is interesting to people who don't want the mobile world controlled by an advertising company and the keeper of the walled garden. To anyone who wants both openness and privacy.

I have mixed feelings about it because I think there are too many people reinventing the wheel when they could be combining efforts, but the ultimate goals are laudable.

After reading this I corrected my "no way!" opinion about this to "probably not"...

I mean, yes: You can do a lot of stuff with HTML 5 if you add some APIs. I also like the idea of "hosted" apps. But you will get a mess of chaotic apps, you never will get things that require native code (games!) and anyway, it's almost definitely too late.

Games shouldn't be a problem with WebGL and 2D games have already been proven to be possible (here's one you can try on you PC and mobile phone as long as you use Chrome or Firefox or any HTML5 compliant WebGL enabled browser).

I think we should wait and see what happens before saying it's impossible

This is imho: I hate this. I hate web apps. They just look and feel like junk. I'm also biased against JavaScript as a 'real' language. What I would like to see more of is standardization for data services to feed native apps.

I have used Amazon's horrid Cloud Reader web app on my iPad and wouldn't want to have all my apps work this way.

The Cloud Reader app randomly decides it wants me to log back in, even if I have only been away an hour or so. Sometimes when it does this it seems to clear whatever cache it has and it has to connect to the internet to re-download the book I was reading. I had that happen once on a flight (I had forgot my Kindle at home) and was stuck without anything to read.

Oh so many preconceptions.... ****stop comparing this with iOS web apps...**** they are horrible because apple wants it so (limiting api & performance). to users the difference of firefox 'webapps' to android/ios native apps will be zero... they will just be programmed using the 'html5/javascript framework'

I read or skimmed the whole article and comments, and there's no comparison or comment on Chrome OS? It seems that Google's efforts with Chrome will only help with the push to HTML 5 apps. Still, I'm not saying that will be enough...

I HIGHLY doubt this will get very far. Ubuntu Mobile, BB10, and perhaps even Windows Phone were all late to the market, which I believe has transitioned to a consolidation phase. The technical advantages of each are outweighed by rich ecosystems of Android and iOS. The killer apps are the 3rd party apps.

I DO see some good ideas here though. Making things more modular, in order to speed updates, is a good concept. It's something that Google has been doing to a limited extent. Hopefully, we can get to a point where the Linux kernel and drivers can be completely left alone while only upgrading the rest of Android OS

It's not just pushing good ideas at the rest of the mobile industry; the FF browser as a whole is also being improved by this project. Getting enough performance out of Gecko to use it as the OS layer has required moving large parts of the graphics stack out of the main thread. As those changes are merged into the desktop build general FF performance and responsiveness should improve. The progress being made a month ago was enough that they're talking about process/tab again (initial effort was paused ~18 months ago) with an end of the year ETA.

I for one can't wait until OMTC lands in the actual desktop Firefox builds. Hopefully it'll be before 2013 is out, because it's really the only complaint I have against Firefox at the moment.

After reading this I corrected my "no way!" opinion about this to "probably not"...

I mean, yes: You can do a lot of stuff with HTML 5 if you add some APIs. I also like the idea of "hosted" apps. But you will get a mess of chaotic apps, you never will get things that require native code (games!) and anyway, it's almost definitely too late.

Games shouldn't be a problem with WebGL and 2D games have already been proven to be possible (here's one you can try on you PC and mobile phone as long as you use Chrome or Firefox or any HTML5 compliant WebGL enabled browser).

I think we should wait and see what happens before saying it's impossible

I see a lot of comments from people skeptical that HTML+Javascript provides a good enough platform. Javascript is just a language and for these web apps, HTML provides mostly the chrome and canvas for the javascript to run.

It's the runtime that comes with the phone that is the limitation. As long as Mozilla has a runtime that provides apis to access the phone hardware, you can do all the stuff that you can on "native" phones.

Additionally, when it comes to games, people are skeptical they can be ported. How are you going to get all those C++ engines onto the phone? Well, what if you could compile C++ into Javascript?

"Yes, but what about the speed?" Well, what if you could speed up Javascript a lot? Check out Mozilla's presentation this year at GDC...

I hope the permissions on the device will not be that strict if you want to make an app just for yourself, only if you want to distribute it. I will hate to not have the possibility to make a phone blacklist app, at least for my personal use

Firefox doing this has one real benefit. It pushes a non-Webkit mobile browser forward even more, with mobile-specific options. the fact that it's out there hopefully will force webdevs to avoid the error of IE6 and stop making mobile web pages just for Webkit.

Ubuntu's touted integration seems too good to be true, but a true HTML5 based platform--and Firefox backing--sounds more like something the community and consumer base would adopt.

I'm personally looking forward to both of them entering the market. My only concern is that 2 more open platforms give manufacturers and carriers more opportunity to fragment (and by fragment I mean reskin; as the article reconfirms, there are only 3 truly "big" names in phone markets at this time. Android, Apple and Windows. Blackberry is...its a sinking ship and Palm is already at the bottom of the lake, lets be honest here).

Wasn't WebOS (Hint, WEB OS) all HTML5 too? It is amazing to me how many good ideas that OS had before failing. E.g., most of the recent concept videos about how Apple should redo multitasking in iOS essentially points to a remake of the WebOS Cards metaphor, complete with swiping cards off the screen to close.

Actually being based on HTML5 is one of the reasons it failed like FirefoxOS will fail. And ChromeOS as well. It is just an uneccessary restriction and makes the OS slower than it needs to be. They will never be able to replicate the UI smoothness of a more hardware near OS like iOS or Android.

Also the argument for HTML+Javascript is often that people know it already. But that doesn't make it a good programming language. Its a crutch used to make web browsers do things they normally shouldn't do. The programming environment simply is not good. Sure web developers may be familiar with it but people who are unable to learn a real programming language like ObjectiveC or Java are not necessarily the people you want to have developing applications for your OS. 100 good apps are more important than 100000 bad ones. Esp. since it begs the question, if its largely based on HTML5 why don't you make a website anyway?

I never really got the card metaphor as well. It looks more or less identical in Android and it is definitely a decent concept but I use it so rarely. Apple is on the right track not many normal people want to manage applications. And I can just as easily switch between applications in the normal app launcher as in a special multitasking view that only shows the open apps.

I just don't see HTML5 working out for apps in the near to midterm. If everyone remembers Facebook's foray into an HTML5-based app on iOS (and Android, I believe), it ended being a slow and nasty piece of work. They ended doing a totally native re-write to get it back into decent shape.

I'm not sure anything Mozilla can do will be able to prevent that sort of thing with other complex apps.

That potentially says more about about the limitations of some Facebook developers than it says about the limitations of HTML5. Even the big named pillars of society like Facebook can screw something up.

Timothy B. Lee / Timothy covers tech policy for Ars, with a particular focus on patent and copyright law, privacy, free speech, and open government. His writing has appeared in Slate, Reason, Wired, and the New York Times.