Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web UI with Ubuntu+Firefox or MacOS+Safari - "Notifications are Disabled" "Grant Now" option has no effect #323

Closed
milksteakjellybeans opened this issue Jun 11, 2022 · 8 comments
Labels
🪲 bug Something isn't working web-app Web app things

Comments

@milksteakjellybeans
Copy link

When using the ntfy web ui on a self hosted ntfy server, I see a panel in the top left for:

Notifications are disabled
Grant your browser permission to display desktop notifications.
GRANT NOW

When I click "GRANT NOW" action, there seems to be no effect.

This happens for both of these combinations:
Ubuntu (20.04.4 LTS) + Firefox (100.0.2)
MacOS (12.4 (21F79)) + Safari (Version 15.5 (17613.2.7.1.8))

If this isn't a supported feature on these platforms I hope it can be considered as a feature request.

Thank you

@binwiederhier
Copy link
Owner

Hmm. Works for me: https://phil.nopaste.net/XVd5JJA4kY?a=K3aSwpEmp7

image

@binwiederhier binwiederhier added 🪲 bug Something isn't working web-app Web app things labels Jun 12, 2022
@milksteakjellybeans
Copy link
Author

I will gather more info and report back, thanks

@milksteakjellybeans
Copy link
Author

With ntfy.sh, works as expected for me in Firefox and Safari.

With my self hosted, http only server, I'm having this issue.

As far as I can tell it's the browsers not letting the prompt for notification permission through.

With Firefox, looks like it will not honor the “always ask” default setting for “send notifications” if the site is served with http, at least that's what I'm seeing for my self hosted http version.

Again, with Firefox, if I manually go to site permissions (lock icon in url bar -> connection not secure -> more information -> permissions), I can switch “Send Notifications” to allow to get notifications enabled, which now has no call to action for notifications within my self hosted site. woo hoo

With Safari, I can't find a direct way to enable the notification support "manually" outside of using Xcode to manually edit the ~/Library/Safari/UserNotificationPermissions.plist file. The site preferences menu options of safari allows editing popup and video/audio playing directly for a site, but not notifications. I don't have Xcode so I didn't try the direct edit but looking at the file in a text editor does give me confidence that a direct edit would work.

so, all in all this looks more like http+notification handling logic in the browsers.

I don't know what chrome does, but if it also doesn't work there, it might be worth considering documentation notes for self hosted or changing the call to action in the web ui when the sites running http. I know the majority of folks are w/ chrome.

Thank you for reviewing.

Safari site prefs for ref
image

@binwiederhier
Copy link
Owner

Oh yeah, of course. The notifications API only works on HTTPS afaik (https://developer.mozilla.org/en-US/docs/Web/API/notification):

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Probably should add a alert in the web UI. Thanks.

@binwiederhier
Copy link
Owner

Long story short: It won't work over HTTP. Browsers are trying to push people toward HTTPS, and they do this by only allowing new features over HTTPS, even if they are completely unrelated.

@binwiederhier
Copy link
Owner

Slight correction: It works on "localhost" (HTTP) and HTTPS-sites.

@binwiederhier
Copy link
Owner

Added banner in feef15c. Thank you for reporting.

220612 16-21-32 Selection 001

@milksteakjellybeans
Copy link
Author

understood, ty

Firefox does seem to work with the manual settings change in place, but I'll know why if that stops working in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working web-app Web app things
Projects
None yet
Development

No branches or pull requests

2 participants