0

Is it possible to identify whether loggedIn user is viewing lightning component in console or not? In classic, we have isConsole() method, do we have similar method in lightning?

1 Answer 1

3

You can try isConsoleNavigation() for Lightning Experience.

isConsoleNavigation() Determines whether the app it’s used within uses console navigation.

Markup:

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <lightning:workspaceAPI aura:id="workspace" />
    <lightning:button label="Is Console Navigation?" onclick="{! c.isConsoleNavigation }" />
</aura:component>

JS:

({
    isConsoleNavigation : function(component, event, helper) {
        var workspaceAPI = component.find("workspace");
        workspaceAPI.isConsoleNavigation().then(function(response) {
            console.log(response);
        })
        .catch(function(error) {
            console.log(error);
        });
    }
})

Src: https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lightning_isConsoleNavigation.htm

You must log in to answer this question.

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