Re: Using HTML5 Channel Messaging with Web Intents to create persistent relations

Greg, this works in the current implementation in Chrome, right?

James


On Wed, Feb 22, 2012 at 11:02 AM, Paul Kinlan <paulkinlan@google.com> wrote:

> Hi,
>
> At the moment, this is one of the things that doesn't work in the shim.
>  Because the shim uses a lot of hacks to get it working in IE and FF I have
> had to limit some functionality.  Most of this is due to the fact that data
> signaling is currently done via localStorage events and you can't serialize
> a MessagePort to a string.
>
> P
>
>
> On Wed, Feb 22, 2012 at 5:14 PM, Nilsson, Claes1 <
> Claes1.Nilsson@sonyericsson.com> wrote:
>
>> Hi, ****
>>
>> ** **
>>
>> I wanted to text creating a message channel between a Client page and a
>> Service page when running in Chrome and using the JS shim from
>> webintents.org but I didn’t get it working. I a probably doing something
>> stupid…****
>>
>> ** **
>>
>> The code in the Client page is:****
>>
>> ** **
>>
>>          var channel = new MessageChannel();****
>>
>>     ****
>>
>>           var intent = new Intent();****
>>
>>           intent.action = "http://webintents.org/view";****
>>
>>           intent.type = "video/*";****
>>
>>           intent.data = channel.port2;****
>>
>> ** **
>>
>>           window.navigator.startActivity(intent, function (intentData) {*
>> ***
>>
>>               alert (intentData);****
>>
>>           });     ****
>>
>> ** **
>>
>>          channel.port1.onmessage = function (evt) {****
>>
>>                 alert (evt.data);****
>>
>>           };  ****
>>
>> ** **
>>
>> The Service page code is:****
>>
>> ** **
>>
>>      If (!!window.intent) {****
>>
>>      ****
>>
>>           var port = intent.data;****
>>
>>        ****
>>
>>           if (port) {****
>>
>>              port.start();****
>>
>>              port.postMessage("Port received");        ****
>>
>>           }, false);****
>>
>>         ****
>>
>>       }****
>>
>> ** **
>>
>> However, Chrome does not recognize port as a Message port object. What’s
>> wrong. Sorry for not being very experienced with JavaScript.****
>>
>> ** **
>>
>> Claes ****
>>
>> ** **
>>
>> [image: cid:3333625383_1036728]
>>
>> *Claes Nilsson M.Sc.E.E*
>> Master Engineer, Research
>> Technology Research - Advanced Application Lab
>> *
>> Sony Ericsson Mobile Communications*
>>  Phone:  +46 10 80 15178
>> Mobile: +46 705 56 68 78
>> Switchboard: +46 10 80 00000
>> E-Mail:* **mailto:claes1.nilsson@sonyericsson.com*<claes1.nilsson@sonyericsson.com>
>> * *
>> Visiting Address; Nya Vattentornet
>> SE-221 88 LUND,
>> Sweden ****
>>
>> *Disclaimer:
>> *The information in this e-mail is confidential and may be legally
>> privileged. It is intended solely for the named recipient(s) and access to
>> this e-mail by anyone else is unauthorized. The views are those of the
>> sender and not necessarily the views of Sony Ericsson and Sony Ericsson
>> accepts no responsibility or liability whatsoever or howsoever arising in
>> connection with this e-mail.Any attachment(s) to this message has been
>> checked for viruses, but please rely on your own virus checker and
>> procedures. If you contact us by e-mail, we will store your name and
>> address to facilitate communications. If you are not the intended
>> recipient, please inform the sender by replying this transmission and
>> delete the e-mail and any copies of it without disclosing it.****
>>
>>  ****
>>
>> ** **
>>
>
>
>
> --
> Paul Kinlan
> Developer Advocate @ Google for Chrome and HTML5
> G+: http://plus.ly/paul.kinlan
> t: +447730517944
> tw: @Paul_Kinlan
> LinkedIn: http://uk.linkedin.com/in/paulkinlan
> Blog: http://paul.kinlan.me
> Skype: paul.kinlan
>
>

Received on Wednesday, 22 February 2012 19:33:43 UTC