0

I need to detect the browser type and version from where a Angular app is being accessed. I know there are a few JS libraries out there but don't know which one to use.

The web app is supposed to be supported on the latest editions of Chrome, Safari, Firefox, and Internet Explorer.

I've found this answer but I don't know if is the right way to go, so any advice around this? How I can achieve this?

5
  • Browser detection is a terrible idea. You should check if the browser has the features you desire, not what version it is. For example many "less common" browsers claim to be IE even though they don't have the same feature set as IE. Commented Jul 19, 2015 at 2:03
  • can also use IE conditional comments for IE versions <10 Commented Jul 19, 2015 at 2:08
  • 1
    srfrnk.github.io/ng-device-detector Commented Jul 19, 2015 at 2:09
  • @stdob-- I get that one you mention from here but is not clear to me how to properly shown a message when browser version is less than an specific value, can you provide a little example as a answer? Commented Jul 19, 2015 at 2:14
  • you can start your project with initial setup. I recommend to use modernizr.com to detect your needs Commented Jul 20, 2015 at 13:33

1 Answer 1

1

If browser not support JavaScript then you can not display that message using JavaScript you need to use

<noscript> Message that has to display </noscript>

and you can apply css to it

if support and you want to check version using ng-device-detector is not possible because it only detect device types, OS types and browser name not version. I found this article which may help. If you still wanna use ng-device-detector here is GitHub source and this is plunker.

Sign up to request clarification or add additional context in comments.

1 Comment

Can you provide a integration using the example on the link you leave and Angular side? How that works?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.