I have a LWC that runs inside a custom SF tab, I want to know how to change the browser tab name ?
I only managed to find this answer but it is for aura.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityI have a LWC that runs inside a custom SF tab, I want to know how to change the browser tab name ?
I only managed to find this answer but it is for aura.
document.title
still works fine, the issue is it gets overriden by the record name if the lwc component is on a record page, rest for an app page it works fine.
So you can try giving it a timeout if its a record page.
connectedCallback() {
setTimeout(function (){
document.title = 'Test Me Please';
},10000);
}
Or just try by removing the settimout if its a app page:
connectedCallback() {
document.title = 'Test Me Please';
}
es-lint
plugin which gives a warning. Though from LWC its not restricted, though for above scenario as its a custom app, I think there is not need of setTimeout
Nov 23, 2020 at 14:42