There is seems to be bug on Safari 27.2 (22625.2.8.11.9) in combination with MacOS 27.2.1 (26B131) - when clicking a flow tab the editor reloads, making it unusable.
I have asked multiple LLM models to assess where the culprit could be located in the source code, they all seem to hint at the mouse up/down events (this is output from Opus on high reasoning);
Assessment
I traced the complete click path through the source. Here is the conclusion.
The click handler chain
Flow tabs are anchor elements with fragment hrefs, created in packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js:756:
var link = $("<a/>",{href:"#"+tab.id, class:"red-ui-tab-label"}).appendTo(li);
The event bindings (tabs.js:880-885) are the key issue. Activation runs on mouseup, but the anchor's default navigation is only cancelled later, on click:
link.on("mousedown", function(evt) { mousedownTab = evt.currentTarget })
link.on("mouseup", onTabClick) // activation happens here
link.on("auxclick", function(evt) { evt.preventDefault() })
link.on("click", function(evt) { evt.preventDefault(); }) // default cancelled only here
onTabClick → activateTab → options.onchange(tab) → workspaces.js:354:
window.location.hash = 'flow/'+tab.id;
So in a single click gesture the URL is changed programmatically during mouseup, while the anchor's own default fragment navigation (#<tab.id>) is suppressed only afterward in click.
Why this is the suspect
Two fragment destinations are in play for one gesture — the anchor's #<tab.id> and the programmatic #flow/<tab.id> — and the code relies on event ordering (cancel-on-click-after-activate-on-mouseup) to keep it a same-document navigation. That ordering is exactly the kind of behavior a WebKit update can tighten. This matches your symptom and your suspicion about the click handler.
It also explains why it sticks: if the URL ends up as a bare #<tab.id> instead of #flow/<tab.id>, the restore logic in red.js:301 (/^#(flow|node|group)\/.+$/) no longer matches, so on the next load it falls back to RED.workspaces.show(workspaces[0]) (red.js:347-348), which writes the hash again.
its suggestion for a fix;
Suggested source hardening (upstream)
- Cancel the default on mousedown/in onTabClick itself rather than deferring to a later click, so the anchor default can never race activation.
- Replace the location.hash write in workspaces.js:354 and :365 with history.replaceState(history.state, "", '#flow/'+tab.id), which avoids fragment-navigation default-action semantics entirely.
The root cause is the fragile pattern where a flow-tab click updates the URL via window.location.hash inside the mouse gesture. I changed it to use history.replaceState, which updates the URL fragment without any navigation semantics, so WebKit can't treat it as a document load.
What I changed
File: packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js
1. Added a helper (near the top of the module):
function setLocationHash(hash) {
if (window.history && window.history.replaceState) {
window.history.replaceState(window.history.state, "", "#" + hash);
} else {
window.location.hash = hash; // fallback for very old browsers
}
}
2. Replaced the two hash writes in the tab onchange handler:
- window.location.hash = 'flow/'+tab.id; → setLocationHash('flow/'+tab.id);
- window.location.hash = ''; → setLocationHash('');
The existing restore logic in red.js (which reads window.location.hash at load) keeps working, because replaceState still updates the fragment — it just doesn't trigger navigation.