Added support for Firefox 16
Fixed bug where new versions of Firefox are detected as Safari Added placeholder for IE10
This commit is contained in:
@@ -60,12 +60,22 @@ beef.browser = {
|
||||
return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !!window.performance;
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns true if IE10.
|
||||
* @example: beef.browser.isIE10()
|
||||
*/
|
||||
// placeholder
|
||||
isIE10: function() {
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if IE.
|
||||
* @example: beef.browser.isIE()
|
||||
*/
|
||||
isIE: function() {
|
||||
return this.isIE6() || this.isIE7() || this.isIE8() || this.isIE9();
|
||||
return this.isIE6() || this.isIE7() || this.isIE8() || this.isIE9() || this.isIE10();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -196,12 +206,20 @@ beef.browser = {
|
||||
return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/15\./) != null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if FF16
|
||||
* @example: beef.browser.isFF16()
|
||||
*/
|
||||
isFF16: function() {
|
||||
return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/16\./) != null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if FF.
|
||||
* @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();
|
||||
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();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -209,7 +227,7 @@ beef.browser = {
|
||||
* @example: beef.browser.isS4()
|
||||
*/
|
||||
isS4: function() {
|
||||
return (window.navigator.userAgent.match(/ Version\/4\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome);
|
||||
return (window.navigator.userAgent.match(/ Version\/4\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome && !("MozWebSocket" in window));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -217,7 +235,7 @@ beef.browser = {
|
||||
* @example: beef.browser.isS5()
|
||||
*/
|
||||
isS5: function() {
|
||||
return (window.navigator.userAgent.match(/ Version\/5\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome);
|
||||
return (window.navigator.userAgent.match(/ Version\/5\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome && !("MozWebSocket" in window));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -225,7 +243,7 @@ beef.browser = {
|
||||
* @example: beef.browser.isS6()
|
||||
*/
|
||||
isS6: function() {
|
||||
return (window.navigator.userAgent.match(/ Version\/6\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome);
|
||||
return (window.navigator.userAgent.match(/ Version\/6\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome && !("MozWebSocket" in window));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -233,7 +251,7 @@ beef.browser = {
|
||||
* @example: beef.browser.isS()
|
||||
*/
|
||||
isS: function() {
|
||||
return this.isS4() || this.isS5() || this.isS6() || (!window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome);
|
||||
return this.isS4() || this.isS5() || this.isS6();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -472,12 +490,14 @@ beef.browser = {
|
||||
FF13: this.isFF13(), // Firefox 13
|
||||
FF14: this.isFF14(), // Firefox 14
|
||||
FF15: this.isFF15(), // Firefox 15
|
||||
FF16: this.isFF16(), // Firefox 16
|
||||
FF: this.isFF(), // Firefox any version
|
||||
|
||||
IE6: this.isIE6(), // Internet Explorer 6
|
||||
IE7: this.isIE7(), // Internet Explorer 7
|
||||
IE8: this.isIE8(), // Internet Explorer 8
|
||||
IE9: this.isIE9(), // Internet Explorer 9
|
||||
IE10: this.isIE10(), // Internet Explorer 10
|
||||
IE: this.isIE(), // Internet Explorer any version
|
||||
|
||||
O9_52: this.isO9_52(), // Opera 9.50 through 9.52
|
||||
@@ -536,11 +556,13 @@ beef.browser = {
|
||||
if (this.isFF13()) { return '13' }; // Firefox 13
|
||||
if (this.isFF14()) { return '14' }; // Firefox 14
|
||||
if (this.isFF15()) { return '15' }; // Firefox 15
|
||||
if (this.isFF16()) { return '16' }; // Firefox 16
|
||||
|
||||
if (this.isIE6()) { return '6' }; // Internet Explorer 6
|
||||
if (this.isIE7()) { return '7' }; // Internet Explorer 7
|
||||
if (this.isIE8()) { return '8' }; // Internet Explorer 8
|
||||
if (this.isIE9()) { return '9' }; // Internet Explorer 9
|
||||
if (this.isIE10()) { return '10' }; // Internet Explorer 10
|
||||
|
||||
if (this.isS4()) { return '4' }; // Safari 4
|
||||
if (this.isS5()) { return '5' }; // Safari 5
|
||||
|
||||
Reference in New Issue
Block a user