0

Hello this is my first time asking a question. I am very new to Javascript and would like to know if it is possible to open a site in a new tab and then change the title of that tab. The company I work for supports phone systems that are accessible through a web management console. I got tired of looking up the URL, username, and password for each phone system whenever a client called so I consolidated all of it into a web page with links to the individual phone systems that open in new tabs. That works great but the new tabs all have the same title. I always go to the new tab and change the title to whichever client that phone system belongs to using document.title = "";, but I want to share this page with some of my co-workers and I don't want to have to teach them all how to change the title of a web page. I would prefer to have a script that runs on the new tab after it loads that will change the title. Is this even possible to do, and if so how?

  • Or this? https://stackoverflow.com/questions/27846474/how-to-set-the-title-for-the-new-browser-tab/27847006 – Nico Haase Mar 03 '21 at 16:51
  • If you have control over the markup of the page that opens in the new tab, then you can just add a script to it. But I am guessing you do not; so I cannot see a way here. Maybe there is a title parameter you can pass in or something. You can change your links to buttons that add the title parameters before opening the tabs... – Seyi Shoboyejo Mar 03 '21 at 17:13
  • @NicoHaase I tried something similar to what is described in that second link you sent and it didn't work for me. Presumably because it is a different domain. The page security wouldn't allow me to run a script on the page. But the document.title mentioned in the first link is how I normally change it for myself and was hoping I could pass that along to the new page in the new tab. Thanks for your reply. There is good information in both of those posts. – Mike Angel Mar 03 '21 at 18:30
  • @SeyiShoboyejo The management consoles for the phone servers are just pages that are hosted by a webserver that gets installed when we install the phone system software. So there are servers that I do have access to and one those I can just edit the title tag in the index.html. For the servers that are hosted in the cloud passing the title parameter like you suggested would be what I want to do. I just haven't found a way to do it yet. Thank you for your reply. – Mike Angel Mar 03 '21 at 18:39
  • A lot depends on the endpoint that served the pages. If they are just static files then there should be js in them to read the title from the url path or get parameters. Then you just need to use a button or link click handler to prepare the links to contain the title along with everything else they contain. If the server is dynamic it is generally the same thing for you but there are more options for the other side to process the title you pass in with the links... – Seyi Shoboyejo Mar 03 '21 at 19:04

0 Answers0