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.
Noting the works in Blink-based browsers.
Right, we do not support yet onchange event handler but when it is the case, we should definitely do something about it.
<rdar://problem/88969778>