mozilla

Revision 350059 of Firefox OS apps architecture

  • Revision slug: Mozilla/Firefox_OS/Platform/Apps_architecture
  • Revision title: Firefox OS apps architecture
  • Revision id: 350059
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment

Revision Content

Although you don't need to understand the internals of how applications are launched and managed on Firefox OS in order to build and distribute apps, you may be interested. Also, this information can be useful for Firefox OS platform developers, as well as teams porting the operating system to new hardware.

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 {{domxref("App")}} API, then calling the {{domxref("App.launch()")}} method to launch the app.

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

Communication with Gecko

The communication between Gecko and Gaia's System app is done via {{event("mozChromeEvent")}} and {{event("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.

See also

  • Apps
  • {{domxref("App")}}

Revision Source

<p>Although you don't need to understand the internals of how applications are launched and managed on Firefox OS in order to build and distribute apps, you may be interested. Also, this information can be useful for Firefox OS platform developers, as well as teams porting the operating system to new hardware.</p>
<h2 id="The_app_startup_process">The app startup process</h2>
<p>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 {{domxref("App")}} API, then calling the {{domxref("App.launch()")}} method to launch the app.</p>
<p>Gecko receives that request and sends the {{event("mozChromeEvent")}} to the System app with the app's details. The System app handles that event by inserting a new {{HTMLElement("iframe")}} into its DOM tree and loading the app within the new {{HTMLElement("iframe")}}. That frame will be the app's home until it terminates.</p>
<h2>Communication with Gecko</h2>
<p>The communication between Gecko and Gaia's System app is done via {{event("mozChromeEvent")}} and {{event("mozContentEvent")}}. <code>mozChromeEvent</code>s are broadcast from chrome to content and <code>mozContentEvent</code>s 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.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/Apps" title="/en-US/docs/Apps">Apps</a></li>
  <li>{{domxref("App")}}</li>
</ul>
Revert to this revision