Open editor at rightmost tab by default

There may be many tabs/flows in a Node-red setup.
When you point a browser at the device:port, the editor opens up with the tab at the left

This tab is probably the oldest and most stable flow[s]. If you want to work on recent flows you have to scroll, scroll, scroll to the right.

Can the editor have a setting (the default) to open at the rightmost tab?

Or even the tab that was open when the editor was closed.

Good observation. Though TBH, if you open on the same browser, you should be presented with the same page you closed Node-RED.

My browsers delete cookies on exit.

We update the url with the id of the tab you're currently on as you navigate around.

One existing solution to this is to bookmark the editor on whatever tab you want it to open next time and it will just work.

OK that's a good suggestion, but of course new tabs are created at the right hand end so every now and then you'd have to update the bookmark.

It would be feasible for the Editor to record the current tab on change in browser storage and move to the appropriate tab on reload. If, that is, someone wanted to submit a PR containing the code changes :grin:

Can you point me to the bit of code on Github that does this please. Probably don't need the line number but the filename would help

1 Like

Not wanting to confused/complicate the situation:

I have quite a few tabs open with NR flows - at the editor level.

They seem to restore to what I was last seeing/using.

Although @jbudd said their browser deletes cookies: Would that matter?

@jbudd thoughts:
Isn't there a way to tell the browser to NOT delete cookies from certain sites?

And to also declare things:
I don't QUIT my browser. I shut down the machine with it loaded/open.

And yes, NOW AND THEN the tabs (node-red side of things) may not be as I remember.
But honestly: > 95% of the time they are as I left them.

1 Like

That's a sensible comment thanks Andrew.

I had not considered that the browser would save the open tabs in a cookie, or that doing so would cause NR to open with the same current editor flow open, simply because it has never run on my machine with cookies retained.

And if you shut down your machine (as opposed to hibernating) and restart in the same place within the editor tabs then NR must be getting the info from somewhere, probably a cookie.

I'll have to experiment when I get back to the PC.

OK some observations:
I turned off Firefox' settings to always browse in a private window and to delete cookies on shutdown, then rebooted.

Next I opened several browser tabs and pointed them to different sites. The middle tab was the Node-red editor on my Pi, pointing to a flow tab somewhere in the middle.

After restarting the computer I ran Firefox and it opened the same tabs as before, with the same tab and the same editor tab having focus.

I guess what I'm saying is Node-red behaves exactly as I think it should. How hateful is that? :partying_face:

Now lets see if I can tune Firefox to throw away everything but the NR cookies...

1 Like

Are the Node-Red tabs on that machine or remote?

(Though even if remote....)

You can control which site's cookies (etc) are (and not) kept/deleted.

If you go to about:preferences#privacy (firefox) There is a manage exceptions bit that allows you to determine which site's stuff is kept/deleted.

That may be of help.

The browser is on a PC, Node-red is on a Raspberry Pi, both on the same LAN.

So far I can't get the Manage exceptions option to work. Not sure if that's because 192.168.1.25:1880 is not considered a valid URL or because I'm using private windows.

Possibly private windows.

Do you need the :1880 at the end though?

Isn't it just the IP address?

Private windows don't store cookies (or anything by default) That's why they are private.
I suspect that is a major cause of the problem.

I just checked my settings.
I don't have any exceptions loaded for my local sites.
But having said that: I don't have the problem you are describing.

I do need :1880, that's the port that Node-red listens on.
It is possible to change it by using a different web server and/or a proxy but I prefer to type :1880 over learning how to do use a proxy. I've always thought I should leave jobs like that to someone else. :crazy_face:

1 Like

It wasn't I was wanting to be argumentative about the port.

I just wasn't sure you needed to qualify it in the setting to tell the browser which IP addresses to not clear the cookies (etc).

Anyway: It is strange that your browser isn't remembering the pages.
Ok, dumb question: (and to re-check what you said) If you do NOT use private browsing does it remember the page/load the previous pages?
Given you do not QUIT the browser and rather restart the computer which the browser running.

It's very difficult to describe the precise behaviour because there are so many variables.
However it seems that with these security and privacy settings:

  • Enhanced tracking protection: Standard
  • Delete cookies and site data when Firefox is closed Yes.
  • Exceptions: 192.168.1.25:1880
  • History: Always use private browsing: No
  • Remember browsing history Yes
  • Clear history when Firefox closes Yes

A restart of FIrefox will reopen the same tabs including on the NR tab, the same editor tab in focus.
If I can't stop it reopening all the tabs I will go back to the previous settings.

Thanks for your help. I think the topic has probably been exhausted as far as the forum goes.

1 Like

No problems.

I don't mind helping. (Though I do not want to boast that I am smart)
I know it is annoying being stuck with a problem and not knowing what to do.
Status quo for me most of the time.

My Enhanced Tracking Protection is custom.
But I am not going to say that really helps me (or you) with this specific problem.

The bigger idea is to share knowledge and help as much as possible.

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