diff --git a/index.html b/index.html index 8c8ee10..7d79f38 100644 --- a/index.html +++ b/index.html @@ -474,6 +474,14 @@

When called, this method executes the following steps:

    +
  1. Let registration be the PaymentInstrument's + associated service worker registration. +
  2. +
  3. If registration has no active worker, then + reject a Promise with an + "InvalidStateError" DOMException and terminate + these steps. +
  4. Upon user agent discretion and depending on user consent, optionally return a Promise rejected with a NotAllowedError. @@ -716,7 +724,8 @@

    <script> const instrumentKey = "c8126178-3bba-4d09-8f00-0771bcfd3b11"; - const registration = await navigator.serviceWorker.register("/register/sw.js"); + navigator.serviceWorker.register("/register/sw.js"); + const registration = await navigator.serviceWorker.ready; await registration.paymentManager.paymentInstruments.set({ instrumentKey, { @@ -773,8 +782,8 @@

    return; // not supported, so bail out. } - const registration = - await navigator.serviceWorker.register("/sw.js"); + navigator.serviceWorker.register("/sw.js"); + const registration = await navigator.serviceWorker.ready; // Excellent, we got it! Let's now set up the user's cards. await addInstruments(registration); @@ -2396,6 +2405,7 @@

    The terms service worker, + service worker registration, active worker, service worker client, ServiceWorkerRegistration,