From fe1396cc813860fc9a807fa4c3e1b0df3ea140d8 Mon Sep 17 00:00:00 2001 From: Jack Walker <46417690+jackdwalker@users.noreply.github.com> Date: Sat, 18 Sep 2021 13:36:25 +1000 Subject: [PATCH] Fix #1851 - Command/request(s) sent to zombie 'undefined' bug (#1963) * Provided correct context in locationHashChanged() to have data necessary for the nested function calls to act as intended. --- extensions/admin_ui/media/javascript/ui/panel/PanelViewer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/admin_ui/media/javascript/ui/panel/PanelViewer.js b/extensions/admin_ui/media/javascript/ui/panel/PanelViewer.js index d6bdbfcf6f..1c192f0b9c 100644 --- a/extensions/admin_ui/media/javascript/ui/panel/PanelViewer.js +++ b/extensions/admin_ui/media/javascript/ui/panel/PanelViewer.js @@ -91,11 +91,13 @@ function locationHashChanged() { if (id === null) return; + var zombie = Object.values(beefwui.hooked_browsers).find(hb => hb.session === id); + id = id.replace(/[^a-z0-9]/gi, ''); console.log("Loading hooked browser with ID: " + id); mainPanel.remove(mainPanel.getComponent('current-browser')); if(!mainPanel.getComponent('current-browser')) { - mainPanel.add(new ZombieTab({session: id})); + mainPanel.add(new ZombieTab(zombie)); } mainPanel.activate(mainPanel.getComponent('current-browser'));