Skip to content

How to make a static web page that suggests the right Electron build to download based on visitor's operating system? #494

Answered by MarshallOfSound
adrienjoly asked this question in Q&A
Discussion options

You must be logged in to vote

You can do this, but ensure that you have a "Need another platform?" button as well in case the detection doesn't work or people are faking their user agents.

The basic strategy is just to sniff out the OS from navigator.userAgent.

See https://stackoverflow.com/questions/9514179/how-to-find-the-operating-system-version-using-javascript

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Comment options

You must be logged in to vote
0 replies

This comment has been hidden.

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #494 on December 10, 2020 14:47.