Newer Version Available

This content describes an older version of this product. View Latest

isConsoleNavigation() for Lightning Experience

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

Arguments

None.

Sample Code

This component has a button that, when pressed, prints whether the current app is using console navigation.

Component code:

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

Controller code:

1({
2    isConsoleNavigation : function(component, event, helper) {
3        var workspaceAPI = component.find("workspace");
4        workspaceAPI.isConsoleNavigation().then(function(response) {
5            console.log(response);
6        })
7        .catch(function(error) {
8            console.log(error);
9        });
10    }
11})

Response

This method returns a promise that, upon success, resolves to true if the current app uses console navigation, and false otherwise.