You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected to see that "Download" button has a filename for Linux.
What did you see instead?
JS incorrectly defines OS as a "Unix" system and because of that user sees an empty button (there's no filename for unix golang binary to download) that redirects him to https://golang.org/dl/ if user clicks it.
How it happens:
navigator.appVersion = 5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36 Chrome 85.0.4183.102
JS correctly defines OS as a Linux, but because there is no return it continues executing and gets overwritten when next if statement indexes "X11".
navigator.appVersion = "5.0 (X11)" Firefox 80.0.1
Doesn't have a word "Linux" in it and defines system as "Unix" as it includes "X11".
The text was updated successfully, but these errors were encountered:
Updated "detectOS" function to use "userAgent" instead of "appVersion".
It has more info and using that it can be correctly detected that the
user uses Firefox on Linux. Users who want to be incognito can modify
these values in their browsers, so there is no workaround for such rare
cases. Added "else if" statements to prevent overwriting the variable.
Also, added a check that prevents to use "click" on "null" elements (in
case if OS haven't been detected or an element doesn't exist in DOM).
Fixesgolang/go#41537Fixesgolang/go#41528
Change-Id: Iab94801008eddc17c039d49c19c98bef7641afeb
GitHub-Last-Rev: 6b891e9757ec61cd8107f53669f8ed1c0b807294
GitHub-Pull-Request: golang/website#17
Reviewed-on: https://go-review.googlesource.com/c/website/+/256318
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Steve Traut <[email protected]>
Run-TryBot: Dmitri Shuralyov <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Trust: Dmitri Shuralyov <[email protected]>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What did you do?
Opened golang.org/doc/install in different browsers using Linux OS.
What did you expect to see?
Expected to see that "Download" button has a filename for Linux.
What did you see instead?
JS incorrectly defines OS as a "Unix" system and because of that user sees an empty button (there's no filename for unix golang binary to download) that redirects him to https://golang.org/dl/ if user clicks it.
How it happens:
navigator.appVersion = 5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36
Chrome 85.0.4183.102JS correctly defines OS as a Linux, but because there is no
return
it continues executing and gets overwritten when nextif
statement indexes "X11".navigator.appVersion = "5.0 (X11)"
Firefox 80.0.1Doesn't have a word "Linux" in it and defines system as "Unix" as it includes "X11".
The text was updated successfully, but these errors were encountered: