Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8448

Add support for "activities" field in FirefoxOS manifest.webapp

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • None
    • None
    • None

    Description

      FirefoxOS manifest files allow a richer set of fields than currently supported by firefoxos_parser.js
      https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/cordova/metadata/firefoxos_parser.js
      E.g.: "activities"
      https://developer.mozilla.org/de/Apps/Manifest#activities

      This is needed to e.g. open files of a defined mime type.

      Extend syntax of plugin.xml like e.g.:
      <platform name="firefoxos">
      <config-file target="config.xml" parent="/*">
      <activities>
      <activity name="open" href="./import.html" disposition="inline">
      <filter type="application/wallet-import" />
      </activity>
      </activities>
      </config-file>
      </platform>

      This results e.g. in
      "activities": {
      "open": {
      "href": "./import.html",
      "disposition": "inline",
      "filters":

      { "type": "application/wallet-import" }

      }
      },

      Lines needed for this in firefoxos_parser.js:
      var activitiesNodes = config.doc.findall('activities');
      activitiesNodes.forEach(function(activitiesNode) {
      var activityNodes = activitiesNode.findall('activity');
      if (activityNodes.length) {
      var activities = {};
      activityNodes.forEach(function (node) {
      var name = node.attrib.name;
      var href = node.attrib.href;
      if (name && href) {
      events.emit('verbose', 'activity name='name' href='+href);
      activities[name] = {};
      activities[name].href = href;
      var disposition = node.attrib.disposition;
      if (disposition)

      { activities[name].disposition = disposition; }

      activities[name].filters = {};
      var filterNodes = node.findall('filter');
      filterNodes.forEach(function(filter) {
      var type = filter.attrib.type;
      if (type)

      { activities[name].filters.type = type; }

      });
      } else

      { events.emit('warn', 'activity without name='+name+'or href='+href); }

      });
      manifest.activities = activities;
      }
      });

      Attachments

        Activity

          People

            purplecabbage Jesse MacFadyen
            ignisvulpis Axel Nennker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: