From 681f33f18682247f6082346b0bea33275ced7fde Mon Sep 17 00:00:00 2001 From: bennelson1234 Date: Fri, 2 Dec 2016 21:01:23 +1300 Subject: [PATCH 1/3] Update browser.js --- core/main/client/browser.js | 146 +++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 4 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 323f1b3253..858153ed97 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -1220,13 +1220,93 @@ beef.browser = { isC51iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 51) ? true : false); }, - + + /** + * Returns true if Chrome 52. + * @example: beef.browser.isC52() + */ + isC52: function () { + return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 52) ? true : false); + }, + + /** + * Returns true if Chrome for iOS 52. + * @example: beef.browser.isC52iOS() + */ + isC52iOS: function () { + return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 52) ? true : false); + }, + + /** + * Returns true if Chrome 53. + * @example: beef.browser.isC53() + */ + isC53: function () { + return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 53) ? true : false); + }, + + /** + * Returns true if Chrome for iOS 53. + * @example: beef.browser.isC53iOS() + */ + isC53iOS: function () { + return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 53) ? true : false); + }, + + /** + * Returns true if Chrome 54. + * @example: beef.browser.isC54() + */ + isC54: function () { + return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 54) ? true : false); + }, + + /** + * Returns true if Chrome for iOS 54. + * @example: beef.browser.isC54iOS() + */ + isC54iOS: function () { + return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 54) ? true : false); + }, + + /** + * Returns true if Chrome 55. + * @example: beef.browser.isC55() + */ + isC55: function () { + return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 55) ? true : false); + }, + + /** + * Returns true if Chrome for iOS 55. + * @example: beef.browser.isC55iOS() + */ + isC55iOS: function () { + return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 55) ? true : false); + }, + + /** + * Returns true if Chrome 56. + * @example: beef.browser.isC56() + */ + isC56: function () { + return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 56) ? true : false); + }, + + /** + * Returns true if Chrome for iOS 56. + * @example: beef.browser.isC56iOS() + */ + isC56iOS: function () { + return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 56) ? 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.isC19iOS() || this.isC20() || this.isC20iOS() || this.isC21() || this.isC21iOS() || this.isC22() || this.isC22iOS() || this.isC23() || this.isC23iOS() || this.isC24() || this.isC24iOS() || this.isC25() || this.isC25iOS() || this.isC26() || this.isC26iOS() || this.isC27() || this.isC27iOS() || this.isC28() || this.isC28iOS() || this.isC29() || this.isC29iOS() || this.isC30() || this.isC30iOS() || this.isC31() || this.isC31iOS() || this.isC32() || this.isC32iOS() || this.isC33() || this.isC33iOS() || this.isC34() || this.isC34iOS() || this.isC35() || this.isC35iOS() || this.isC36() || this.isC36iOS() || this.isC37() || this.isC37iOS() || this.isC38() || this.isC38iOS() || this.isC39() || this.isC39iOS() || this.isC40() || this.isC40iOS() || this.isC41() || this.isC41iOS() || this.isC42() || this.isC42iOS() || this.isC43() || this.isC43iOS() || this.isC44() || this.isC44iOS() || this.isC45() || this.isC45iOS() || this.isC46() || this.isC46iOS() || this.isC47() || this.isC47iOS() || this.isC48() || this.isC48iOS() || this.isC49() || this.isC49iOS() || this.isC50() || this.isC50iOS() || this.isC51() || this.isC51iOS(); + 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.isC19iOS() || this.isC20() || this.isC20iOS() || this.isC21() || this.isC21iOS() || this.isC22() || this.isC22iOS() || this.isC23() || this.isC23iOS() || this.isC24() || this.isC24iOS() || this.isC25() || this.isC25iOS() || this.isC26() || this.isC26iOS() || this.isC27() || this.isC27iOS() || this.isC28() || this.isC28iOS() || this.isC29() || this.isC29iOS() || this.isC30() || this.isC30iOS() || this.isC31() || this.isC31iOS() || this.isC32() || this.isC32iOS() || this.isC33() || this.isC33iOS() || this.isC34() || this.isC34iOS() || this.isC35() || this.isC35iOS() || this.isC36() || this.isC36iOS() || this.isC37() || this.isC37iOS() || this.isC38() || this.isC38iOS() || this.isC39() || this.isC39iOS() || this.isC40() || this.isC40iOS() || this.isC41() || this.isC41iOS() || this.isC42() || this.isC42iOS() || this.isC43() || this.isC43iOS() || this.isC44() || this.isC44iOS() || this.isC45() || this.isC45iOS() || this.isC46() || this.isC46iOS() || this.isC47() || this.isC47iOS() || this.isC48() || this.isC48iOS() || this.isC49() || this.isC49iOS() || this.isC50() || this.isC50iOS() || this.isC51() || this.isC51iOS() || this.isC52() || this.isC52iOS() || this.isC53() || this.isC53iOS() || this.isC54() || this.isC54iOS() || this.isC55() || this.isC55iOS() || this.isC56() || this.isC56iOS(); }, /** @@ -1379,7 +1459,17 @@ beef.browser = { C50iOS: this.isC50iOS(), // Chrome 50 on iOS C51: this.isC51(), // Chrome 51 C51iOS: this.isC51iOS(), // Chrome 51 on iOS - + C52: this.isC52(), // Chrome 52 + C52iOS: this.isC52iOS(), // Chrome 52 on iOS + C53: this.isC53(), // Chrome 53 + C53iOS: this.isC53iOS(), // Chrome 53 on iOS + C54: this.isC54(), // Chrome 54 + C54iOS: this.isC54iOS(), // Chrome 54 on iOS + C55: this.isC55(), // Chrome 55 + C55iOS: this.isC55iOS(), // Chrome 55 on iOS + C56: this.isC56(), // Chrome 56 + C56iOS: this.isC56iOS(), // Chrome 56 on iOS + C: this.isC(), // Chrome any version FF2: this.isFF2(), // Firefox 2 @@ -1779,7 +1869,55 @@ beef.browser = { return '50' } ; // Chrome 50 for iOS - + if (this.isC51()) { + return '51' + } + ;// Chrome 51 + if (this.isC51iOS()) { + return '51' + } + ; // Chrome 51 for iOS + if (this.isC52()) { + return '52' + } + ;// Chrome 52 + if (this.isC52iOS()) { + return '52' + } + ; // Chrome 52 for iOS + if (this.isC53()) { + return '53' + } + ;// Chrome 53 + if (this.isC53iOS()) { + return '53' + } + ; // Chrome 53 for iOS + if (this.isC54()) { + return '54' + } + ;// Chrome 54 + if (this.isC54iOS()) { + return '54' + } + ; // Chrome 54 for iOS + if (this.isC55()) { + return '55' + } + ;// Chrome 55 + if (this.isC55iOS()) { + return '55' + } + ; // Chrome 55 for iOS + if (this.isC56()) { + return '56' + } + ;// Chrome 56 + if (this.isC56iOS()) { + return '56' + } + ; // Chrome 56 for iOS + if (this.isFF2()) { return '2' } From fc56932cd1033458319662f7833e0610c390cc1f Mon Sep 17 00:00:00 2001 From: bennelson1234 Date: Fri, 2 Dec 2016 21:05:49 +1300 Subject: [PATCH 2/3] Add Chrome 56 --- core/main/client/browser.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 858153ed97..1ca0307ed3 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -1459,15 +1459,15 @@ beef.browser = { C50iOS: this.isC50iOS(), // Chrome 50 on iOS C51: this.isC51(), // Chrome 51 C51iOS: this.isC51iOS(), // Chrome 51 on iOS - C52: this.isC52(), // Chrome 52 + C52: this.isC52(), // Chrome 52 C52iOS: this.isC52iOS(), // Chrome 52 on iOS - C53: this.isC53(), // Chrome 53 + C53: this.isC53(), // Chrome 53 C53iOS: this.isC53iOS(), // Chrome 53 on iOS - C54: this.isC54(), // Chrome 54 + C54: this.isC54(), // Chrome 54 C54iOS: this.isC54iOS(), // Chrome 54 on iOS - C55: this.isC55(), // Chrome 55 + C55: this.isC55(), // Chrome 55 C55iOS: this.isC55iOS(), // Chrome 55 on iOS - C56: this.isC56(), // Chrome 56 + C56: this.isC56(), // Chrome 56 C56iOS: this.isC56iOS(), // Chrome 56 on iOS C: this.isC(), // Chrome any version From b00dd122cdb46fefefa3a7b31ad8d6f12323abb8 Mon Sep 17 00:00:00 2001 From: bennelson1234 Date: Fri, 2 Dec 2016 21:08:48 +1300 Subject: [PATCH 3/3] Added Chrome 56 --- core/main/client/browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 1ca0307ed3..baedb40180 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -1459,7 +1459,7 @@ beef.browser = { C50iOS: this.isC50iOS(), // Chrome 50 on iOS C51: this.isC51(), // Chrome 51 C51iOS: this.isC51iOS(), // Chrome 51 on iOS - C52: this.isC52(), // Chrome 52 + C52: this.isC52(), // Chrome 52 C52iOS: this.isC52iOS(), // Chrome 52 on iOS C53: this.isC53(), // Chrome 53 C53iOS: this.isC53iOS(), // Chrome 53 on iOS