Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deprecated Javascript OS detection techniques

I was wondering why javascript os detection techniques like navigator.userAgent, navigator.appName, navigator.appVersion and navigator.platform are in process of being dropped from web standards.

https://developer.mozilla.org/en-US/docs/Web/API/Navigator

If you visit every of those navigator props, you can see

Deprecated

This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

So I would like to know

  1. Why they're removing this
  2. Will they introduce a new way for OS detection
  3. Can I use these techniques even if they're deprecated.

Probably there is a lot of cases where we need to know OS version.

like image 974
ardoc Avatar asked Nov 09 '22 12:11

ardoc


1 Answers

It was incorrectly or accidentally marked as deprecated on MDN. They quickly corrected the page once they saw the problem, but since it had been a definitive source, references to it being deprecated still exist here and there.

Here's the conversation where it was fixed: https://groups.google.com/forum/#!topic/mozilla.dev.mdc/tIx2iiH2u3o

like image 182
IKM Avatar answered Nov 14 '22 21:11

IKM