W3C home > Mailing lists > Public > public-web-intents@w3.org > January 2012

Re: Supporting extra parameters on the Intent object

From: Greg Billock <gbillock@google.com>
Date: Mon, 30 Jan 2012 12:00:51 -0800
Message-ID: <CAAxVY9eyDGacPn9p=JXOsh6ykxg68kOkDctw7_F1Sh8CVLHTcA@mail.gmail.com>
To: WebIntents <public-web-intents@w3.org>
Draft spec has Intent.data being any structured-cloneable type,
including Transferable.

This proposal is more about metadata. So if you want to transfer, say,
a file, you can say what the filename is. Or other useful "header"
info not present in the data type as MIME-specified. Not always
needed, so optional, but handy for when the MIME type isn't "wide
enough" to fit in the metadata the handler end might find useful in
working with it.


On Mon, Jan 30, 2012 at 11:50 AM, Charles Pritchard <chuck@jumis.com> wrote:
> On 1/29/12 6:18 PM, James Hawkins wrote:
>>
>> [Constructor(in string action, in string type, in any data)]
>> interface Intent {
>>     readonly attribute DOMString action;
>>     readonly attribute DOMString type;
>>     readonly attribute any data;
>>     readonly attribute Dictionary extras;<--- Added
>>     void postResult (any data, optional Dictionary extras);<---
>> |extras| added
>>     void postFailure (any data);
>> };
>>
>> Client:
>>
>> document.getElementById('attach').onclick = function() {
>>   var intent = new Intent("http://webintents.org/pick", "*");
>>   navigator.startActivity(intent, filePicked);
>> });
>>
>> Service:
>>
>> if (window.intent) {
>>   ....
>>   window.intent.postResult(selectedFile, {filename: selectedFilename});
>> }
>
>
> Where did we land on Transferable [1] objects?
> http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#dom-window-postmessage
>
> [1] The "transfer" argument in the postMessage signature:
> postMessage(message, targetOrigin, transfer)
>
>
Received on Monday, 30 January 2012 20:01:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 30 January 2012 20:01:20 GMT