Newer Version Available
addToBrowserTitleQueue() for Lightning Experience
Adds a string to a list of titles that rotate in the browser title bar every three
seconds.This method works only in
Lightning console apps.
Arguments
| Name | Type | Description |
|---|---|---|
| title | string | The browser tab title to add. |
Sample Code
This component has a button that, when pressed, adds a string to a list of titles that rotate in the browser title bar every three seconds.
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <lightning:workspaceAPI aura:id="workspace" />
3 <lightning:button label="Add to Browser Title Queue" onclick="{! c.addToBrowserTitleQueue }" />
4</aura:component>Controller code:
1({
2 addToBrowserTitleQueue : function(component, event, helper) {
3 var workspaceAPI = component.find("workspace");
4 workspaceAPI.addToBrowserTitleQueue({
5 title: "New Browser Title"
6 })
7 .then(function(result){
8 console.log(result);
9 })
10 .catch(function(error) {
11 console.log(error);
12 });
13 }
14})Response
This method returns a promise that, upon success, resolves
to true.