Hi
I'm working with WAB-Developer Edition 2.22.
I have a WAB-App downloaded and deployed on a server and would like to change the browser-tab-title independet from the WAB-Title.
Rightnow in the config.json the WAB-title is defined as "title": "123456". I would like to set the Browser-Tab-Label as "ABCDEFG" independet from the WAB-Title "123456".
Changing the title to <title>ABCDEFG</title> in the index.html does not work - loading the page will first show the Browser-Tab-Label as "ABCDEFG" but then quickly change the Browser-Tab-Label to "123456". Inspecting the html head with browser-developer-tool showes <title>123456</title>. So I guess the index.html configuration is overwritten by the title set in the config.json ?!
Is there a way to interfere / decouple ?
Solved! Go to Solution.
I also use WAB Developer Edition 2.22
What I did -
In config I added a new item "titleBrowserTab" and set it to the browseer tab title I want,
and in jimu.js/ConfigLoader.js lines 223 to 224 I changed
from:
if(appConfig.title){
document.title = jimuUtils.stripHTML(appConfig.title);
to:
if (appConfig.titleBrowserTab){//mlev_modified. was appConfig.title
document.title = jimuUtils.stripHTML(appConfig.titleBrowserTab);
I also use WAB Developer Edition 2.22
What I did -
In config I added a new item "titleBrowserTab" and set it to the browseer tab title I want,
and in jimu.js/ConfigLoader.js lines 223 to 224 I changed
from:
if(appConfig.title){
document.title = jimuUtils.stripHTML(appConfig.title);
to:
if (appConfig.titleBrowserTab){//mlev_modified. was appConfig.title
document.title = jimuUtils.stripHTML(appConfig.titleBrowserTab);
Many thanks, that's exactly what I was looking for.
Did you add the new item "titleBrowserTab" into the config.json specifically? Can you please provide more details on the proper code structure you inserted in the config? Thank you in advance!
@AndreasEugster thank you so much! This worked out perfectly.
Dear Kara_Lara,
In the config.json there is a line
"title": "ArcGIS Web Application",
What yoy have to do is to add a line (next to it, for example):
"titleBrowserTab": "here you write what you want to be in the browser tab title",