Skip to content

Instantly share code, notes, and snippets.

@hooftly
Last active November 23, 2023 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hooftly/550af4783e30d808a17dcb8f89bfd371 to your computer and use it in GitHub Desktop.
Save hooftly/550af4783e30d808a17dcb8f89bfd371 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script>
function getMobileOperatingSystem() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
// Windows Phone must come first because its UA also contains "Android"
if (/windows phone/i.test(userAgent)) {
return "Windows Phone";
}
if (/android/i.test(userAgent)) {
return "Android";
}
// iOS detection from: http://stackoverflow.com/a/9039885/177710
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "iOS";
}
return "unknown";
}</script>
<script>
function DetectAndServe(){
let os = getMobileOperatingSystem();
if (os == "Android") {
window.location.href = "https://play.google.com/store/apps/details?id=network.fundamenta.mobile";
} else if (os == "iOS") {
window.location.href = "https://apps.apple.com/au/app/fundamenta-mobile/id1613465164";
} else {
window.location.href = "http://fundamenta.network";
}
}
</script>
</head>
<body onload="DetectAndServe()">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment