• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. The B2G OS platform
  5. Firefox OS apps architecture

Firefox OS apps architecture

In This Article
  1. The app startup process
  2. Communication with Gecko
  3. See also

This article explains the internals of how applications are launched and managed in Firefox OS. This information will be useful for Firefox OS platform developers, as well as teams porting the operating system to new hardware. You don't really need this if you are an app developer, but it might still be interesting.

The app startup process

When the user selects an app they'd like to launch, or an app otherwise needs to be launched, the home screen app starts by getting an app reference from the App API, then calling the App.launch() method to launch the app.

Gecko receives that request and sends the mozChromeEvent to the System app with the app's details. The System app handles that event by inserting a new <iframe> into its DOM tree and loading the app within the new <iframe>. That frame will be the app's home until it terminates.

Every app requires a manifest that describes the app, and has a particular file hierarchy within its package. For details, see the article App manifest.

Communication with Gecko

The communication between Gecko and Gaia's System app is done via mozChromeEvent and mozContentEvent. mozChromeEvents are broadcast from chrome to content and mozContentEvents are broadcast from content to chrome. This communication is used to control the creation and closure of the trusted UI and to inject the required functions for notifications and other tasks, including telling the System app to start an app.

Note: You find more out about how these events work by reading our System app documentation. You can also glean a lot about how this is used by looking at the code in b2g/chrome/content/shell.js.

See also

  • Apps
  • App
  • System app
  • Firefox OS architecture

Document Tags and Contributors

Tags: 
  • Apps
  • Firefox OS
  • Guide
 Contributors to this page: chrisdavidmills, teoli, kscarfone, aurigadl, kohei.yoshino, Sheppy
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:56:07 AM
See also
  1. Build and install
    1. Build and install overview
    2. B2G OS build process summary
    3. Build prerequisites
    4. Preparing for your first build
    5. Building B2G OS
    6. B2G installer add-on
    7. Building B2G OS for Flame on Mac OS X
    8. Choosing how to run Gaia or B2G OS
    9. Compatible Devices
    10. Installing B2G OS on a mobile device
    11. Creating and applying B2G OS update packages
    12. Building and installing FOTA community builds
    13. B2G build variables reference sheet
  2. Porting B2G OS
    1. Porting overview
    2. Porting basics
    3. Porting on CyanogenMod
  3. Developing Gaia
    1. Developing Gaia overview
    2. Running the Gaia codebase
    3. Run Gaia on desktop using Mulet
    4. Understanding the Gaia codebase
    5. Making Gaia code changes
    6. Testing Gaia code changes
    7. Submitting a Gaia patch
    8. Gaia build system primer
    9. Different ways to run Gaia
    10. Make options reference
    11. Gaia tools reference
  4. B2G OS APIs