| Summary: | `'Notification' in window` returns false | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | N <hendrex.jakai> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | ap, ashvayka, bedney, beidson, cdumez, rniwa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 16 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 16 | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=264074 | ||
|
Description
N
2022-11-01 06:43:30 PDT
Notification.permission is certainly supported, and exposed as window.Notification.permission. CC'ing some folks who would know why the "in window" check fails. Thanks Alexey. I've just tested "window.Notification", and it seems to be "undefined". I double checked, and I have those same 3 feature flags (listed in my previous comment) enabled. No matter what you've done with those experimental feature flags, window.Notification is not supported in Safari on iOS 16. As for your questions of when Safari will support a particular feature; Safari is a product shipped by Apple, not the WebKit open source project. So this is not a place where that can be answered. I tested wrong. First, I tested on macOS. Second, I tried `Notification in window` instead of `'Notification' in window`. Embarrassing. Thanks Brady. Could you please indicate where can I report this and get answers about this? This looks like a significant hole on the implementation of Web Push, as we need to know the value of `Notification.permission` to be able to optimize the user's experience on the website. (and avoid annoying the user, or provide the user with instructions to unblock the notifications if they are trying to turn these on again, etc) (In reply to N from comment #5) > Thanks Brady. > > Could you please indicate where can I report this and get answers about this? > > This looks like a significant hole on the implementation of Web Push, as we > need to know the value of `Notification.permission` to be able to optimize > the user's experience on the website. > > (and avoid annoying the user, or provide the user with instructions to > unblock the notifications if they are trying to turn these on again, etc) Can you use navigator.permissions for that? There's a code snippet here: https://webkit.org/blog/14112/badging-for-home-screen-web-apps/ In case anyone else happens upon this bug, in Safari for iOS (at least as of iOS 17.3), the Notification object is undefined (i.e. "'Notification' in window" will fail) *unless the page is "installed"* (i.e. it is running as a PWA / has been "Add(ed) To Home Screen"). |