# Open URL question

**URL:** https://discourse.nodered.org/t/open-url-question/98379
**Category:** Dashboard
**Created:** [30 July 2025 06:42 UTC](https://discourse.nodered.org/t/open-url-question/98379 "2025-07-30T06:42:42Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)
#### Post date: [30 July 2025 06:42 UTC](https://discourse.nodered.org/t/open-url-question/98379/1 "2025-07-30T06:42:42Z")

</div>

Hello Good peoples,

I have a small issue opening URL’s

When a user opens a URL or opens for every other user who has the dashboard open.

Is there a way so it only opens for the user that requested it?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 July 2025 07:51 UTC](https://discourse.nodered.org/t/open-url-question/98379/2 "2025-07-30T07:51:36Z")

</div>

What do you mean by opening a URL?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [30 July 2025 09:10 UTC](https://discourse.nodered.org/t/open-url-question/98379/3 "2025-07-30T09:10:33Z")

</div>

> [@leftymuller](#):
>
> dashboard open

Please let us know which Dashboard you are using.

---

<div class="post-metadata">

### Author: ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)
#### Post date: [30 July 2025 12:13 UTC](https://discourse.nodered.org/t/open-url-question/98379/4 "2025-07-30T12:13:12Z")

</div>

Dashboard 1

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [30 July 2025 12:16 UTC](https://discourse.nodered.org/t/open-url-question/98379/5 "2025-07-30T12:16:19Z")

</div>

Thanks, now we need a bit more info on what “opening a URL” means in your setup as Colin has mentioned.

---

<div class="post-metadata">

### Author: ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)
#### Post date: [30 July 2025 12:21 UTC](https://discourse.nodered.org/t/open-url-question/98379/6 "2025-07-30T12:21:44Z")

</div>

Get the users browser to open a http address

I have that part working but it opens on all users browsers not just on the user that requested it.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [30 July 2025 12:25 UTC](https://discourse.nodered.org/t/open-url-question/98379/7 "2025-07-30T12:25:14Z")

</div>

You aren’t giving us much to go on.

Assuming that you use something on the Dashboard to trigger a flow that instructs the browser to move to the new URL? If so, you need to remember to include the socket id from the original requesting client.

If you don’t include the socket id from the original Dashboard input, the response goes to all connected clients.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 July 2025 12:26 UTC](https://discourse.nodered.org/t/open-url-question/98379/8 "2025-07-30T12:26:19Z")

</div>

> [@leftymuller](#):
>
> Get the users browser to open a http address

How are you doing that? Are you opening it in an iframe in the dashboard for example?

---

<div class="post-metadata">

### Author: ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)
#### Post date: [30 July 2025 12:44 UTC](https://discourse.nodered.org/t/open-url-question/98379/9 "2025-07-30T12:44:12Z")

</div>

```json
[
    {
        "id": "e1dcfd268ac5f6bb",
        "type": "ui_button",
        "z": "1d021220734c735f",
        "name": "",
        "group": "bea2c1075a7d3a65",
        "order": 8,
        "width": 5,
        "height": 1,
        "passthru": false,
        "label": "Open",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "fa-folder-open",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 2760,
        "y": 1960,
        "wires": [
            [
                "bbd1715522a68721"
            ]
        ]
    },
    {
        "id": "390912bdad30b310",
        "type": "ui_template",
        "z": "1d021220734c735f",
        "group": "bea2c1075a7d3a65",
        "name": "window redirect",
        "order": 7,
        "width": 1,
        "height": 1,
        "format": "<script>\n (function(scope) {\n scope.$watch('msg', function(msg) {\n if (msg && msg.url) {\n window.open(msg.url, '_blank');\n }\n });\n })(scope);\n</script>",
        "storeOutMessages": false,
        "fwdInMessages": true,
        "resendOnRefresh": false,
        "templateScope": "local",
        "className": "",
        "x": 3340,
        "y": 1960,
        "wires": [
            []
        ]
    },
    {
        "id": "bbd1715522a68721",
        "type": "function",
        "z": "1d021220734c735f",
        "name": "test",
        "func": "msg.url = \"https://google.com",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 3040,
        "y": 1960,
        "wires": [
            [
                "390912bdad30b310"
            ]
        ]
    },
    {
        "id": "bea2c1075a7d3a65",
        "type": "ui_group",
        "name": "test",
        "tab": "58c2aa06.ef46e4",
        "order": 4,
        "disp": false,
        "width": 25,
        "collapse": false,
        "className": ""
    },
    {
        "id": "58c2aa06.ef46e4",
        "type": "ui_tab",
        "name": "test",
        "icon": "fa-umbrella",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

### Author: ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)
#### Post date: [30 July 2025 12:49 UTC](https://discourse.nodered.org/t/open-url-question/98379/10 "2025-07-30T12:49:35Z")

</div>

arr yes.. helpful information..

I will try some code and see how i go

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 July 2025 14:09 UTC](https://discourse.nodered.org/t/open-url-question/98379/11 "2025-07-30T14:09:11Z")

</div>

Your function node seems not to have a `return msg` so it will not pass anything on.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [30 July 2025 14:44 UTC](https://discourse.nodered.org/t/open-url-question/98379/12 "2025-07-30T14:44:37Z")

</div>

Corrected your example flow and it works for me, opening a window in only the browser where button is clicked. As @TotallyInformation has pointed out it must be that your flow is removing the socketid

Corrected and working example

```auto
[{"id":"e1dcfd268ac5f6bb","type":"ui_button","z":"d1395164b4eec73e","name":"","group":"bea2c1075a7d3a65","order":8,"width":5,"height":1,"passthru":false,"label":"Open","tooltip":"","color":"","bgcolor":"","className":"","icon":"fa-folder-open","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":90,"y":1900,"wires":[["bbd1715522a68721"]]},{"id":"bbd1715522a68721","type":"function","z":"d1395164b4eec73e","name":"test","func":"msg.url = \"https://google.com\"\nreturn msg","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":1900,"wires":[["390912bdad30b310"]]},{"id":"390912bdad30b310","type":"ui_template","z":"d1395164b4eec73e","group":"bea2c1075a7d3a65","name":"window redirect","order":7,"width":1,"height":1,"format":"<script>\n (function(scope) {\n scope.$watch('msg', function(msg) {\n if (msg && msg.url) {\n window.open(msg.url, '_blank');\n }\n });\n })(scope);\n</script>","storeOutMessages":false,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","className":"","x":400,"y":1900,"wires":[[]]},{"id":"bea2c1075a7d3a65","type":"ui_group","name":"test","tab":"58c2aa06.ef46e4","order":4,"disp":false,"width":25,"collapse":false,"className":""},{"id":"58c2aa06.ef46e4","type":"ui_tab","name":"test","icon":"fa-umbrella","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [30 July 2025 15:04 UTC](https://discourse.nodered.org/t/open-url-question/98379/13 "2025-07-30T15:04:25Z")

</div>

Of course, you don’t actually need a flow at all for this. Simply get the browser to change location itself - no need for a round-trip to Node-RED and back. Then you wouldn’t have a problem with other users being triggered.

```javascript
document.location.href = newUrl;

```

Is all you need

---

<div class="post-metadata">

### Author: ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)
#### Post date: [31 July 2025 02:49 UTC](https://discourse.nodered.org/t/open-url-question/98379/14 "2025-07-31T02:49:18Z")

</div>

Thanks Gents.

All Sorted.. As usual when you come to this forum 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [14 August 2025 02:50 UTC](https://discourse.nodered.org/t/open-url-question/98379/15 "2025-08-14T02:50:12Z")

</div>

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