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


The MozActivity interface allows apps to delegate an activity to another app.

This interface fully inherits from the DOMRequest interface except that it has a constructor that it takes a MozActivityOptions as a parameter.

Note: As soon as a MozActivity is instantiated, the system will prompt the user to choose an activity handler. It's not possible to instantiate an activity and wait to use it.


new MozActivity( options )
An object that has the same properties as the ones define in the MozActivityOptions interface.


Inherited from DOMRequest:

A callback handler called when the operation represented by the DOMRequest is completed.
A callback handler that gets called when an error occurs while processing the operation.
A string indicating whether or not the operation is finished running. Its value is either "done" or "pending".
The operation's result.
Error information, if any.




var activity = new MozActivity({
  // The name of the activity the app wants to delegate the action
  name: "pick",

  // Data required by the activity. Each application acting as an activity handler 
  // can have it's own requirement for the activity. If the data does not fulfill
  // all the requirement of any activity handler, the error event will be sent
  // otherwise, the event sent depend on the activity handler itself.
  data: {
    type: "image/jpeg"

activity.onsuccess = function() {
  console.log("Activity successfuly handled");

  var imgSrc = this.result.blob;

activity.onerror = function() {
  console.log("The activity encouter en error: " + this.error);


Web Activities is not part of any specification. However, it has some overlap with the proposed Web Intents specification. Mozilla actually proposed Web Activities as a counter proposal to Web Intents. For more information about this, see discussion on the Web Intents Task Force ML.

See also

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
basic support No support No support No support No support No support
Feature Android Chrome for Android Firefox OS Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
basic support No support No support (Yes) 32.0 (32.0)[1] No support No support No support

[1] WebRT only


© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.

API B2G Firefox OS Non-standard Web Activities WebAPI