- From: majaybabu <notifications@github.com>
- Date: Thu, 05 Apr 2018 00:29:15 +0000 (UTC)
- To: w3c/payment-handler <payment-handler@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 5 April 2018 00:29:40 UTC
@romandev navigator.serviceWorker.addEventListener() worked for me after having a delay with setTimeout like this - setTimeout(function() { navigator.serviceWorker.addEventListener("message", function (event) { console.log('message received: ' + JSON.stringify(event.data)); }); }, 100); and setTimeout on SW as well - evt.openWindow("https://majaybabu.github.io/payment-handler-pay/select.html") .then(function(windowClient) { setTimeout(function(){ console.log('posting msg....'); windowClient.postMessage(JSON.parse(cardsResponse)); }, 200); }); -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/payment-handler/issues/280#issuecomment-378786064
Received on Thursday, 5 April 2018 00:29:40 UTC