Added beef.browser.hasCors() function
This commit is contained in:
@@ -605,7 +605,7 @@ beef.browser = {
|
||||
* Checks if the Phonegap API is available from the hooked domain.
|
||||
* @return: {Boolean} true or false.
|
||||
*
|
||||
* @example: if(beef.browser.hasJava()) { ... }
|
||||
* @example: if(beef.browser.hasPhonegap()) { ... }
|
||||
*/
|
||||
hasPhonegap: function() {
|
||||
var result = false;
|
||||
@@ -614,6 +614,21 @@ beef.browser = {
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the browser supports CORS
|
||||
* @return: {Boolean} true or false.
|
||||
*
|
||||
* @example: if(beef.browser.hasCors()) { ... }
|
||||
*/
|
||||
hasCors: function() {
|
||||
if ('withCredentials' in new XMLHttpRequest())
|
||||
return true;
|
||||
else if (typeof XDomainRequest !== "undefined")
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the zombie has Java installed and enabled.
|
||||
* @return: {Boolean} true or false.
|
||||
|
||||
Reference in New Issue
Block a user