RESOLVED DUPLICATE of bug 181178 178940
[Service Worker] Support passing MessagePort objects to postMessage()
https://bugs.webkit.org/show_bug.cgi?id=178940
Summary [Service Worker] Support passing MessagePort objects to postMessage()
Chris Dumez
Reported 2017-10-27 09:22:11 PDT
Support passing transferables (such as MessagePort objects) to postMessage().
Attachments
Radar WebKit Bug Importer
Comment 1 2017-10-27 09:22:44 PDT
youenn fablet
Comment 2 2018-01-16 01:21:02 PST
*** Bug 181648 has been marked as a duplicate of this bug. ***
Thiago Soares
Comment 3 2018-01-31 14:53:41 PST
We have a product that uses the Service Worker Api and also need to pass MessagePort objects to postMessage(). It is a feature that will block us from using our solution on Safari.
Chris Dumez
Comment 4 2018-01-31 14:59:54 PST
Oh, this has actually been implemented. *** This bug has been marked as a duplicate of bug 181178 ***
youenn fablet
Comment 5 2018-01-31 15:48:22 PST
(In reply to Thiago Soares from comment #3) > We have a product that uses the Service Worker Api and also need to pass > MessagePort objects to postMessage(). > It is a feature that will block us from using our solution on Safari. Thiago, do you have a public endpoint for your solution that we could use for our testing? Can you detail your usage of MessageChannel? Do you have any other requirement in terms of service worker features that Safari Tech Preview 47 would not fulfill?
Stephan Coertzen
Comment 6 2018-01-31 21:21:55 PST
https://mdmobile.co.za, you'll need a username and password for the update to start though. Can't you test it yourself? The issue is passing information through postMessage to the Service Worker.
youenn fablet
Comment 7 2018-02-01 08:34:25 PST
(In reply to Stephan Coertzen from comment #6) > https://mdmobile.co.za, you'll need a username and password for the update > to start though. Can't you test it yourself? The issue is passing > information through postMessage to the Service Worker. Sure, we are testing this particular feature. It is always good to do some field testing as well :) Also, it is a different matter if what is blocking your web site from supporting WebKit is just postMessage or if you need other stuff like pushManager, openWindow(), focus()...
Stephan Coertzen
Comment 8 2018-02-01 08:51:12 PST
I would think that you are implementing the service worker for all scenarios according to standard. Our App has been built to conform to standard to be supported by all browsers. https://www.w3.org/TR/service-workers-1/#dom-serviceworker-postmessage So no, this would not be the only thing that our PWA would need.
Thiago Soares
Comment 9 2018-02-01 08:59:14 PST
(In reply to youenn fablet from comment #5) > (In reply to Thiago Soares from comment #3) > > We have a product that uses the Service Worker Api and also need to pass > > MessagePort objects to postMessage(). > > It is a feature that will block us from using our solution on Safari. > > Thiago, do you have a public endpoint for your solution that we could use > for our testing? Can you detail your usage of MessageChannel? Do you have > any other requirement in terms of service worker features that Safari Tech > Preview 47 would not fulfill? Hi Youenn, We have a beta environment that I can give you access if you want. I will contact you on your email. We use the MessageChannel to enable the service worker to directly respond to a message sent by the application: Application code: var messageChannel = new MessageChannel(); messageChannel.port1.onmessage = handleCommandResponse swReg.active.postMessage(message, [messageChannel.port2]); SW Code: onMessage: function(event) { }
youenn fablet
Comment 10 2018-02-01 09:11:34 PST
(In reply to Stephan Coertzen from comment #8) > I would think that you are implementing the service worker for all scenarios > according to standard. Our App has been built to conform to standard to be > supported by all browsers. > https://www.w3.org/TR/service-workers-1/#dom-serviceworker-postmessage > > So no, this would not be the only thing that our PWA would need. I am also interested in having a fully compliant service worker implementation. WebKit is not there yet. Current focus is on making sure fetch event, offline mode, network proxy use cases will work fine.
youenn fablet
Comment 11 2018-02-01 09:12:07 PST
(In reply to Thiago Soares from comment #9) > (In reply to youenn fablet from comment #5) > > (In reply to Thiago Soares from comment #3) > > > We have a product that uses the Service Worker Api and also need to pass > > > MessagePort objects to postMessage(). > > > It is a feature that will block us from using our solution on Safari. > > > > Thiago, do you have a public endpoint for your solution that we could use > > for our testing? Can you detail your usage of MessageChannel? Do you have > > any other requirement in terms of service worker features that Safari Tech > > Preview 47 would not fulfill? > > Hi Youenn, > > We have a beta environment that I can give you access if you want. I will > contact you on your email. Thanks Thiago, that would be helpful.
Note You need to log in before you can comment on or make changes to this bug.