DEV Community

Detect MacOS, iOS, Windows, Android and Linux OS with JS

Aleksandr Semashko on February 19, 2024

This code snippet detects the user's operating system (OS) and performs a specific action based on their OS. It starts by displaying an element on ...
Collapse
 
tnfe profile image
tntweb team

cool

Collapse
 
webs95 profile image
Aleksandr Semashko

thx! :)

Collapse
 
sreno77 profile image
Scott Reno

This isn't working for me... it says "unknow" for me (using MacOs)

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him)

Not working on any on my devices. Also, please don't test for OS, test capabilities.

Collapse
 
undeplus profile image
Marc

Not working on m'y Android redme 9

Collapse
 
webs95 profile image
Aleksandr Semashko

Yes, it really is. I've made changes to the code. I'm sorry for this misunderstanding.