I have a Lightning Component which loads in both Mobile(SF1) and Desktop, is there a way to detect the client(who is requesting Mobile or Desktop) based on the parameter value I need to render some attributes inside the component.

How could I go about this?


  • you can use javascript for this. – Tushar Sharma Dec 2 '15 at 3:40

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

Returns a FormFactor enum value based on the type of hardware the browser is running on.

  1. DESKTOP for a desktop client
  2. PHONE for a phone including a mobile phone with a browser and a smartphone
  3. TABLET for a tablet client (for which isTablet returns true)


    checkBrowser: function(component) {
        var device = $A.get("$Browser.formFactor");
        alert("You are using a " + device);



By using this way you can determine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.