A hosted Open Web App delivers all its content from a Web server, in the same way as a conventional Web site, along with an app manifest in the app's root directory. The app manifest provides details about the app such as its description, icons used to identify the installed app and so on. The details in the app manifest are then used to install the app to Firefox OS devices, Android devices and desktops. Once installed the app loads its content dynamically from the hosting Web Server, and is able to access other resources on the Web, such as a database on a Web server.
Within the Firefox OS security model, hosted apps are defined as web apps. This means they are unable to make use of privileged and internal (certified) APIs : to be able to make use of these APIs the app must be delivered as a Packaged App.
Note: Firefox Marketplace supports paid hosted apps for Firefox OS only and free hosted apps for Firefox OS, Firefox for Android and Firefox for Desktop. Support for paid apps on all platforms is under development.
Where you host the app is up to you. If you haven't chosen a hosting solution, this section describes a couple of commonly used options worth considering.
For dynamic Open Web Apps, those requiring server-side processing, you can use any generic hosting option (such as a Web server you may already own or have access to). You'll need to ensure the Web server offers the right capabilities. A number of hosting provider offer Web servers that are already tailored to the needs of hosted apps, such as Heroku. Google App Engine or Amazon App Hosting.
Note: Installable open web apps used to have a "single app per origin" security policy, but this was lifted as of Firefox 34/Firefox OS 2.1 (read this FAQ entry for more information). If you still need to support older versions, consider hosting different apps (e.g. a test and live version) at separate origins; one strategy is to create different subdomains for your apps, or you could test it using WebIDE. See the FAQs about apps manifests for more information on origins.
To install a hosted app into a Firefox OS Simulator or onto a device for testing purposes, see Using the App Manager. Alternatively, you can install it on to a device from a Web server by following the steps described in Publishing apps yourself.
You have two options for publishing hosted apps: on Firefox Marketplace or self-publishing.
The process for submitting a hosted app to Firefox Marketplace is described in the App Publishing section.
When you submit your hosted app, the Marketplace generates a new manifest called the mini-manifest that is based on the app manifest on your hosted app's Web server. When a user installs your app, the mini-manifest is passed to the
Apps.install() function to install the app. The mini-manifest exists for installation and update purposes and isn't used when your app runs.
It's possible to publish hosted apps outside Firefox Marketplace, on your own web server. Details are provided in Publishing apps yourself.
Updating of hosted apps happens in two ways:
- changes made on the app's Web server are presented to users the next time they run the app.
- changes to device content controlled by the mini-manifest, such as the app's icon or name, are updated when a new version of the app is submitted to Firefox Marketplace.