WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
247315
`'Notification' in window` returns false
https://bugs.webkit.org/show_bug.cgi?id=247315
Summary
`'Notification' in window` returns false
N
Reported
2022-11-01 06:43:30 PDT
Hey I have iOS 16.2 installed on my iPhone, and I have enabled under Safari's experimental WebKit features: - Built-in Web Notifications - Push API - Permissions API However, while `'PushManager' in window` returns true, `'Notification' in window` returns false, so I can't use the very basic `Notification.permission` so I can handle the modals and requests properly. Do you know if it will be the case that Safari won't be supporting such basic and important thing as `Notification.permission` ? Thank you!
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2022-11-01 12:49:57 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.
N
Comment 2
2022-11-01 14:54:24 PDT
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.
Brady Eidson
Comment 3
2022-11-03 13:19:45 PDT
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.
Alexey Proskuryakov
Comment 4
2022-11-03 13:26:08 PDT
I tested wrong. First, I tested on macOS. Second, I tried `Notification in window` instead of `'Notification' in window`. Embarrassing.
N
Comment 5
2022-11-03 14:30:57 PDT
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)
Radar WebKit Bug Importer
Comment 6
2022-11-08 05:44:19 PST
<
rdar://problem/102087326
>
Brady Eidson
Comment 7
2023-05-23 15:54:57 PDT
(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/
William J. Edney
Comment 8
2024-02-04 11:35:57 PST
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").
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug