mozilla

Revision 400357 of MozActivityRequestHandler

  • Revision slug: Web/API/MozActivityRequestHandler
  • Revision title: MozActivityRequestHandler
  • Revision id: 400357
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment DOM/MozActivityRequestHandler Web/API/MozActivityRequestHandler

Revision Content

{{ domref() }}

{{ non-standard_header() }}

{{ B2GOnlyHeader2('installed') }}

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 {{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}}. The callback that is passed to {{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}} will be called with a MozActivityHandler object in parameter when the system message is of the type activity.

Interface overview

interface MozActivityRequestHandler
{
  readonly attribute MozActivityOptions source;

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

Properties

{{domxref("MozActivityRequestHandler.source")}} {{readonlyinline}}
A {{domxref("MozActivityOptions")}} object containing all the information about the current activity request.

Methods

{{ domxref("MozActivityRequestHandler.postResult()") }}
Allows to sent back a success response to the app that initiate the activity.
{{ domxref("MozActivityRequestHandler.postError()") }}
Allows to sent back an error response to the app that initiate the activity.

Specification

{{page("/en-US/docs/WebAPI/Web_Activities","Specification")}}

See also

  • {{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}}
  • {{domxref("MozActivity")}}
  • {{domxref("MozActivityOptions")}}
  • Web Activities

Revision Source

<p>{{ domref() }}</p>
<p>{{ non-standard_header() }}</p>
<p>{{ B2GOnlyHeader2('installed') }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>MozActivityRequestHandler</code> 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.</p>
<p>To handle activities, an application has to register a handler to the system message <code>activity </code>using {{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}}. The callback that is passed to {{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}} will be called with a <code>MozActivityHandler</code> object in parameter when the system message is of the type <code>activity</code>.</p>
<h2 id="Interface_overview">Interface overview</h2>
<pre>
interface MozActivityRequestHandler
{
  readonly attribute MozActivityOptions source;

  void postResult(object result);
  void postError(DOMString error);
};</pre>
<h2 id="Properties">Properties</h2>
<dl>
  <dt>
    {{domxref("MozActivityRequestHandler.source")}} {{readonlyinline}}</dt>
  <dd>
    A {{domxref("MozActivityOptions")}} object containing all the information about the current activity request.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<dl>
  <dt>
    {{ domxref("MozActivityRequestHandler.postResult()") }}</dt>
  <dd>
    Allows to sent back a success response to the app that initiate the activity.</dd>
  <dt>
    {{ domxref("MozActivityRequestHandler.postError()") }}</dt>
  <dd>
    Allows to sent back an error response to the app that initiate the activity.</dd>
</dl>
<h2 id="Specification">Specification</h2>
<p>{{page("/en-US/docs/WebAPI/Web_Activities","Specification")}}</p>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}}</li>
  <li>{{domxref("MozActivity")}}</li>
  <li>{{domxref("MozActivityOptions")}}</li>
  <li><a href="/en-US/docs/WebAPI/Web_Activities" title="/en-US/docs/WebAPI/Web_Activities">Web Activities</a></li>
</ul>
Revert to this revision