showing results for - "js detect os"
Agustina
07 Jan 2019
1window.navigator.platform
Bronwyn
11 Apr 2018
1agent = {browser:{name:null,version:null,v:null,userAgent:null,app:null,os:null},mobile:false,pointlock:false};
2
3var nVer = navigator.appVersion;
4var nAgt = navigator.userAgent;
5var browserName  = navigator.appName;
6var fullVersion  = ''+parseFloat(navigator.appVersion); 
7var majorVersion = parseInt(navigator.appVersion,10);
8var nameOffset,verOffset,ix;
9agent.pointlock = 'pointerLockElement' in document ||
10    'mozPointerLockElement' in document ||
11    'webkitPointerLockElement' in document;
12
13// In Opera, the true version is after "Opera" or after "Version"
14if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
15 browserName = "Opera";
16 fullVersion = nAgt.substring(verOffset+6);
17 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
18   fullVersion = nAgt.substring(verOffset+8);
19}
20// In MSIE, the true version is after "MSIE" in userAgent
21else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
22 browserName = "Microsoft Internet Explorer";
23 fullVersion = nAgt.substring(verOffset+5);
24}
25// In Chrome, the true version is after "Chrome" 
26else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
27 browserName = "Chrome";
28 fullVersion = nAgt.substring(verOffset+7);
29}
30// In Safari, the true version is after "Safari" or after "Version" 
31else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
32 browserName = "Safari";
33 fullVersion = nAgt.substring(verOffset+7);
34 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
35   fullVersion = nAgt.substring(verOffset+8);
36}
37// In Firefox, the true version is after "Firefox" 
38else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
39 browserName = "Firefox";
40 fullVersion = nAgt.substring(verOffset+8);
41}
42// In most other browsers, "name/version" is at the end of userAgent 
43else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < 
44          (verOffset=nAgt.lastIndexOf('/')) ) 
45{
46 browserName = nAgt.substring(nameOffset,verOffset);
47 fullVersion = nAgt.substring(verOffset+1);
48 if (browserName.toLowerCase()==browserName.toUpperCase()) {
49  browserName = navigator.appName;
50 }
51}
52// trim the fullVersion string at semicolon/space if present
53if ((ix=fullVersion.indexOf(";"))!=-1)
54   fullVersion=fullVersion.substring(0,ix);
55if ((ix=fullVersion.indexOf(" "))!=-1)
56   fullVersion=fullVersion.substring(0,ix);
57
58majorVersion = parseInt(''+fullVersion,10);
59if (isNaN(majorVersion)) {
60 fullVersion  = ''+parseFloat(navigator.appVersion); 
61 majorVersion = parseInt(navigator.appVersion,10);
62}
63agent.browser.name = browserName;
64agent.browser.version = fullVersion;
65agent.browser.v = majorVersion;
66agent.browser.app = navigator.appName;
67agent.browser.userAgent = navigator.userAgent;
68var OSName="Unknown OS";
69if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
70if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
71if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
72if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
73
74agent.browser.os = OSName;
75agent.mobile = (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1);
queries leading to this page
javascript check if device is phonecheck for mobile device javascriptjs check device typedetect mobile brand webjs to detect devicejavascript device detectionmobile and pc and tablet html automatic detect css for alltypescript check device type pc tablet smartphonejavascript device detectjavascript device detectorcheck os in jshow to get device type in javascriptmobile and pc and tablet html automatic detectjavascript get device informationnew mobiledetect 28mobile detect jsmobile detect js examplejavascript check if its mobilehow to detect what browser is being used with javascriptjavascript detect ostell what device jscheck os using jsdetecting device with javascriptjs check osjava script how to detect device from the webjs detect if mobilehow to detect device with jquerydetect device info using jsjavascript detect device typejavascript get mobile device informationhow to detect device with jshow to check os with javascriptjs if is mobilesimple device detction in javascriptdetect device javascripthow to get the device using the site in javascripthow to check device in javascriptdetect browser event javascript 5bjavascript check if mobile devicehow to detect user device in javascriptjs detect os check type of os in javascriptjavascript read devicehow to know device with using jsdetect browser js device details jsdevice detect js librarydetect device htmldetect device jquery javascriptjs detect browser typecheck the device in javascriptdetect device javascript branduniquely identify a device javascripthow to check browser javascriptcheck browser jsjs identify browserjs detect devicejavascript check if its mobile in cssjavascript how to detect device typedevice detector jsjavascript check if its a phonedetecting device using javascripthow to determine browser in javascriptjavascript detect if mobile devicedetect os javascript nodejsjs to find devicejs check if device is mobiledetect the device or browser using jsjavascript detect smartphoneif on mobile jsdetect is device or web jsjavascript detect browser typeget device type javascriptworking of device detection javascriptnodejs detect oshow to check browser in javascriptmobile detect jshow to detect which browser is being used javascriptjs device detectiondetect browser javascriptget user device javascriptandroid detect device in javascriptcheck device javascripthow to see what device javascriptjavascript detect devicejavascript check current devicehow to recognize device detail in jsjavascript check if the device is mobilejavascript detect client devicejs detect device typejavascript how to check if mobivle device from google appdetect os jsdetect mobile screen in javascripthow to detect android device using javascriptjs detect os and browserdetect if mobile device javascriptjavascript if device is mobiledetect device type from javascripthow to check which device we are using javascriptjavascript detect browserjs mobile device detectionget devise with libray jsdetect device jsdevice check in javascriptdevice detection js in browserlive detection in mobile phones javascriptidentify device with j avascriptdetect os in javascripthow to check if the mobile detect is android or ios in javascriptphone detect jsdetect if os javascriptdetect browser with javascriptdevice detection jscheck os javascriptcheck device in javascriptdevice detect javascriptjavascript check if device is mobilejavascript get device mobile desktopidentify device javascriptjavascript browser identify devicehow to detect a device in javascripthow to detect browser in javascriptmobile detect js detect browserhow to detect a browser using javascriptmobile detector jsdetect device vanilladetect os nodejsbrowser detect jsdetect os javascriptdetect device type javascripthow to detect device type in javascriptjavascript detect device modeljs detect operating systemmobiledetect javascriptjavascript check if moviledetect the browser by javascriptjavascript check if mobilecheck device jshow to detect device in javascriptdevice mobile detect jsjs get devicejavascript if mobilejavascript check device typejavascript check mobile devicedetecting os in javascriptjavascript check browserjs device informationhow to detect device in jsdevice detection by jshow to detect os in javascriptjavascript to detect deviceonline device detection javascripthtml check device typejavascript check device type pc tablet smartphonedetect device in javascriptjavascript device detection and displaymobile detect min js 3fid 3dcheck if mobile device javascriptdetect device in jsdetect device type in jsdevice detection javascripthow to check what is the device with jsjavascript detect screen mobileget device details using javascriptjs device datajavascript how to check mobile deveicehow to determine whether website is opening in mobile or desktop using jquerydetect which browser is being used javascripthow to detect what device a user is on javascriptif device not mobile jsdevice detection for html website in javascripthow to check os in jsjs browser device detectionjs test fir mobilejs detect browserdetect os using javascriptget device from browser jsget device in jsif mobile jscss js detect mobile devicejs detect available devicesdetect os with javascriptjavascript device detection returncheck browser javascriptjavascript identify deviceuse javascript to detect devicedetect os from jsjavascript how to detect browserjavascript get device typenode detect osjavascript check if running on mobilehow to detect the device using javascriptjs check devicejs detect os