Support passing transferables (such as MessagePort objects) to postMessage().
<rdar://problem/35222245>
*** Bug 181648 has been marked as a duplicate of this bug. ***
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.
Oh, this has actually been implemented. *** This bug has been marked as a duplicate of bug 181178 ***
(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?
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.
(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()...
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.
(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) { }
(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.
(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.