• Skip to main content
  • Select language
  • Skip to search
mozilla
Mozilla Developer Network
  • Sign in
    • Persona
    • GitHub
  • Web Platform
    Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • APIs / DOM
    • Apps
    • MathML
    References & Guides
    • Learn the Web
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • ...more docs
  • Mozilla Docs
    • Add-ons
    • Firefox
    • Firefox Marketplace
    • Firefox OS
    • Persona
  • Developer Tools
  • Feedback
    • Get Firefox help
    • Get web development help
    • Join the MDN community
    • Report a content problem
    • Report a bug
  •  
B2G OS
    • No translations exist for this article.
    • Add a translation
  • Edit
  • Advanced
    • History
    • Print this article
  1. MDN
  2. Mozilla
  3. B2G OS
  4. Firefox OS APIs
  5. MozActivityRequestHandler
Your Search Results

    MozActivityRequestHandler

    In This Article
    1. Summary
    2. Interface overview
    3. Properties
    4. Methods
    5. Specification
    6. See also

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

    Summary

    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);
    };

    Properties

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

    Methods

    MozActivityRequestHandler.postResult()
    Allows to send back a success response to the app that initiated the activity.
    MozActivityRequestHandler.postError()
    Allows to send back an error response to the app that initiated the activity.

    Specification

    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

    • navigator.mozSetMessageHandler()
    • MozActivity
    • MozActivityOptions
    • Web Activities
    Share:
    • Twitter
    • Facebook
    • Google+

    Document Tags and Contributors

    Tags: 
    • API
    • B2G
    • Firefox OS
    • Non-standard
    • Reference
    • Référence
    • Web Activities
     Contributors to this page: chrisdavidmills, fscholz, jsx, kscarfone, teoli, Sheppy, Jeremie, mounirlamouri
     Last updated by: chrisdavidmills, Mar 7, 2016, 2:34:15 AM
    See also
    1. Web Activities
    2. MozActivityRequestHandler
    3. Properties
      1. source
    4. Methods
      1. postError()
      2. postResult()
    5. Related pages for Web Activities
      1. MozActivity
      2. MozActivityOptions
      3. Navigator.mozSetMessageHandler()

    © 2005-2016 Mozilla Developer Network and individual contributors.

    Content is available under these licenses.

    • About MDN
    • Terms
    • Privacy
    • Cookies
    • Contribute to the code