Rockin’ the Free Web – How to Convert a chrome packaged app to a Firefox OS packaged App

David Clarke

I saw a question on a thread this week, and decided to spend a few hours to write up the process, as well as provide an example.

This bug will cover the general conversion process, but it doesn’t cover all the idiosyncrasies / differences between the two platforms.

The example I’m going to use for the conversion is from the google chrome sample app repository:

The most basic example I have already converted to a packaged app the Hello World example.

For the most basic app that I have converted “Hello World”, we look at the following pieces and how they differ / can also possibly coexist between the two platforms.

manifest.json:

 {  "manifest_version": 2,
    "name": "Hello World",
    "version": "2",
    "minimum_chrome_version": "23",
    "icons": {
         "16": "icon_16.png",
         "128": "icon_128.png"
     },
     "app": {
         "background": {
         "scripts": ["main.js"]
         }
      }
   }

manifest.webapp:

 {  "name": "Hello World",
    "description": "Hello World",
    "launch_path": "/index.html",
    "icons": {
        "128": "icon_128.png",
        "16": "icon_16.png"
    },
    "developer": {
        "name": "David Clarke",
        "url": "https://github.com/onecyrenus/firefox-os-apps"
    },
    "default_locale": "en",
    "permissions": {
    }
 }

The main difference between these two loading mechanisms is just file structure, and some syntactic sugar.  So why not deploy a manifest.json and start rocking the free web !!!