react-device-detect
react-device-detect copied to clipboard
Chrome is being detected as Safari in iPad
- isSafari or isMobileSafari returns true when running chrome in iPad 2020 (probably others too)
- Get iPad 2020, open chrome and render the check
- iPad Pro 2020 with chrome.
- iPad Pro 2020 with Chrome
My app shouldn't run in safari so I do this check:
const isBrowserSupported = !isSafari && !isMobileSafari;
and it returns true in chrome on iPad Pro 2020
@Hamdan85 Please provide iPad Pro 2020 user agent
@duskload man, I'm sorry but I'm not sure what you mean... Isn't it Chrome?
I'm sorry but if you want the console user agent, I won't be able to give you because it happens in BrowserStack (but it's also reproducible in all customers hardware)
Can I help? Please tell me exactly what you need and I'll fetch it for ya ;)
I've read that chrome used to run on safari's webkit but I guess this is past right? Or not?
@duskload check this out.. I managed to get the user agent that causes the issue:

Mozilla/5.0 (iPad; CPU OS 14_- like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/86.0.4240.93 Mobile/15E148 Safari
Chrome on iOS is just a decoration around the iOS webView. When it comes to supported features and the JS engine, Chrome on the iPad is Safari (just even a little bit more restricted).
well... respectfully, but this is common knowledge. we know that.
but, in order for the library to attend its purpose, it should differentiate them anyway, right? maybe I'm wrong about it, but it feels to me that it should.
Otherwise, why it differentiates between chrome and edge?
My apologies, I did not want to imply that you don't know this.
However it seemed from your use case it seemed that you cannot support Safari on iOS because of missing features. It would follow that you cannot support Chrome on iOS either. So detecting iOS would be enough to tell you that you cannot support the browser.
From the UA you sent it also seems like Chrome on iOS announces itself as Safari.
Safari has limitations that would make it problematic to identify it as Chrome. I.e. Safari doesn't support a lot of SVG stuff, while all the other browsers support SVG fully.
If you want to detect Safari to display PNG instead of SVG as an alternative, that works well. If Chrome on iPad gets served an SVG, it will not display it properly, and Safari is the correct detection here.
Guess this isn't true for all cases though.
Hi guys, we're experiencing the same problem on this device:
Browser name: Chrome Browser version: 87.0.4280.163 User Agent: Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.163 Mobile/15E148 Safari/604.1 Operating System: iOS 14.4
Any thoughts on how to sort it?
Thanks
It's certainly possible to identify Chrome on iOS. Check other tools like https://www.whatsmyua.info . Chrome includes a unique segment (like CriOS/87.0.4280.163) in its user-agent string. It would be great if react-device-detect was extended with Chrome/Firefox support of their iOS apps.