Skip to content

x/website: download.js incorrectly defines browser OS #41537

@ipriver

Description

@ipriver

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.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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions