Javascript – Unable to differentiate between Windows and Linux, When detecting using JS
When I see the console of my browser, even if i am using windows, it returns Linux. function detectOS() { const userAgent = navigator.userAgent.toLowerCase(); if (userAgent.includes('win')) { return 'Windows'; } else if (userAgent.includes('mac')) { return 'Mac'; } else if (userAgent.includes('linux'))…