Newer Version Available
isConsoleNavigation() for Lightning Experience
Determines whether the app it’s used within uses console navigation. This method
isn’t supported for Lightning Web Components (LWC).
To determine if a component is using console navigation with LWC, see IsConsoleNavigation context wire adapter.
Arguments
None.
Aura Components 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.handleIsConsoleNavigation }" />
4</aura:component>Controller code:
1({
2 handleIsConsoleNavigation : 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
If the current app uses console navigation, this method returns a promise that resolves to true when successful, or false otherwise.