1

I'm looking for a way to identify if client browser is IE 11 or any other browser.

Can anyone suggest how can I do this kind of detection?

I'm familiar with $Browser.formFactor global function in Lightning Component, but this does not detect browser type, and only Device type is detected.

2 Answers 2

1

Do not try to detect if a browser is IE 11 or not. Browsers can lie about what they are, usually at the behest of the user. Instead, perform feature detection if you're interested in a particular feature. This is more reliable than determining if a browser is a particular version.

Lightning does not have any means of determining IE 11 versus other browsers for this reason. You can use the $Browser value provider to determine if you're on a Windows, iOS, or Android phone, or if you're running on a phone, tablet, or full-sized device.

2
  • 1
    Feature detection is a good idea, thanks for suggesting it. $Browser was not helpful for me as it's great for device detection but not browsers, and ironically, the global function is named Browser :-)
    – VarunC
    Commented Jul 27, 2017 at 15:09
  • @VarunC Yeah, I think it really should have been something more like $OS or $Device, because that's really what it does.
    – sfdcfox
    Commented Jul 27, 2017 at 15:29
0

There is no standard function to detect the browser. We can detect browser in below ways.

  1. By doing an SOQL in LoginHistory on the landing page.
  2. Writing a login flow and detect the browser.
  3. Write JavaScript to detect browser at the client side. see example here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .