Setting App name in Browser Tab

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Setting App name in Browser Tab

Post by customaware »

In Aware, once you get past the login page.....
The Business Space name is displayed in the main Browser Tab.

I expected to be able to change this to, say, MY_APP_NAME by adding <title>MY_APP_NAME</title> to both the Landing page and startup.html

Landing page works fine until you log in.

And initially works in startup.html but as soon as the app opens properly... it is changed to the Business Space name...

Any ideas where this is being changed by Aware?
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Setting App name in Browser Tab

Post by hpl123 »

I have written up a guide on this somewhere but can´t find it. The problem is as you have noticed that Aware changes the title/tab name after fully loading the app and/so what you need to do is fiddle with render scripts in VP´s and can´t remember where I placed it and can be anywhere really, the thing is it has to be AFTER the app is fully loaded. You can use JS setTimeout and setInterval as well to get it to execute the JS after x period of time. Not sure if the title/tab name is changed back to default when loading layouts and things like that, in that case you need to repeatedly change it via document.title.

This solution is a hack and I would also want to be able to set it in the Aware config tool or code instead so it´s always set to what we configured (same thing/problem with favicon).
Henrik (V8 Developer Ed. - Windows)
johntalbott
Posts: 619
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, Nebraska
Contact:

Re: Setting App name in Browser Tab

Post by johntalbott »

This code will handle setting the favicon and title. You can put it in a js file, such as favicon.js.

Code: Select all

(function() {
    
    const link = document.createElement('link');
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    link.href = 'Custom/CSS/MY_APP_NAME/favicon.ico';
    document.getElementsByTagName('head')[0].appendChild(link);

    setTimeout(function () {
        document.title = "MY_APP_NAME"; 
    },0);

})();
VocalDay Solutions - Agility - Predictability - Quality

We specialize in enabling business through the innovative use of technology.

AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Setting App name in Browser Tab

Post by customaware »

Thanx John.

Perfect.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
gernotlg
Posts: 80
Joined: Fri Aug 27, 2021 1:24 am

Re: Setting App name in Browser Tab

Post by gernotlg »

johntalbott wrote: Fri Mar 20, 2020 4:54 pm This code will handle setting the favicon and title. You can put it in a js file, such as favicon.js.

Code: Select all

(function() {
    
    const link = document.createElement('link');
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    link.href = 'Custom/CSS/MY_APP_NAME/favicon.ico';
    document.getElementsByTagName('head')[0].appendChild(link);

    setTimeout(function () {
        document.title = "MY_APP_NAME"; 
    },0);

})();
So... where does this favicon.js file get put, and where do we tell it to go looking for it ?
and.. what about multi-tenant application, where different tenant has a different name & icon. ?
V8.8 / Windows / MySQL
syndeo
Posts: 10
Joined: Mon Jun 07, 2021 1:43 am

Re: Setting App name in Browser Tab

Post by syndeo »

Post Reply