sysapps / runtime

Runtime and Security Model for Hosted Web Applications and Packaged Applications
6 stars 13 forks source link

System messages should be pluged into the application manifest #73

Open mounirlamouri opened 11 years ago

marcoscaceres commented 11 years ago

Can you clarify what you mean by "plugged"?

mounirlamouri commented 11 years ago

In Firefox OS we have:

"messages": [
  [ "foo", "/index.html" ],
  [ "bar", "/blah.html" ]
],

The current spec doesn't say how you register to get system messages.

jmajnert commented 11 years ago

OK. So the setMessageHandler() doesn't actually register for a message? It only sets a handler for messages that the application had previously registered for via the manifest?

mounirlamouri commented 11 years ago

Yes.

jmajnert commented 11 years ago

OK. Then I think we should clarify that in the runtime spec. The current text gives no hints as to how registering happens.

Why do you think the system messages should be declared in the manifest? Wouldn't a runtime API for registering/unregistering be enough?

mounirlamouri commented 11 years ago

We might need a runtime API too but we definitely need something in the manifest so I prefer to delay the JS API for when we will really need it.

I started writing something for that last week. I have to find time to finish it.

jmajnert commented 11 years ago

From the example you gave earlier I see that the registration is on a per-document basis - message of type "foo" goes to index.html and "bar" goes to blah.html. Could you please explain what the expected behaviour is if a "bar" message arrives when:

  1. Application is not running (its manifest says "launch_path: 'index.html' "). Will the application launch normally and get redirected to blah.html (at what point?), or will it launch directly with blah.html?
  2. Application is running, index.html is loaded. I guess the system message will have no effect until user navigates to blah.html?
jmajnert commented 11 years ago

I think this issue is also relevant here: https://github.com/sysapps/runtime/issues/20

jmajnert commented 11 years ago

We should also consider multi-window scenarios as in #100