Bug 178940
| Summary: | [Service Worker] Support passing MessagePort objects to postMessage() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> |
| Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | beidson, coertzen.jfs, ggaren, olivier, thiago.soares, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=174541 | ||
Chris Dumez
Support passing transferables (such as MessagePort objects) to postMessage().
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/35222245>
youenn fablet
*** Bug 181648 has been marked as a duplicate of this bug. ***
Thiago Soares
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
Oh, this has actually been implemented.
*** This bug has been marked as a duplicate of bug 181178 ***
youenn fablet
(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
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
(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
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
(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
(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
(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.