navigator.permissions.query -> permissionStatus.onchange is Supposed to listen to the event of a change in permissions in the browser settings. This works for all browsers, but in Safari for iOS and MacOS this seems to be broken in the currently recent versions 17.x
Example:
navigator.permissions.query({ name: 'notifications' }).then((permissionStatus) => {
permissions = permissionStatus.state; // this value gets set correctly
permissionStatus.onchange = () => {
// This will not get executed when permissions have been changed
// within the safari settings app, or iOS Settings for PWA or Safari
};
});
Can someone from Apple's Webkit Team please comment on this? Thank you. T.