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: detect safari when launching from dock #1356

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

Florent-Bouisset
Copy link
Collaborator

safari v.17 (macOS v.14) introduce a new feature to save any webpage as a web app. The app is added to the dock and can be used independently from safari. Hower this app still use safari engine under the hood. It appears that when using safari in a webapp property "window.safari" is undefined.
As the detection of safari browser rely on this property, the browser is mistakenly considered as non safari.
The goal of this change is to rely on userAgent that may be more reliable.

https://support.apple.com/en-us/104996
https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#which_part_of_the_user_agent_contains_the_information_you_are_looking_for

safari v.17 (macOS v.14) introduce a new feature to save any webpage
as a web app. The app is added to the dock and can be used independently
from safari. Hower this app still use safari engine under the hood.
It appears that when using safari in a webapp property "window.safari"
is undefined.
As the detection of safari browser rely on this property, the browser
is mistakenly considered as non safari.
The goal of this change is to rely on userAgent that may be more
reliable.

https://support.apple.com/en-us/104996
https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#which_part_of_the_user_agent_contains_the_information_you_are_looking_for
@peaBerberian peaBerberian merged commit 0d52bb0 into master Jan 11, 2024
3 checks passed
@peaBerberian peaBerberian mentioned this pull request Jan 24, 2024
@peaBerberian peaBerberian modified the milestones: 4.0.0-rc.1, 3.33.0 Feb 5, 2024
@peaBerberian peaBerberian deleted the fix/safari-detection-master branch February 7, 2024 17:53
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.

2 participants