function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pu 7pu 7 

how to identify in lightning component tha user is in lightning mode or classic view.

Hi,

I'm creating a lighting componet that I will use this component on Vf page in classic and in lightning. I'm creating links that should work as per the view.

How can I identify in lightning component tha user is in lightning mode or classic view.?
Heather ThompsonHeather Thompson
You can check out Bob Buzzard's blog (http://bobbuzzard.blogspot.com/2015/11/context-is-everything.html)on this. The important part is this:
Salesforce1

    isLightning() && isMobile()
 
Lightning Experience (LightingX)

    isLightning() && (!isMobile())
 
Visualforce inside Salesforce1/LightningX

    (!isLightning()) && hasSforceOne()
 
Visualforce in Salesforce Classic

    (!isLightning()) && (!hasSforceOne())