Source: www.amitmerchant.com

Detect device’s OS in JavaScript

Category: PHP, javascript

A blog on PHP, JavaScript and more Amit Merchant · June 2, 2020 · ⋆ JavaScript There comes a scenario when you might want to check which operating system the device is running.

The navigator object holds the significant amount of device information such as appName, appCodeName, platform, userAgent and so forth. Among all these, you can utilize the userAgent property which holds the information regarding the browser and the operating system it’s running on.

As you can see, it return the information regarding my current browser but most importantly it has also returned the OS.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners