You have to take care that you create no endless loops - because a refresh triggers the first node again. So it is useful to filter out the tab which should be refreshed and you need to delete the socket-id.
So i created a flow which refreshes a page "test" when someone switches a tab named test.
[
{
"id": "5ea0c06fa7709de5",
"type": "ui_ui_control",
"z": "54b226bc.0793e8",
"name": "",
"events": "all",
"x": 180,
"y": 3080,
"wires": [
[
"7d9c29f0419c67fe"
]
]
},
{
"id": "12d1e9659b28dc8c",
"type": "ui_ui_control",
"z": "54b226bc.0793e8",
"name": "",
"events": "all",
"x": 860,
"y": 3080,
"wires": [
[]
]
},
{
"id": "a7e09627253fb76a",
"type": "change",
"z": "54b226bc.0793e8",
"name": "Refresh Browser",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"tab\":\"\"}",
"tot": "json"
},
{
"t": "delete",
"p": "socketid",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 510,
"y": 3080,
"wires": [
[
"de960b742c49b829"
]
]
},
{
"id": "7d9c29f0419c67fe",
"type": "switch",
"z": "54b226bc.0793e8",
"name": "",
"property": "name",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "test",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 330,
"y": 3080,
"wires": [
[
"a7e09627253fb76a"
]
]
},
{
"id": "de960b742c49b829",
"type": "trigger",
"z": "54b226bc.0793e8",
"name": "",
"op1": "",
"op2": "",
"op1type": "pay",
"op2type": "nul",
"duration": "5",
"extend": true,
"overrideDelay": false,
"units": "s",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 700,
"y": 3080,
"wires": [
[
"12d1e9659b28dc8c"
]
]
}
]
You have to think if you really just want to refresh a page/tab or if a flow should be triggered again to fill i.e. template nodes again.
So I fill my template nodes each time - my tab is selected again. The change tab event triggerst again the flow to fill the template nodes again - this is not a refresh tab - it is a refresh of the template nodes.