Is there any way to detect visitor's browser and device with javascript? Something Google Analytics does in their dashboard. I found some scripts in Stackoverflow for browser detection but it does not work very well - the version wasn't not correct and you couldn't know if Chrome was used on Mobile or Desktop so the information wasn't relevant and I couldn't find anything that would combine both experience - browser (possibly version) and device via javascript.
Asked
Active
Viewed 53 times
0
-
1"Does not work very well" is not a very useful comment. Please show code and effort and what does not work for you. – mplungjan Nov 09 '17 at 09:39
-
@mplungjan I edited the comment although the code is not relevant - it was just browser detection and you couldn't tell if it's mobile or desktop. I googled quite intensively but didn't find anything useful with both browser version and device detection. – Petr Nov 09 '17 at 10:19
-
If you actually want it to be somewhat accurate across as many browsers as possible, your only realistic chance is to use a library which keeps and updates a database of known browser signatures. Rolling this yourself in this day and age is an unnecessary uphill battle. – deceze Nov 09 '17 at 10:28
-
good idea, any recommended library for this? – Petr Nov 10 '17 at 00:18