function getPlatform()

in assets/download/legacy/download.js [172:231]


function getPlatform() {
	if ( navigator.platform != null ) {
		if ( navigator.platform.indexOf( "Win32" ) != -1 ) {
			return "Windows";
		} else if ( navigator.platform.indexOf( "Win64" ) != -1 ) {
			return "Windows";
		} else if ( navigator.platform.indexOf( "Win" ) != -1 ) {
			return "Windows";
		} else if ( navigator.platform.indexOf( "Linux" ) != -1 ) {
			if ( navigator.platform.indexOf( "64" ) != -1 ) {
				if ( navigator.userAgent != null ) {
					if ( navigator.userAgent.toLowerCase().indexOf( "debian" ) != -1 ||
					     navigator.userAgent.toLowerCase().indexOf( "ubuntu" ) != -1 ) {
						return "Linux Debian 64-bit";
					} else {
						return "Linux 64-bit";
					}
				} else {
					return "Linux 64-bit";
				}
			} else {
				if ( navigator.userAgent != null ) {
					if ( navigator.userAgent.toLowerCase().indexOf( "debian" ) != -1 ||
					     navigator.userAgent.toLowerCase().indexOf( "ubuntu" ) != -1 ) {
						return "Linux Debian";
					} else {
						return "Linux";
					}
				} else {
					return "Linux";
				}
			}
		} else if ( navigator.platform.indexOf( "SunOS i86pc" ) != -1 ) {
			return "Solaris x86";
		} else if ( navigator.platform.indexOf( "SunOS sun4u" ) != -1 ) {
			return "Solaris SPARC";
		} else if ( navigator.platform.indexOf( "SunOS" ) != -1 ) {
			return "Solaris SPARC";
		} else if ( navigator.platform.indexOf( "Mac" ) != -1 && navigator.platform.indexOf( "Intel" ) != -1 ) {
			return "Mac OS Intel";
		} else if ( navigator.platform.indexOf( "Mac" ) != -1 && navigator.platform.indexOf( "PPC" ) != -1 ) {
			return "Mac OS PPC";
		} else if ( navigator.platform.indexOf( "Mac" ) != -1 ) {
			return "Mac OS Intel" ;
		} else if ( navigator.platform.indexOf( "iPad" ) != -1 || navigator.platform.indexOf( "iPhone" ) != -1 ||
			    navigator.platform.indexOf( "iPod" ) != -1 ) {
			// this code will redirect the iPad, iPhone and iPod entries
			return "Mac OS Intel" ;
		} else if ( navigator.platform.indexOf( "Series60" ) != -1 ) {
			// this code will redirect the Series60 entries
			return "Windows" ;
		} else if ( navigator.platform.indexOf( "null" ) != -1 ) {
			return "Windows" ;
		} else {
			// return platform name
			return navigator.platform;
		}
	}
	return "Windows";
}