MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / getOS

Function getOS

public/src/js/sideBar.js:173–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171 setInterval(testConnectionSpeed, randomInteger(1000, 1200))
172
173 function getOS() {
174 var userAgent = window.navigator.userAgent,
175 platform = window.navigator.platform,
176 macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],
177 windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],
178 iosPlatforms = ['iPhone', 'iPad', 'iPod'],
179 os = null;
180
181 if (macosPlatforms.indexOf(platform) !== -1) {
182 os = 'Mac OS';
183 } else if (iosPlatforms.indexOf(platform) !== -1) {
184 os = 'iOS';
185 } else if (windowsPlatforms.indexOf(platform) !== -1) {
186 os = 'Windows';
187 } else if (/Android/.test(userAgent)) {
188 os = 'Android';
189 } else if (/Linux/.test(platform)) {
190 os = 'Linux';
191 }
192
193 return os;
194 }
195 $("#device").text(getOS())
196
197}

Callers 1

sideBarFunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected