> For the complete documentation index, see [llms.txt](https://api2-ekycapis.innov8tif.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api2-ekycapis.innov8tif.com/web-ekyc/web-ekyc-all/okayid-web-camera/operating-system-detection.md).

# Operating System Detection

## Objective of this OS detection code

The objective of this code is to detect the Operating System of the device.

### Lists of supported OS

| OS      | OS Platform                                                                |
| ------- | -------------------------------------------------------------------------- |
| Windows | <ol><li>Win32</li><li>Win64</li><li>Windows</li><li>WinCE</li></ol>        |
| MacOS   | <ol><li>Macintosh</li><li>MacIntel</li><li>MacPPC</li><li>Mac68K</li></ol> |
| iOS     | <ol><li>iPhone</li><li>iPad</li><li>iPod</li></ol>                         |

### Sample Code

{% code title="getOS Code" %}

```
function getOS() {
	var userAgent = window.navigator.userAgent, platform = window.navigator.platform, macosPlatforms = [
			'Macintosh', 'MacIntel', 'MacPPC', 'Mac68K' ], windowsPlatforms = [
			'Win32', 'Win64', 'Windows', 'WinCE' ], iosPlatforms = [
			'iPhone', 'iPad', 'iPod' ], os = null;

	if (macosPlatforms.indexOf(platform) !== -1) {
		os = 'Mac OS';
	} else if (iosPlatforms.indexOf(platform) !== -1) {
		os = 'iOS';
	} else if (windowsPlatforms.indexOf(platform) !== -1) {
		os = 'Windows';
	} else if (/Android/.test(userAgent)) {
		os = 'Android';
	} else if (!os && /Linux/.test(platform)) {
		os = 'Linux';
	}

	return os;
}
```

{% endcode %}

### Sample Code File

{% file src="/files/tefwGMLbKgOiVGe9QiGU" %}
