fix download redirects for Android users (#1055)

This commit is contained in:
Myeongjin
2025-04-17 01:29:16 +09:00
committed by GitHub
parent dccc7f3c6b
commit ae551f0184
3 changed files with 12 additions and 6 deletions

View File

@@ -113,6 +113,8 @@ description: "The requested resource is not available on the server."
let link_platform = 'windows';
if (navigator.platform.indexOf('Mac') !== -1) {
link_platform = 'macos';
} else if (navigator.userAgent.indexOf('Android') !== -1) {
link_platform = 'android';
} else if (navigator.platform.indexOf('Linux') !== -1) {
link_platform = 'linux';
}

View File

@@ -17,9 +17,11 @@ redirect_from:
<script type="text/javascript">
if (navigator.platform.indexOf('Mac') !== -1) {
window.location = "/download/macos";
window.location = "/download/macos/";
} else if (navigator.userAgent.indexOf('Android') !== -1) {
window.location = "/download/android/";
} else if (navigator.platform.indexOf('Linux') !== -1) {
window.location = "/download/linux";
window.location = "/download/linux/";
} else { // default to windows
window.location = "/download/windows/";
}

View File

@@ -8,16 +8,18 @@ layout: default
<div style="padding: 16px 32px">
<h3>Redirecting...</h3>
<p>
If you are not being redirected automatically, <a href="/download/3.x/windows" class="set-os-download-url" data-version="3">click here</a>.
If you are not being redirected automatically, <a href="/download/3.x/windows/" class="set-os-download-url" data-version="3">click here</a>.
</p>
</div>
<script type="text/javascript">
if (navigator.platform.indexOf('Mac') !== -1) {
window.location = "/download/3.x/macos";
window.location = "/download/3.x/macos/";
} else if (navigator.userAgent.indexOf('Android') !== -1) {
window.location = "/download/3.x/android/";
} else if (navigator.platform.indexOf('Linux') !== -1) {
window.location = "/download/3.x/linux";
window.location = "/download/3.x/linux/";
} else { // default to windows
window.location = "/download/3.x/windows";
window.location = "/download/3.x/windows/";
}
</script>