From b4732a94380f2098403cdcd2eaa230630c7736ce Mon Sep 17 00:00:00 2001 From: Christian Frichot Date: Mon, 8 Apr 2013 13:08:56 +0800 Subject: [PATCH] Fixes #876. Can detect Chrome 26. --- core/main/client/browser.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 82556c71a..edded787e 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -444,12 +444,20 @@ beef.browser = { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 25) ? true : false); }, + /** + * Returns true if Chrome 26. + * @example: beef.browser.isC26() + */ + isC26:function () { + 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. * @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(); + 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(); }, /** @@ -530,6 +538,7 @@ beef.browser = { C23:this.isC23(), // Chrome 23 C24:this.isC24(), // Chrome 24 C25:this.isC25(), // Chrome 25 + C26:this.isC26(), // Chrome 26 C:this.isC(), // Chrome any version FF2:this.isFF2(), // Firefox 2 @@ -667,7 +676,11 @@ beef.browser = { if (this.isC25()) { return '25' } - ; + ; // Chrome 25 + if (this.isC26()) { + return '26' + } + ; // Chrome 26 if (this.isFF2()) { return '2' }