Closed Bug 1149421 Opened 11 years ago Closed 9 years ago

Aptana download page fails to recognise OS or download software

Categories

(Web Compatibility :: Site Reports, defect)

x86
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: akayanni, Unassigned)

References

()

Details

(Whiteboard: [js])

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:40.0) Gecko/20100101 Firefox/40.0 Build ID: 20150330114816 Steps to reproduce: Win 8.1 64 got to http://www.aptana.com Hit link to download Actual results: Recognised win 8.1 as Mac OSX When "Looking for a different OS, download format, or architecture?" is used to get correct version you are directed to http://www.aptana.com/products/studio3/null And get nothing Expected results: Works correctly in Chrome
Unfortunately this looks a problem with user-agent detection at Aptana's end, not ours. You can contact them at info@aptana.com, and I'll move this bug to our Tech Evangelism category.
Component: Untriaged → Desktop
Product: Firefox → Tech Evangelism
Version: 40 Branch → unspecified
Email sent as per above
Looks like a Firefox issue to me. The page works correctly in the current release version of Firefox. Anyways I sent the email to them before I checked this.
Looks like something in this JavaScript code can't handle a Firefox 40 UA string..? setCurrentScenario: function () { currentScenario = this.generateScenario(); var foundScenario = null; for (var key in studioScenarios) { var targetScenario = studioScenarios[key]; if (this.matchScenarioKey(targetScenario["studio_version"], currentScenario["studio_version"]) && this.matchScenarioKey(targetScenario["studio_versiontype"], currentScenario["studio_versiontype"]) && this.matchScenarioKey(targetScenario["studio_system"], currentScenario["studio_system"]) && this.matchScenarioKey(targetScenario["studio_arch"], currentScenario["studio_arch"])) { foundScenario = targetScenario; //Set the download labels $(".aptana-download-requirements").html( foundScenario.systemRequirements ); $(".aptana-download-system").html( foundScenario.studio_system_human ); $(".aptana-download-version").html( foundScenario.studio_version ); $(".aptana-download-architecture").html( foundScenario.studio_architecture_human ); $("input[name=download_url]").val( foundScenario.downloadUrl ); $(".submit-aptana-download-form").attr('href', foundScenario.downloadUrl); Hm, it's even simpler: it can't handle any Windows browser UA string if it contains 'x64' - period. All downloads for Windows are described as "x86" behind the scenes with an additional human-readable description string saying "(x64 compatible)" that is ignored by the code. However, their "is this a 64-bit system?" code has a very convenient bug that means they do not actually detect common tokens like "WOW64": they first lower-case the UA string, then do indexOf() with upper-case strings: var userAgent = navigator.userAgent.toLowerCase(); var is_x64 = userAgent.indexOf("x86_64") >= 0 || userAgent.indexOf("x64") >= 0 || userAgent.indexOf("WOW64") >= 0 || userAgent.indexOf("Win64") >= 0; $('input[name=studio_arch]').each(function(i){ if (this.value == (is_x64 ? "x64" : "x86")) { this.checked = true; } }); So many browsers on 64bit systems won't be detected as running on 64bit systems, and thus they will be offered the expected Win32 (64-bit compatible) download. The code even concludes with a // FIXME: what do we do if no matching scenario is found? Well - the answer to the coder's question is that the JS doesn't set the form's values at all, and it happens to end up with the default Mac 64bit option.
Copied to Aptana page in Stackoverflow
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [js] [contactready]
This appears to be fixed. Tested in Firefox 51 on Windows 10. The user agent detection provides the right OS for the download. Also "Looking for a different OS" seems to work as expected. Closing this issue.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [js] [contactready] → [js]
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.