iOS Web Apps - Notification.permission reports as "default", after tapping on a notification that uses clients.openWindow

One Line Summary

Notification.permission is incorrectly reported as "default" on iOS App Webs, this happens when tapping on a notification that results in a new "window" being opened via clients.openWindow.

Why this is is important to fix

This is confusing to the end-user as sites will check Notification.permission and see it is "default" and then attempt to show the end-user a soft notification permission prompt again.

Steps to reproduce the issue

  1. On a iOS 16.4 or newer device open https://ios-webapp-notification-new-window-permission-bug.glitch.me in Safari
  2. Tap share button
  3. Tap "Add to Home Screen"
  4. Open the iOS Web App you just added
  5. Tap "Prompt Notification permission"
  6. On the iOS native notification permission prompt press "Allow"
  7. Tap "Display notification"
  8. Tap on the notification
  9. [Safari/iOS Bug] Observe Notification.permission reports as "default" when it should be "granted"

What devices are affected

I have reproduce this issue on an iPhone 14 Pro on both iOS 16.7.2 & 17.1.2. However I would expect all iOS 16.4+ devices to be effected.

iOS Web Apps - Notification.permission reports as "default", after tapping on a notification that uses clients.openWindow
 
 
Q