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

iOS Chrome traces sys.game.device.browser.mobileSafari: true #6739

Closed
michalfialadev opened this issue Feb 14, 2024 · 1 comment
Closed

iOS Chrome traces sys.game.device.browser.mobileSafari: true #6739

michalfialadev opened this issue Feb 14, 2024 · 1 comment

Comments

@michalfialadev
Copy link

michalfialadev commented Feb 14, 2024

  • Phaser Version: 3.60.0 (but 3.80.0-beta.2 looks same)
  • Operating system: win11
  • Browser: any

Description

Same as title. The browser detection code needs some updating. Currently:
https://github.com/phaserjs/phaser/blob/v3.80.0-beta.2/src/device/Browser.js

else if ((/AppleWebKit/).test(ua) && OS.iOS)
{
   Browser.mobileSafari = true;
   Browser.es2019 = true;
}

But should also consider the 'CriOS' substring of iOS Chrome's UA: https://chromium.googlesource.com/chromium/src/+/master/docs/ios/user_agent.md

Also, for some reason, sys.game.device.browser.safari is false on macOS Safari, but this is a bit outside of the scope of this issue. Still, macOS navigator.userAgent output, if anyone cares:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15

Example Test Code

Not a regex, so you can prob do better:

else if ((/AppleWebKit/).test(ua) && OS.iOS && (ua.indexOf('CriOS') == -1))
{
   Browser.mobileSafari = true;
   Browser.es2019 = true;
}
@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants