# Close only the current tab of Browser (showing the dashboard) from dashboard

**URL:** <https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [31 January 2022 08:31 UTC](https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537 "2022-01-31T08:31:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [31 January 2022 08:31 UTC](https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537/1 "2022-01-31T08:31:56Z")

</div>

Hi,

```auto
[{"id":"e86f1613ede2bc54","type":"exec","z":"d12f70e7abaacb43","command":"TASKKILL /IM msedge.exe /F","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":1540,"y":80,"wires":[["59d076f1d8438796"],["bfab2bcacd99742b"],["a91d06aa99828246"]]}]

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/2647b04f9158b41350b440aa65c0a55ef36ea35c.png)

I am able to CLOSE all the open sessions of MS Edge Browser through EXEC node by using command **TASKKILL /IM msedge.exe /F**  
How can i close only the current TAB from which the Button to run EXEC node was pressed ?

if i guessed correctly, i need to pass the PID number to the EXEC node. So how do i find the correct PID which is running the dashboard?

```auto
SUCCESS: The process "msedge.exe" with PID 3852 has been terminated.
SUCCESS: The process "msedge.exe" with PID 4904 has been terminated.
SUCCESS: The process "msedge.exe" with PID 5640 has been terminated.
SUCCESS: The process "msedge.exe" with PID 3548 has been terminated.
SUCCESS: The process "msedge.exe" with PID 7848 has been terminated.
SUCCESS: The process "msedge.exe" with PID 8676 has been terminated.
SUCCESS: The process "msedge.exe" with PID 9844 has been terminated.
SUCCESS: The process "msedge.exe" with PID 2592 has been terminated.
SUCCESS: The process "msedge.exe" with PID 312 has been terminated.
SUCCESS: The process "msedge.exe" with PID 8200 has been terminated.
SUCCESS: The process "msedge.exe" with PID 832 has been terminated.
SUCCESS: The process "msedge.exe" with PID 6676 has been terminated.

```

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [31 January 2022 08:54 UTC](https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537/2 "2022-01-31T08:54:36Z")

</div>

No, there is no way to determine which process is "running" which tab.

This is a really bad idea anyway. Killing a tab this way is more likely to mess up the whole browser, and even if not it will probably just leave the tab open, with no content.

If you want to close a tab, do it properly by clicking on the cross on the tab

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 January 2022 09:08 UTC](https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537/3 "2022-01-31T09:08:16Z")

</div>

Curious. What are your reasons for wanting to do this?

If you are trying to restrict access to specific sites, then there are better solutions like KIOSK mode or Internet Control software even adding a duff entry in your `hosts` file.

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [31 January 2022 09:15 UTC](https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537/4 "2022-01-31T09:15:49Z")

</div>

I am already running one monitor in Kiosk Mode where the user cannot open any other tabs. (Thanks to you 🙂 , which helped me sometime back)

> [@Don't want Browser to Exit Full Screen when mouse moves over to top](https://discourse.nodered.org/t/dont-want-browser-to-exit-full-screen-when-mouse-moves-over-to-top/53747/2):
>
> Have you tried kiosk mode? [Configure Microsoft Edge kiosk mode | Microsoft Docs](https://docs.microsoft.com/en-us/deployedge/microsoft-edge-configure-kiosk-mode)

.  
This was for another computer where i have setup a batch file to open the dashboard page in fullscreen mode and the person running dashboard cannot find the CLOSE TAB button even by hovering the mouse on top. Ctrl+W does the trick, but i thought it was easy to put a button on dashboard to close the window.

---

<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:** [31 January 2022 10:20 UTC](https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537/5 "2022-01-31T10:20:59Z")

</div>

> [@smanjunath211](#):
>
> i thought it was easy to put a button on dashboard to close the window

If it were that easy, it would rapidly get abused by bad people ☹

You might be able to work around the issue by using a separate browser profile which I think will create a separate executable. If you started that from a script, you may be able to capture the PID that would let you kill it again from Node-RED. Then your Dashboard could have a button that kicks off the kill flow.

---

<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:** [2 March 2022 10:21 UTC](https://discourse.nodered.org/t/close-only-the-current-tab-of-browser-showing-the-dashboard-from-dashboard/57537/6 "2022-03-02T10:21:11Z")

</div>

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