WebAPI/WebActivities: Difference between revisions

Jump to navigation Jump to search
→‎More information: add a declarative registration sub-section
(→‎More information: add a declarative registration sub-section)
Line 61: Line 61:


You do not need to pass the same ''ActivityHandlerDescription'' object to have ''registerActivityHandler'', ''unregisterActivityHandler'' and ''isActivityHandlerRegistered'' working. You only need to pass an instance of ''ActivityHandlerDescription'' with the same attribute values.
You do not need to pass the same ''ActivityHandlerDescription'' object to have ''registerActivityHandler'', ''unregisterActivityHandler'' and ''isActivityHandlerRegistered'' working. You only need to pass an instance of ''ActivityHandlerDescription'' with the same attribute values.
=== Declarative registration ===
Open Web App Manifest should include a way to register activities declaratively. The format would look like this:
  "activities": {
    "share": {
      "filters": {
        type: ["image/png", "image/gif"],
      }
      "href": "foo.html",
      "disposition": "window"
    }
  }
For non-installed applications, this API doesn't yet define how to do a declarative registration. However, it doesn't sound very useful for the moment to have such mechanism. However, if it had to be added, adding a new element into the <head> would seem like the most appropriate solution (or using an already existing one). The only advantage of adding a new element inside the <body> is that we don't have to worry about the <head> parsing issues.


== Examples ==
== Examples ==
Confirmed users
368

edits

Navigation menu