I
I
Ivan2020-02-27 13:51:12
JavaScript
Ivan, 2020-02-27 13:51:12

How to identify Safari mobile browser?

Hello! Podskazhite, how can I identify the mobile browser Safari through the user-agent?

It would seem that the question is simple and you just need to look for the safari entry, but it wasn’t there.
The problem is that browsers on Chromium also contain this line.
For example, Google Chrome Agent.
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Karbivnichy, 2020-02-27
@skapunker

Look for iPhone, iPad
Safari User Agents

T
ThunderCat, 2020-02-27
@ThunderCat

It would seem that the question is simple and you just need to look for the safari entry, but it wasn’t there.
and does not contain Chrome? I don't use safari...

A
Alex, 2020-02-27
@Kozack

if
  UA contain "safari"
  and
  UA not contain "Chrome"
then
  // this is Safari

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question