I know this is bad practice and feature recognition should be the way to go in terms of building the website. However that is not my use case.
I have different distributions of my browser extension and I would like to change the download button based on their current browser.
I've tried using navigator.userAgent
, that has proven to be quite useless as most browsers have set all popular user agents. For example chrome has this.
navigator.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36"
I've seen many websites have this feature on their download buttons. How is this done properly?
EDIT: I've now learned the history of why "Mozzila/X.X" is at the start of the userAgent string. Apologies for the misunderstanding.