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

fix(pwa): hide install prompt on macOS 14 safari #899

Merged

Conversation

nihalgonsalves
Copy link
Contributor

macOS 14 has support for "Add to Dock", which added the window.navigator.standalone property to macOS. This was previously only on iOS and we relied on it to display the "install required" prompt.

Since the limitation of needing an installed web app does not exist on desktop Safari, ntfy therefore wrongly stops you from using the web app notifications. This changes the heuristic to only display the install prompt when the push manager API is not available.

I also added a screenshot of the new Safari "Add to Dock" action to the docs.

While testing it I saw a deprecation warning when using the node source script, so I fixed that too - I can move that to another PR if wanted.

Before After
Screenshot showing the iOS alert wrongly appearing on macOS 14 Fixed version, without the erroneous alert

@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (19c30fc) 65.80% compared to head (d33eded) 65.77%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #899      +/-   ##
==========================================
- Coverage   65.80%   65.77%   -0.03%     
==========================================
  Files          53       53              
  Lines        7697     7697              
==========================================
- Hits         5065     5063       -2     
- Misses       1790     1791       +1     
- Partials      842      843       +1     

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@binwiederhier
Copy link
Owner

👍

@binwiederhier binwiederhier merged commit 53a4516 into binwiederhier:main Oct 2, 2023
2 checks passed
@nihalgonsalves nihalgonsalves deleted the ng/fix-safari-17-sonoma branch October 2, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants