Marketplace feature removal
The functionality described on this page no longer works — Firefox Marketplace has discontinued support for Android, Desktop, Tablets, and payments (and other related functionality). For more information, read the
Future of Marketplace FAQ
.
The Open Web Apps JavaScript API is a programmatic interface for installing Web apps and for managing a client-side collection of Web apps that a user has installed. This collection is called the application repository .
The JavaScript API described here is available in Firefox OS.
All methods related to apps are accessed from the
navigator.mozApps
object. There are two types of functions available in the API:
navigator.mozApps.*
)
The apps installation API is exposed as methods on the
window.navigator.mozApps
对象。
navigator.mozApps.install()
navigator.mozApps.installPackage()
navigator.mozApps.getSelf()
navigator.mozApps.getInstalled()
navigator.mozApps.checkInstalled()
navigator.mozApps.mgmt.*
)
The apps management API is privileged. It is intended to grant access to trusted pages, also called "dashboards". The management API exposes functions that let dashboards manage and launch apps on a user's behalf. Additionally, the API exposes functions for app sync, which lets the dashboard display the logged-in state of the user and allows the user to sign up or register for an account to synchronize apps across devices.
These types of JavaScript objects are used by the apps API:
If you were using the older API, it is obsolete as of . The old API is compared with the new API below.
navigator.mozApps.install()
This function has a changed signature.
navigator.mozApps.amInstalled()
navigator.mozApps.getSelf()
.
navigator.mozApps.getInstalledBy()
navigator.mozApps.getInstalled()
.
navigator.mozApps.mgmt.list()
navigator.mozApps.mgmt.getAll()
.
navigator.mozApps.mgmt.watchUpdates(onupdate)
navigator.mozApps.mgmt.clearWatch(watchId)
navigator.mozApps.oninstall
and
navigator.mozApps.onuninstall
.
navigator.mozApps.mgmt.uninstall(origin, [onsuccess], [onerror])
navigator.mozApps.mgmt.uninstall(app)
where
app
is an object returned by
getAll()
or any other function handing
app
对象。