0

Hey guys I am trying to get the device name and type (Phone Android, Laptop Windows, Computer Mac ... and so on) using javascript and I know that it can be done using "navigator" but I want to ask you what do you think is the best approach for that. I mean every time when a browser is opening my js function should check browser name, device name and type, OS system and other info and so on.

I do not want to use any kind of external libraries.

console.log(navigator);

RulerNature
  • 599
  • 2
  • 12
  • 37
  • What are you using this information for. Feature detection is another option - https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Feature_detection – Velimir Tchatchevsky Sep 19 '18 at 18:12
  • I need to create a weekly report with all devices that are logging on my app and so on ... – RulerNature Sep 19 '18 at 18:16
  • Yes that's the right way then. -> https://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device-in-jquery – Velimir Tchatchevsky Sep 19 '18 at 20:07
  • Possible duplicate of [What is the best way to detect a mobile device in jQuery?](https://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device-in-jquery) – Velimir Tchatchevsky Sep 19 '18 at 20:07
  • this is also using navigator but you might find it useful https://medium.com/creative-technology-concepts-code/detect-device-browser-and-version-using-javascript-8b511906745 – let_the_coding_begin Sep 19 '18 at 20:55

0 Answers0