This is an archived page. It's not actively maintained.


This API is available on Firefox or Firefox OS for installed or higher privileged applications.


The MozActivityRequestHandler interface allows apps that handle activities to access and interact with the request made by a third party app that tries to delegate an activity.

To handle activities, an application has to register a handler to the system message activity using navigator.mozSetMessageHandler(). The callback that is passed to navigator.mozSetMessageHandler() will be called with a MozActivityHandler object in parameter when the system message is of the type activity.

Be aware that you need to have returnValue: true set in your manifest file to return a result (see manifest activities for more information.) If there is no result to return, then you should just use window.close() to get rid of the handling window.

Interface overview

interface MozActivityRequestHandler
  readonly attribute MozActivityOptions source;

  void postResult(object result);
  void postError(DOMString error);


MozActivityRequestHandler.source Read only
A MozActivityOptions object containing all the information about the current activity request.


Allows to send back a success response to the app that initiated the activity.
Allows to send back an error response to the app that initiated the activity.


See also