Added detection for Firefox 22 (and improved detection of FF 21/22 with a new DOM object).

This commit is contained in:
antisnatchor
2013-07-01 17:32:00 +01:00
parent f869d2924a
commit 7f1473ccbf

View File

@@ -257,7 +257,15 @@ beef.browser = {
* @example: beef.browser.isFF21()
*/
isFF21:function () {
return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && window.navigator.userAgent.match(/Firefox\/21\./) != null;
return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/21\./) != null;
},
/**
* Returns true if FF22
* @example: beef.browser.isFF21()
*/
isFF22:function () {
return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/22\./) != null;
},
/**
@@ -265,7 +273,7 @@ beef.browser = {
* @example: beef.browser.isFF()
*/
isFF:function () {
return this.isFF2() || this.isFF3() || this.isFF3_5() || this.isFF3_6() || this.isFF4() || this.isFF5() || this.isFF6() || this.isFF7() || this.isFF8() || this.isFF9() || this.isFF10() || this.isFF11() || this.isFF12() || this.isFF13() || this.isFF14() || this.isFF15() || this.isFF16() || this.isFF17() || this.isFF18() || this.isFF19() || this.isFF20() || this.isFF21();
return this.isFF2() || this.isFF3() || this.isFF3_5() || this.isFF3_6() || this.isFF4() || this.isFF5() || this.isFF6() || this.isFF7() || this.isFF8() || this.isFF9() || this.isFF10() || this.isFF11() || this.isFF12() || this.isFF13() || this.isFF14() || this.isFF15() || this.isFF16() || this.isFF17() || this.isFF18() || this.isFF19() || this.isFF20() || this.isFF21() || this.isFF22();
},
/**
@@ -695,6 +703,7 @@ beef.browser = {
FF19:this.isFF19(), // Firefox 19
FF20:this.isFF20(), // Firefox 20
FF21:this.isFF21(), // Firefox 21
FF22:this.isFF22(), // Firefox 22
FF:this.isFF(), // Firefox any version
IE6:this.isIE6(), // Internet Explorer 6
@@ -949,8 +958,10 @@ beef.browser = {
if (this.isFF21()) {
return '21'
}
; // Firefox 21
; // Firefox 22
if (this.isFF22()) {
return '22'
};
if (this.isIE6()) {
return '6'
}