Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Chrome 56 #1325

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 142 additions & 4 deletions core/main/client/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},

/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
}
Expand Down