Apps.mgmt.addEventListener

Unimplemented

Summary

Enable privileged pages to listen for events that indicate an app has been installed or uninstalled, and perform an action in response.

Syntax

navigator.mozApps.mgmt.addEventListener(type, callback)

Parameters

type
The type of event to listen for. Values are install for the installation of an app, and uninstall for when an app is uninstalled.
callback
Your callback function that will be called when the chosen event occurs.

Returns

(does this function return anything?)

Example

navigator.mozApps.mgmt.addEventListener("install", function (event) {
  alert('A new application has been installed: ' + event.application.origin);
});

In each case the event object has a single attribute: event.application, which is the application record.

In addition to addEventListener you can also use:

navigator.mozApps.mgmt.oninstall = function (event) {
  alert('Also a new app is installed: ' + event.application.origin);
};

You can set both oninstall and onuninstall properties.

Document Tags and Contributors

Last updated by: kscarfone,