Custom browser tab title

Contains tips for configurators working with Aware IM
Post Reply
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Custom browser tab title

Post by hpl123 »

Hi all,
Here is a tip on how to set a custom title in the browser window/tab (i.e. where you´re app name is displayed. This fix, changes the app name to something else). I have tested it on the latest versions of Chrome, Firefox and IE and it works on all browsers.

1. Create file "appname.js" in folder "C:\AwareIM\Tomcat\webapps\AwareIM\aware_ext".

2. Add the following to the appname.js file where the document.title is your new app name:
function Func1()
{
document.title = "New app name";
}
function Func1Delay()
{
setTimeout("Func1()", 500);
}

Func1Delay()

3. Add the following without the brackets (;aware_ext/appname.js) AFTER the theme you are using in file "themes.props" in folder "C:\AwareIM\bin\" (this can be added to all themes I guess i.e. you can add it to the "Blue" theme if you want to or you can create your own theme (MyTheme) and add it to the "MyTheme" theme. Here is an example using "MyTheme":
ThemeMyTheme=MyTheme;ext-4.1.0/resources/css/ext-all.css;aware_ext/appname.js

4. Restart AwareIM server.

5. Reload your browser / log in to your application and now when your theme is loaded so is your custom title for that theme.

Notes:
The fix above works setting the page title after a delay (just using document.title doesn´t work because the newly set title gets changed back to the BS name title again so a delay is needed. Having the timeout as
500 (as above) seems to work and the delay is enough to work and enough so the user doesn't see the change (in some cases the user briefly sees the old title but it´s barely noticeable).

Additional info:
http://www.javascripter.net/faq/windowti.htm
http://stackoverflow.com/questions/4134 ... ages-title
http://www.geekpedia.com/KB55_How-do-I- ... elay).html
http://www.w3schools.com/jsref/met_win_settimeout.asp
Henrik (V8 Developer Ed. - Windows)
himanshu
Posts: 722
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Custom browser tab title

Post by himanshu »

There is one more way to fix title of app. Please check the attachment.
Attachments
Visual Perspectives Screenshot
Visual Perspectives Screenshot
AIM_2016-10-12_13-31-11.png (65.5 KiB) Viewed 14701 times
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Custom browser tab title

Post by tford »

I'm only seeing a screen shot attachment .. not the code to make it work.
Tom - V8.8 build 3137 - MySql / PostGres
himanshu
Posts: 722
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Custom browser tab title

Post by himanshu »

Code: Select all

document.title = "Hello World";
It is there inside the screenshot "Render Script" Box, Sorry not pointing to that.

I hope you find this time....
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Custom browser tab title

Post by tford »

Great tip Himanshu!

If you switch VPs during a user session, does this render script need to be in each new VP that is displayed?
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Custom browser tab title

Post by hpl123 »

Nice Himanshu :)
Henrik (V8 Developer Ed. - Windows)
himanshu
Posts: 722
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Custom browser tab title

Post by himanshu »

If you switch VPs during a user session, does this render script need to be in each new VP that is displayed?
Yes, Tom
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Post Reply