Chrome 27/28 detection. Fixes Issue #905
This commit is contained in:
@@ -476,12 +476,28 @@ beef.browser = {
|
||||
return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 26) ? true : false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if Chrome 27.
|
||||
* @example: beef.browser.isC27()
|
||||
*/
|
||||
isC27:function () {
|
||||
return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 27) ? true : false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if Chrome 28.
|
||||
* @example: beef.browser.isC28()
|
||||
*/
|
||||
isC28:function () {
|
||||
return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 28) ? true : false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if Chrome.
|
||||
* @example: beef.browser.isC()
|
||||
*/
|
||||
isC:function () {
|
||||
return this.isC5() || this.isC6() || this.isC7() || this.isC8() || this.isC9() || this.isC10() || this.isC11() || this.isC12() || this.isC13() || this.isC14() || this.isC15() || this.isC16() || this.isC17() || this.isC18() || this.isC19() || this.isC20() || this.isC21() || this.isC22() || this.isC23() || this.isC24() || this.isC25() || this.isC26();
|
||||
return this.isC5() || this.isC6() || this.isC7() || this.isC8() || this.isC9() || this.isC10() || this.isC11() || this.isC12() || this.isC13() || this.isC14() || this.isC15() || this.isC16() || this.isC17() || this.isC18() || this.isC19() || this.isC20() || this.isC21() || this.isC22() || this.isC23() || this.isC24() || this.isC25() || this.isC26() || this.isC27() || this.isC28();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -563,6 +579,8 @@ beef.browser = {
|
||||
C24:this.isC24(), // Chrome 24
|
||||
C25:this.isC25(), // Chrome 25
|
||||
C26:this.isC26(), // Chrome 26
|
||||
C27:this.isC27(), // Chrome 27
|
||||
C28:this.isC28(), // Chrome 28
|
||||
C:this.isC(), // Chrome any version
|
||||
|
||||
FF2:this.isFF2(), // Firefox 2
|
||||
@@ -706,6 +724,14 @@ beef.browser = {
|
||||
return '26'
|
||||
}
|
||||
; // Chrome 26
|
||||
if (this.isC27()) {
|
||||
return '27'
|
||||
}
|
||||
; // Chrome 27
|
||||
if (this.isC28()) {
|
||||
return '28'
|
||||
}
|
||||
; // Chrome 28
|
||||
if (this.isFF2()) {
|
||||
return '2'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user