WebAPI/Inter App Communication Alt proposal: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 25: Line 25:
* ''rules'' (optional) is an object containing a set of constraints for the requested connection. Only apps fulfilling these constraints will receive a connection request. These rules may contain:
* ''rules'' (optional) is an object containing a set of constraints for the requested connection. Only apps fulfilling these constraints will receive a connection request. These rules may contain:
** ''minimumAccessLevel'' is the minimum level of access (one of https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#type) that the receiver app requires in order to be able to receive the connection request. The default value will be 'web'.
** ''minimumAccessLevel'' is the minimum level of access (one of https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#type) that the receiver app requires in order to be able to receive the connection request. The default value will be 'web'.
** ''manifestURL'' (array) can be used to set specific receivers by a list of manifestURLs.
** ''manifestURLs'' (array) can be used to set specific receivers by a list of manifestURLs.
** ''developer'' (array) list of objects identifying app authors whose apps are allowed to receive a connection request.
** ''developers'' (array) list of objects identifying app authors whose apps are allowed to receive a connection request.
** ''installOrigin'' (array) list of install origins from where receiver apps should have been installed. Since certified apps has not a ''valid'' install origin, these constraint does not apply to them.
** ''installOrigins'' (array) list of install origins from where receiver apps should have been installed. Since certified apps has not a ''valid'' install origin, these constraint does not apply to them.


== Receiver ==
== Receiver ==
Line 41: Line 41:
         'rules': {
         'rules': {
           'minimumAccessLevel': 'web',
           'minimumAccessLevel': 'web',
           'manifestURL': ['manifestURL_1', 'manifestURL_n'],
           'manifestURLs': ['manifestURL_1', 'manifestURL_n'],
           'installOrigin': ['install_origin_1', 'install_origin_n'],
           'installOrigins': ['install_origin_1', 'install_origin_n'],
           'developer': [{
           'developers': [{
             'name': 'developer_name',
             'name': 'developer_name',
             'url': 'developer_url'
             'url': 'developer_url'
Line 62: Line 62:
* ''rules'' is an object containing a set of constraints to be fulfilled by connection requesters. These rules may contain:
* ''rules'' is an object containing a set of constraints to be fulfilled by connection requesters. These rules may contain:
** ''minimumAccessLevel'' is the minimum level of access (one of https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#type) that the requester app requires in order to be able to send a connection request. The default value will be 'web'.
** ''minimumAccessLevel'' is the minimum level of access (one of https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#type) that the requester app requires in order to be able to send a connection request. The default value will be 'web'.
** ''manifestURL'' (array) can be used to set specific requesters by a list of manifestURLs.
** ''manifestURLs'' (array) can be used to set specific requesters by a list of manifestURLs.
** ''developer'' (array) list of objects identifying app authors whose apps are allowed to send connection requests.
** ''developers'' (array) list of objects identifying app authors whose apps are allowed to send connection requests.
** ''installOrigin'' (array) list of install origins from where the requester apps should have been installed. Since certified apps has not a ''valid'' install origin, these constraint does not apply to them.
** ''installOrigins'' (array) list of install origins from where the requester apps should have been installed. Since certified apps has not a ''valid'' install origin, these constraint does not apply to them.


=== Connection acknowledgement ===
=== Connection acknowledgement ===
Line 125: Line 125:
         'description': 'Show the currently played music track information in the lockscreen',
         'description': 'Show the currently played music track information in the lockscreen',
         'rules': {
         'rules': {
           'installOrigin': ['marketplace.firefox.com']
           'installOrigins': ['marketplace.firefox.com']
         }
         }
       }
       }
Line 141: Line 141:
         'description': 'Play, pause and stop music tracks',
         'description': 'Play, pause and stop music tracks',
         'rules': {
         'rules': {
           'manifestURL': ['app://system.gaiamobile.org/manifest.webapp']
           'manifestURLs': ['app://system.gaiamobile.org/manifest.webapp']
         }
         }
       }
       }
Line 250: Line 250:
   ...
   ...
  }, {
  }, {
   manifestURL: ['app://music.gaiamobile.org/manifest.webapp']
   manifestURLs: ['app://music.gaiamobile.org/manifest.webapp']
  }).bind(this));
  }).bind(this));


Confirmed users
483

edits