From 5523ed0b03cfe706e4bbaaee7135da318215fb54 Mon Sep 17 00:00:00 2001 From: Wang Xuerui Date: Sat, 17 Dec 2016 15:13:35 +0800 Subject: [PATCH 1/3] www: detect MIPS hosts --- www/rustup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/rustup.js b/www/rustup.js index 2b42542556..bfabac0857 100644 --- a/www/rustup.js +++ b/www/rustup.js @@ -16,6 +16,8 @@ function detect_platform() { if (navigator.platform == "Linux armv6l") {os = "unix";} if (navigator.platform == "Linux armv7l") {os = "unix";} if (navigator.platform == "Linux ppc64") {os = "unix";} + if (navigator.platform == "Linux mips") {os = "unix";} + if (navigator.platform == "Linux mips64") {os = "unix";} if (navigator.platform == "Mac") {os = "unix";} if (navigator.platform == "Win32") {os = "win";} if (navigator.platform == "FreeBSD x86_64") {os = "unix";} From 87267e3c0121bbe35cebab472a8a5181fed3f411 Mon Sep 17 00:00:00 2001 From: Wang Xuerui Date: Tue, 27 Dec 2016 21:54:02 +0800 Subject: [PATCH 2/3] www: refactor out Android detection --- www/rustup.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/www/rustup.js b/www/rustup.js index bfabac0857..f611f438ce 100644 --- a/www/rustup.js +++ b/www/rustup.js @@ -1,5 +1,9 @@ var platform_override = null; +function android_or_unix() { + return (navigator.appVersion.indexOf("Android") != -1) ? "android" : "unix"; +} + function detect_platform() { "use strict"; @@ -14,7 +18,7 @@ function detect_platform() { if (navigator.platform == "Linux i686 on x86_64") {os = "unix";} if (navigator.platform == "Linux aarch64") {os = "unix";} if (navigator.platform == "Linux armv6l") {os = "unix";} - if (navigator.platform == "Linux armv7l") {os = "unix";} + if (navigator.platform == "Linux armv7l") {os = android_or_unix();} if (navigator.platform == "Linux ppc64") {os = "unix";} if (navigator.platform == "Linux mips") {os = "unix";} if (navigator.platform == "Linux mips64") {os = "unix";} @@ -25,11 +29,6 @@ function detect_platform() { if (navigator.platform == "NetBSD x86_64") {os = "unix";} if (navigator.platform == "NetBSD amd64") {os = "unix";} - if (navigator.platform == "Linux armv7l" - && navigator.appVersion.indexOf("Android") != -1 ) { - os = "android"; - } - // I wish I knew by now, but I don't. Try harder. if (os == "unknown") { if (navigator.appVersion.indexOf("Win")!=-1) {os = "win";} From fb32b454df9eddceee648f39044bc8535d426009 Mon Sep 17 00:00:00 2001 From: Wang Xuerui Date: Tue, 27 Dec 2016 21:57:37 +0800 Subject: [PATCH 3/3] www: turn on Android detection for all Rust-supported targets --- www/rustup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/rustup.js b/www/rustup.js index f611f438ce..46450c2897 100644 --- a/www/rustup.js +++ b/www/rustup.js @@ -14,10 +14,10 @@ function detect_platform() { var os = "unknown"; if (navigator.platform == "Linux x86_64") {os = "unix";} - if (navigator.platform == "Linux i686") {os = "unix";} + if (navigator.platform == "Linux i686") {os = android_or_unix();} if (navigator.platform == "Linux i686 on x86_64") {os = "unix";} - if (navigator.platform == "Linux aarch64") {os = "unix";} - if (navigator.platform == "Linux armv6l") {os = "unix";} + if (navigator.platform == "Linux aarch64") {os = android_or_unix();} + if (navigator.platform == "Linux armv6l") {os = android_or_unix();} if (navigator.platform == "Linux armv7l") {os = android_or_unix();} if (navigator.platform == "Linux ppc64") {os = "unix";} if (navigator.platform == "Linux mips") {os = "unix";}