Bug 181648
| Summary: | Service worker postMessage | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Stephan Coertzen <coertzen.jfs> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Blocker | CC: | beidson, cdumez, youennf |
| Priority: | P2 | ||
| Version: | Safari Technology Preview | ||
| Hardware: | Mac | ||
| OS: | macOS 10.13 | ||
Stephan Coertzen
Still getting Error: Passing MessagePort objects to postMessage is not yet supported
postMessage@[native code]
Code:
var msg_chan = new MessageChannel();
msg_chan.port1.onmessage = function(event) {
if (event.data.error) {
console.log(event.data.error, true);
} else {
Web.AppCache.ServiceWorkerStartCaching();
}
}
if (navigator.serviceWorker.controller)
navigator.serviceWorker.controller.postMessage({ 'action': 'ClearCache' }, [msg_chan.port2]);
else
if (Web.ServiceWorkerReg.active)
Web.ServiceWorkerReg.active.postMessage({ 'action': 'ClearCache' }, [msg_chan.port2]);
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
youenn fablet
Thanks Stephan, this is a known limitation.
I will dupe it with https://bugs.webkit.org/show_bug.cgi?id=178940.
Do not hesitate to give feedback on how important it is for you.
*** This bug has been marked as a duplicate of bug 178940 ***
Stephan Coertzen
Thank you. It's important for our application because we need it to be compatible with all browsers (cross platform) regarding offline support. We used applicationCache before but in future browser releases the Service Worker will replace it. Thanks for indicating that you guys are looking at supporting MessageChannel parameter passing.