diff --git a/index.html b/index.html index ff74875..24a0274 100644 --- a/index.html +++ b/index.html @@ -615,6 +615,10 @@

lock's {{[[ActiveLocks]]}} internal slot. See release a wake lock. +
@@ -888,21 +892,14 @@

on a checkbox, but updates the checkbox checked state in case the wake lock state changes:

-
+      
         const checkbox = document.createElement("input");
         checkbox.setAttribute("type", "checkbox");
         document.body.appendChild(checkbox);
 
-        navigator.wakeLock.request("screen").then(lock => {
-          checkbox.checked = true;
-
-          const listener = (ev) => {
-            checkbox.checked = false;
-            ev.target.removeEventListener('release', listener);
-          };
-
-          lock.addEventListener('release', listener);
-        });
+        const sentinel = await navigator.wakeLock.request("screen");
+        checkbox.checked = true;
+        sentinel.onrelease = () => checkbox.checked = false;
       

In this example, two different wake lock requests are created and