WebAPI/WebActivities: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(add proprietary dependencies)
Line 2: Line 2:


Web Activities is a counter-proposal to Web Intents. It is trying to limit the scope of the API to the following use case: ''APP A wants to delegate an activity to APP B''. Web Activities isn't a discovery API or a communication API. Those things happen in the background and are completely transparent to the caller.
Web Activities is a counter-proposal to Web Intents. It is trying to limit the scope of the API to the following use case: ''APP A wants to delegate an activity to APP B''. Web Activities isn't a discovery API or a communication API. Those things happen in the background and are completely transparent to the caller.
== Dependencies ==
This API depends on two APIs that are not currently part of any specification: [https://groups.google.com/group/mozilla.dev.webapi/browse_thread/thread/a3c6e4c31d04b663/ System Message Handler] and [https://developer.mozilla.org/en/DOM/DOMRequest DOMRequest].


== Proposed API ==
== Proposed API ==

Revision as of 17:24, 30 May 2012

Introduction

Web Activities is a counter-proposal to Web Intents. It is trying to limit the scope of the API to the following use case: APP A wants to delegate an activity to APP B. Web Activities isn't a discovery API or a communication API. Those things happen in the background and are completely transparent to the caller.

Dependencies

This API depends on two APIs that are not currently part of any specification: System Message Handler and DOMRequest.

Proposed API

 interface ActivityOptions {
   attribute DOMString name;
   attribute Object?   data; // a dictionary
 };
 
 [Constructor(DOMString name)]
 interface ActivityHandlerDescription {
   attribute DOMString name; // default has to be passed to ctor
   attribute DOMString href; // default is current location
   attribute DOMString disposition; // going to be an enum with a default
   attribute boolean   returnValue;
   attribute Object?   filters; // a dictionary
 };
 
 interface ActivityRequestHandler {
   void postResult(any result);
   void postError(DOMString error);
   readonly attribute ActivityOptions source;
 };
 
 [Constructor(ActivityOptions options)]
 interface Activity : DOMRequest {
 };
 
 partial interface Navigator {
   DOMRequest registerActivityHandler(ActivityDescription d);
   void       unregisterActivityHandler(ActivityDescription d);
   bool       isActivityHandlerRegistered(ActivityHandler handler);
 };