0

I'd like to detect if a lightning component is opened from Chrome browser. I've tried using $A.get('$Browser')but it doesn't provide anything about detecting Chrome. Do you know how i could achieve this? Thanks,

EDIT : It's not about detecting any browser, os or device, it's about detecting when Salesforce1 is actually running on Chrome Mobile Browser or using Web-view specifically.

enter image description here

4
  • Why do you need to know if it's Chrome or not? You should be using feature detection to determine if a specific feature is available. For that matter, modernizr should give you all the details you need if you want advanced feature detection.
    – sfdcfox
    Commented Jul 7, 2019 at 17:06
  • Actually my main goal is to provide a different UX from Salesforce1 web view and any mobile browser (IE, Firefox, Chrome). But i've noticed that an isChrome property was not present from lightning global variable $A.get('$Browser')
    – Bryce
    Commented Jul 7, 2019 at 17:13
  • Check solution in post salesforce.stackexchange.com/questions/240783/… Commented Jul 7, 2019 at 17:44
  • As i mentionned in my question, i've checked $A.get('$Browser') and indeed it enables to detect Firefox, IE but not Chrome specifically. The only information we have is about isAndroid = true but that is not reliable to deduct if the user is actually using Chrome on Mobile or Desktop.
    – Bryce
    Commented Jul 9, 2019 at 14:38

1 Answer 1

0

The $Browser global value provider returns information about the hardware and operating system of the browser accessing the application.

$A.get('$Browser') is used to detect the OS and/or the hardware(Desktop/Mobile/Tablet).

To get the information about the web browser, follow the link

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