Skip to content

Commit

Permalink
Fix #1851 - Command/request(s) sent to zombie 'undefined' bug (#1963)
Browse files Browse the repository at this point in the history
* Provided correct context in locationHashChanged() to have data necessary for the nested function calls to act as intended.
  • Loading branch information
jackdwalker authored Sep 18, 2021
1 parent 694df4c commit fe1396c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/admin_ui/media/javascript/ui/panel/PanelViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down

0 comments on commit fe1396c

Please sign in to comment.