N
N
Nadim Zakirov2020-03-13 09:51:26
PHP
Nadim Zakirov, 2020-03-13 09:51:26

How to determine the browser and operating system by User-Agent?

I'm looking for a script to decrypt User-Agent: you need a correct detection of the browser and operating system.

I previously searched through Yandex myself, but all the scripts, libraries and plug-ins found have long been obsolete and determine browsers and OS incorrectly. Are there any ready-made modern solutions in php or js? Maybe there is some third-party service with an API, is there where all user agent databases are kept up to date?

For example, is it possible to pull data from https://yandex.ru/internet ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2020-03-13
@zkrvndm

There are and they are easily googled https://github.com/matomo-org/device-detector
PS but do not save user_agent from substitution

V
Vitaliy K, 2020-03-13
@revenger

No way. Rather, with some accuracy if unmodified software is used.
It is possible to substitute any headers.
For example, you can use Postman and stuff anything into it so that the service thinks that they go to it from an iPhone, but the bearded Anatoly is actually sitting in a damp semi-basement and making requests under Windows 3.11.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question