Re: [w3c/payment-handler] window.open not working from paymentrequest eventlistener (#280)

@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