Browser tab custom title not staying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 06:50 AM
Hi all,
I was trying to set the browser tab title to something other than "ServiceNow" when I have a custom UI page loaded. I followed Re: Dynamic Browser Window Title - Take 2 as well as a few other community posts to try to do this.
Results were that the tab would change the title to my custom one, but once I clicked any other tab, it went back to the default "ServiceNow" title. Any ideas how to override the override?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2017 06:47 AM
Please deactivate that UI script and try with what i have suggested or if it still doesn't work out, Please share the UI script here.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2017 11:17 AM
Toby, I don't think Guarav read what you wrote.
ServiceNow is definitely clobbering the document.title when the tab loses focus to another tab that is looking at the same instance. I haven't found the code that's causing it yet either, so I have opened an incident with ServiceNow.
Nor do I know how to write a script that will execute only when a tab loses focus. Is there an event for that in html?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2017 11:39 AM
Here I've brute forced it so that the custom title is refreshed every 2 seconds:
var custom_title = "whatever";
function set_the_title() {
window.setTimeout(function() {
window.parent.document.title=custom_title;
set_the_title();
},2000);
}
set_the_title();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 10:23 AM
I had a need to change the title of a UI page too. I tried several things including the code above (document.title = "Custom title";), but that did not work either.
I was able to get it to work by putting the following code in the <head> tags:
<script>
top.document.title = "My New Title";
</script>