peer-cdn
peer-cdn copied to clipboard
client.postMessage browser support
according to the client.postMessage()
documentation and presented example,
given solution should work, however client never gets worker message on:
- Google Chrome Version 64.0.3282.167 (Official Build) (64-bit), works on:
- Mozilla Firefox Quantum 58.0.2 (64-bit)
To test: https://stackoverflow.com/a/51199092/2160958
Should we use
self.clients.matchAll().then(function (clients){
clients.forEach(function(client){
client.postMessage({
msg: "Hey I just got a fetch from you!",
url: event.request.url
});
});
});
instead of
https://github.com/vardius/peer-cdn/blob/8d105c97f8eb10691db8b71e09dc75084d900161/src/plugins/Delegate.js#L33
What is the support for Clients.get()? Maybe iterating over clients and finding the one matching our id is a better way of doing this (for now) then getting client by id ?
Would love to hear someones opinion here. Any help appreciated.