Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Firefox OS Boilerplate App ported to Dart.

Running the app

To run the app you can simply open Firefox OS's browser and go to: -- on top-right corner there will be a "+" button to install it.

If you want to install the app from your computer, get the code (git clone and learn how use Firefox's App Manager.

Compiling the app

This code repository already has the compiled-to-Javscript version of the Boilerplate, these steps are needed only if you make some changes to the Dart code.

  1. Get and install Dart => Get Dart
  2. If you use Dart Editor, open the app's directory, right-click on file pubspec.yaml then choose "Pub Build ("generates JS")"; if you have /path/to/dart-sdk/bin in your $PATH, then change to app's directory and run pub build from the command line.

About this porting

The Boilerplate App focuses on MozActivities and other platform-specific Web APIs, which are not available in Dart. In order to get them working this app uses a library for interoperating with Javascript, for example this Javascript code

var pick = new MozActivity({
    name: "pick",
    data: {
        type: ["image/png", "image/jpg", "image/jpeg"],
        nocrop: true

in Dart becomes:

var pick = new JsObject(context["MozActivity"], [
    new JsObject.jsify({
        "name": "pick",
        "data": {
            "type": ["image/png", "image/jpg", "image/jpeg"],
            "nocrop": true

where context is the JS's window object. To get more information about JS<->Dart interoperability check this article: ([].

For Packaged Apps

Excerpt from the original Boilerplate App

You can test packaged apps in version 2 and higher of the App Manager, by using the Add Directory button. If you want to access privileged APIs - such as deviceStorage, cross-domain XMLHttpRequest etc - you need to set type and permissions in the manifest file. E.g.

    "version": "1",
    "name": "Firefox OS Boilerplate App",
    "type" : "privileged"


"permissions": {
    "device-storage:pictures": {
        "access": "readcreate"
    "contacts": {
        "description" : "Reading out contacts",
        "access": "readcreate"

All options to test packaged apps are outlined in the How to install packaged apps in Firefox OS – options and tools article