getTabInfo() for Lightning Experience
Returns information about the specified tab. This method works only in Lightning console apps.
The method provides the same argument for both Aura Components and Lightning Web Components (LWC).
| Name | Type | Description |
|---|---|---|
tabId | string | ID of the tab for which to retrieve the information. |
This component has a function that returns the tab information.
To make your component available for use in a Lightning console app, specify the lightning__AppPage target in the component’s configuration file.
This component has a button that, when pressed, opens a tab and uses the getTabInfo() method to print the new tab’s tabInfo to the developer console.
Component code:
Controller code:
The relative URL used in this example is a placeholder. To try this example yourself, use a relative URL with a record ID from your org.
This method returns a promise that, upon success, resolves to a tabInfo object representing the specified tab. A tabInfo object is a JSON array of information about a workspace tab, with nested arrays of information on each subtab. This is the structure of a tabInfo object.