Leaving the Cordova plugin problem aside for now.

Let's say the app developer has now one page to handle the different "open".

Even then this seems impossible, right?



How about:



    "open": {

      "href": "/index.html",

      "disposition": "inline",

      "filters": [

         {

            "type": ["image/*","image/jpeg","image/png"]

          },

         {

            "type": "url",

           '"url": { "regexp": "https://foo.org/gallery"; }

          }

      ],

      "returnValue": true

    }

  }



Implementing this would probably be "easy"...



This text would be changed to: 
https://developer.mozilla.org/en-US/docs/Web/API/Web_Activities



The way filters are handled depend on each filter value:



    If the filter value is a basic value, the corresponding 
MozActivityOptions.data property is optional but if the property exist it must 
have the same value as the one provided by the filter.

    If the filter value is an array of basic values, the corresponding 
MozActivityOptions.data property is optional but if the property exists its 
value must be equal to one of the values available in the array provided by the 
filter.

    If the filter value is a filter definition object, the filter will be 
satisfied if the corresponding MozActivityOptions.data property follows the 
rules defined by the object. A filter definition object can have the following 
properties:

        required: A boolean that indicates if the corresponding 
MozActivityOptions.data property must exist (true) or not (false).

        value: A basic value or an array of basic value. The corresponding 
MozActivityOptions.data property value must be equal to one of the values 
defined in the filter.

        min: If the expected value is a number, the corresponding 
MozActivityOptions.data property value must be greater than or equal to that 
value.

        max: If the expected value is a number, the corresponding 
MozActivityOptions.data property value must be lesser than or equal to that 
value.

        pattern: A string pattern following the JavaScript regular expression 
syntax. The corresponding MozActivityOptions.data property value must match 
that pattern. This is supported in Firefox OS from v1.2.

        patternFlags: If the pattern property is used, this property can be 
used to provide some extra regular expression flag such as i or g. This is 
supported in Firefox OS from v1.2.

        regexp: A string containing a regexp litteral following the JavaScript 
regular expression syntax. The corresponding MozActivityOptions.data property 
value must match that pattern. In contrary to the pattern flag, this can match 
only part of the value, therefore you must use the metacharacters ^ and $ to 
respectively match the start and the end of the string. This is supported in 
Firefox OS v1.0 and v1.1 only. Therefore you're advised to use both pattern and 
regexp.

    If the filter value is an array of filter definition objects they are 
treated as a logical OR. If one filter definition matches the page specified in 
"href" is launched.



-Axel



-----Original Message-----
From: Fabrice Desré [mailto:[email protected]]
Sent: Wednesday, February 18, 2015 10:43 AM
To: Nennker, Axel; [email protected]
Subject: Re: [b2g] WebActivities activities filter restrictions



On 02/18/2015 01:32 AM, [email protected] wrote:



>

> The point is that the FFOS app would now have two definitions for "open".

>

> Is there a way to express this in one manifest?



Currently no. But that's an interesting use case...



                Fabrice

--

Fabrice Desré

b2g team

Mozilla Corporation
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to