An application manifest is a JSON file describing an installable web application. This JSON file consists of a top-level object and several properties.
{ "name": "MozillaBall", "description": "Exciting Open Web development action!", "launch_path": "/", "version": "1.0", "type": "privileged", "icons": { "16": "/img/icon_16.png", "48": "/img/icon_48.png", "128": "/img/icon_128.png" }, "developer": { "name": "Mozilla", "url": "https://mozilla.org/en-US" }, "installs_allowed_from": [ "https://marketplace.mozilla.org" ], "appcache_path": "/cache.manifest", "locales": [ "es": { "description": "¡Acción abierta emocionante del desarrollo del Web!", "developer": { "url": "https://mozilla.org/es-ES" } } ], "default_locale": "en", "screen_size": { "min_width": "600", "min_height": "300" }, "required_features": [ "touch", "geolocation", "webgl" ], "orientation": "landscape", "permissions": { "contacts": { "description": "Required for autocompletion in the share screen", "access": "read" } }, "fullscreen": "true", "activities": { "share": { "filters": { "type": ["image/png", "image/gif"] } "href": "/share.html", "disposition": "window" } } }
All leaf properties MUST contain string values.
/
" are treated as relative
to the origin of the app.min_height
and min_width
properties that describe the minimum height and width (in pixels) the
application needs in order to render correctly. Interpretation of these
values is left up to the runtime and/or app store.["portrait-primary", "portrait-secondary"]
.["landscape-primary", "landscape-secondary"]
.Permission Name | Permission Description | Access Type |
---|---|---|
alarm |
Schedule a notification, or for an application to be started, at a specific time. | - |
backgroundservice |
Enable a web application to run in the background and perform tasks like syncing or respond to incoming messages. | - |
bluetooth |
Low level access to bluetooth hardware. | - |
browser |
Enables implementing a browser. | - |
camera |
Take photos, shoot video and control the camera. | - |
contacts |
Add, read, or modify contacts from the address book on the device and read contacts from the SIM. | readonly, readwrite, readcreate, createonly |
desktop-notification |
Display a notification on the user's desktop. | - |
device-storage |
Add, read, or modify files stored at a central location on the device. | readonly, readwrite, readcreate, createonly |
fmradio |
Control the FM radio. | - |
geolocation |
Obtain the current location of the user. | - |
mobileconnection |
Obtain information about the current mobile voice and data connection. | - |
power |
Turn the screen on or off, control CPU, device power, etc. Listen for and inspect resource lock events. | - |
push |
Receive push events. | - |
settings |
Configure or read device settings. | readonly, readwrite |
sms |
Send and receive SMS. | - |
storage |
Utilize localStorage and indexedDB without size limitations. | - |
systemclock |
Set current time. (Timezone information is controlled by the settings API). | - |
network-http |
Make HTTP requests without any origin restrictions. | - |
network-tcp |
Create and communicate over TCP sockets. | - |
telephony |
All telephony related APIs. | - |
wake-lock-screen |
Turn the display on and show the lock screen. | - |
webapps-manage |
Obtain access to the navigator.apps.mgmt API to
manage installed webapps. |
- |
wifi |
Enumerate available WiFi networks, get signal strength, connect to a network. | - |
navigator.setMessageHandler
for each activity it
supports and subsequently execute the activity for which it
receives a message. Further, if the activity requires a return
value, the page MUST call activity.postResult
or
activity.postError
(where activity
is
the first argument provided to the function specified by
setMessageHandler
) as appropriate. These functions
are specified in greater details in the WebActivities
document.An application manifest MUST be served from the same origin that the application itself is served from. There MUST only be one application per origin.
When served as a static file, it is RECOMMENDED that the manifest be
stored with the extension .webapp
. The manifest MUST be
served with a Content-Type
header of
application/x-web-app-manifest+json
. It is RECOMMENDED that
manifests be served over SSL.
Applications are represented by a JavaScript object that is accessible to web content.
The following interface is made available to allow installation of apps and for apps to query for their current state.
manifestUrl
. The User-Agent must fetch the
manifest from the provided URL, verify that it is valid, and then ask
for permission from the user to allow installation to proceed. The
User-Agent must also persist the parameters provided (if any) which may
later be retrived from the AppObject
representing this
application. The user may choose to whitelist certain origins to allow
them to install applications without any permission prompts.A privileged caller is a web page that has been explicitely authorized by the user to manage applications on their behalf. Such privileged origins also have access to the AppRegistryManagement interface as described below.
AppObject
of the application that was installed.AppObject
of the application that was uninstalled.Most of the methods described above return an EventTarget
object to which success and error handlers may be attached using standard
DOM methods like addEventListener
or attributes like
onsuccess
and onerror
.
event
can be either be "install" or "uninstall".event
can either be "install" or "uninstall".result
depends on the operation
for which this EventTarget
was returned. If an
onerror
is fired, this value will be set to
AppEventError
. When getSelf()
and
getInstalled()
succeed, ths value will be set to an array
of AppObject
s.