[Webkit-unassigned] [Bug 236349] New: Permission API: PermissionStatus with registered "change" listeners shouldn't be GC'd

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 8 23:12:51 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=236349

            Bug ID: 236349
           Summary: Permission API: PermissionStatus with registered
                    "change" listeners shouldn't be GC'd
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: marcos at marcosc.com

Related spec change:
https://github.com/w3c/permissions/pull/360

It should be possible to get a PermissionStatus object, register a listener on it, and allow it to go out of scope (but not have it GC'd) 

For example: 

```JS
(async () => {
  const perm = await navigator.permissions.query({ name: "geolocation" });
  perm.onchange = () => { console.log("pass") };
  console.log("going out of scope");
  // bye bye perm
})();

// prompts for permission
navigator.geolocation.getCurrentPosition(console.log);
```

Changing the permission of Geolocation in the above should produce "pass" in the developer console.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220209/2f7cc231/attachment.htm>


More information about the webkit-unassigned mailing list