Editor Browser Tab Title

Hi
The change to the editor browser title introduced into Node-RED version 3.1.5 (discussed here Editor Browser Tab Title?) causes me problems when multiple browser tabs are open, each editing flows on different machines.

Now the tab name shows the Node-RED flow name, the only way to know which machine you are editing is to identify it from the browser address bar.

My home automation system includes four Raspberry Pis all of which have at least one common flow (with the same name on each). The change makes it difficult to avoid problems when, for example, copying / pasting code between machines!

Would it be possible to make the tab title configurable?

If I understand what you are referring to, it is possible to change the name in the browser tab header, at least on Linux.
image

On the right is a Raspberry Pi "zero2green" running Node-red 3.1.5, without this tweek.
On the left a Pi "zero2red" on which settings.js and flows.json have a minor change.
Note that Node-red still appends the name of the flow to the browser tab title.
Also the pic above shows the IP address in the tab title too, but I stripped that code out for simplicity.

settings.js:
Insert immediately above Module.exports {

// ----------- added by script ----------
 hostname = require('os').hostname();
 process.env.HOSTNAME = hostname;
// --------------------------------------

And immediately below editorTheme: {

// ----------- added by script ----------
       header: {
          // This is the text next to the Node-red logo on the editor page header
          title: process.env.HOSTNAME
       },
       page: {
          // And this is the text next to the favicon on the browser tab
          title: process.env.HOSTNAME,
       },
// --------------------------------------

To change the browser tab title for the dashboard change flows.json:
Change

 "site": {
            "name": "Node-RED Dashboard",

to

 "site": {
            "name": "${HOSTNAME}",
1 Like

Or you can leave out the bit

// ----------- added by script ----------
 hostname = require('os').hostname();
 process.env.HOSTNAME = hostname;
// --------------------------------------

and in the editor theme use

  page: {
            title: "Whatever text you want",
},

I have implemented jbudd's solution (mainly because I already had an environment variable set to hostname) and it works just fine!

Many thanks to jbudd and Colin for your replies.

Happy again :slightly_smiling_face:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.