- From: Greg Billock <gbillock@google.com>
- Date: Wed, 25 Jan 2012 09:20:50 -0800
- To: public-web-intents@w3.org
The way we think about intent payloads right now, they won't accept JS functions because they aren't serializable with the structured clone algorithm. That is, you'd get a JS type error in the Intent object constructor. The ability to map a communications channel onto a local JS object, so that you'd essentially be using a local stub to talk to the printer, is an interesting idea, and it could end up being a useful tool, but I think that for intents, we want to keep the contents of the message serializable, and specs for such object proxying probably ought to be written in a messaging style. (You need all the RPC mechanics of deferred results and such, too.) I suspect that by the time you start specifying these interactions in enough detail, what you really kind of want is for the remote object to be able to pop up its own interface to deal with eventualities, like paper jams or ink outages. But in that case, that's what the simpler RPC-style intents basically does: you call a print action, and the printer can use whatever UI it wants to help the user deal with printing mechanics. (Switching feeds from rear to front, loading exceptional media, etc.) It may be possible to define some common error cases, but I'm skeptical that they'll be superior to native UI the printer controls directly. On Wed, Jan 25, 2012 at 3:51 AM, Dave Raggett <dsr@w3.org> wrote: > I spotted an error in my example: > > On 25/01/12 11:40, Dave Raggett wrote: > >> // now start the activity and redirect >> // the onSuccess, and onFail functions >> // to methods on the intent data object >> >> window.navigator.startActivity(intent, >> function (data) { intent.success(data); }, >> function (data) { intent.fail(data); } >> ); > > Should have been: > > window.navigator.startActivity(intent, > function (data) { intent.data.success(data); }, > function (data) { intent.data.fail(data); } > ); > > sorry about that. > -- > Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett >
Received on Wednesday, 25 January 2012 17:21:21 UTC