You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Browser Detection

posted on October 18, 2018

We typically develop our forms using Chrome.  As a result, some of our forms have Javascript which doesn't work very well with Internet Explorer or other browsers.  Since our forms server implementation is only available to our internal users, we know that they all have Chrome installed.  Is there a way to check the browser that they are using and display a message telling them to use Chrome without having to code it on every form?  

0 0
replied on October 18, 2018 Show version history

In JavaScript you can use the following:

navigator.userAgent

You can then parse that string to detect which browser they are using. However, you may find the user agent to be very unreliable because the browsers try to add everybody else's name to their user agent string in order to prevent exactly what you are trying to do. It might work for you just fine, though.

 

What follows is just my 2 cents as a web developer.

Honestly, it's generally easier to avoid writing code for a single browser. It means you don't have to play around with these kinds of tricks. It also means that your systems are less fragile if something happens with the browser you are using. For example, I've had issues where something worked fine in last month's Chrome, it stopped working after they did an update, and then it started working again. Even with internals systems where I work, I have three browsers that I switch back and forth with because various vendors didn't consider more than one or two in their development.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.