From fdf3dff690acec1b1d00ab0d85ac82b4793659d1 Mon Sep 17 00:00:00 2001 From: radoen Date: Sat, 2 Feb 2013 22:07:28 +0100 Subject: [PATCH] ISSUES #817 to refine UI rendering. Note In FF 21.xx the old detection method correctly work yet --- core/main/client/browser.js | 3142 +++++++++++++++++++++++------------ 1 file changed, 2092 insertions(+), 1050 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 497cd2099..f6d1ff970 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -11,730 +11,1644 @@ */ beef.browser = { - /** - * Returns the user agent that the browser is claiming to be. - * @example: beef.browser.getBrowserReportedName() - */ - getBrowserReportedName: function() { - return navigator.userAgent; - }, + /** + * Returns the user agent that the browser is claiming to be. + * @example: beef.browser.getBrowserReportedName() + */ + getBrowserReportedName:function () { + return navigator.userAgent; + }, - /** - * Returns true if IE6. - * @example: beef.browser.isIE6() - */ - isIE6: function() { - return !window.XMLHttpRequest && !window.globalStorage; - }, + /** + * Returns true if IE6. + * @example: beef.browser.isIE6() + */ + isIE6:function () { + return !window.XMLHttpRequest && !window.globalStorage; + }, - /** - * Returns true if IE7. - * @example: beef.browser.isIE7() - */ - isIE7: function() { - return !!window.XMLHttpRequest && !window.chrome && !window.opera && !window.getComputedStyle && !window.globalStorage && !document.documentMode; - }, + /** + * Returns true if IE7. + * @example: beef.browser.isIE7() + */ + isIE7:function () { + return !!window.XMLHttpRequest && !window.chrome && !window.opera && !window.getComputedStyle && !window.globalStorage && !document.documentMode; + }, - /** - * Returns true if IE8. - * @example: beef.browser.isIE8() - */ - isIE8: function() { - return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !window.performance; - }, + /** + * Returns true if IE8. + * @example: beef.browser.isIE8() + */ + isIE8:function () { + return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !window.performance; + }, - /** - * Returns true if IE9. - * @example: beef.browser.isIE9() - */ - isIE9: function() { - return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !!window.performance && typeof navigator.msMaxTouchPoints === "undefined"; - }, + /** + * Returns true if IE9. + * @example: beef.browser.isIE9() + */ + isIE9:function () { + return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !!window.performance && typeof navigator.msMaxTouchPoints === "undefined"; + }, - /** - * - * Returns true if IE10. - * @example: beef.browser.isIE10() - */ - isIE10: function() { - return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !!window.performance && typeof navigator.msMaxTouchPoints !== "undefined"; - }, + /** + * + * Returns true if IE10. + * @example: beef.browser.isIE10() + */ + isIE10:function () { + return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.XDomainRequest && !!window.performance && typeof navigator.msMaxTouchPoints !== "undefined"; + }, - /** - * Returns true if IE. - * @example: beef.browser.isIE() - */ - isIE: function() { - return this.isIE6() || this.isIE7() || this.isIE8() || this.isIE9() || this.isIE10(); - }, + /** + * Returns true if IE. + * @example: beef.browser.isIE() + */ + isIE:function () { + return this.isIE6() || this.isIE7() || this.isIE8() || this.isIE9() || this.isIE10(); + }, - /** - * Returns true if FF2. - * @example: beef.browser.isFF2() - */ - isFF2: function() { - return !!window.globalStorage && !window.postMessage; - }, + /** + * Returns true if FF2. + * @example: beef.browser.isFF2() + */ + isFF2:function () { + return !!window.globalStorage && !window.postMessage; + }, - /** - * Returns true if FF3. - * @example: beef.browser.isFF3() - */ - isFF3: function() { - return !!window.globalStorage && !!window.postMessage && !JSON.parse; - }, + /** + * Returns true if FF3. + * @example: beef.browser.isFF3() + */ + isFF3:function () { + return !!window.globalStorage && !!window.postMessage && !JSON.parse; + }, - /** - * Returns true if FF3.5. - * @example: beef.browser.isFF3_5() - */ - isFF3_5: function() { - return !!window.globalStorage && !!JSON.parse && !window.FileReader; - }, + /** + * Returns true if FF3.5. + * @example: beef.browser.isFF3_5() + */ + isFF3_5:function () { + return !!window.globalStorage && !!JSON.parse && !window.FileReader; + }, - /** - * Returns true if FF3.6. - * @example: beef.browser.isFF3_6() - */ - isFF3_6: function() { - return !!window.globalStorage && !!window.FileReader && !window.multitouchData && !window.history.replaceState; - }, + /** + * Returns true if FF3.6. + * @example: beef.browser.isFF3_6() + */ + isFF3_6:function () { + return !!window.globalStorage && !!window.FileReader && !window.multitouchData && !window.history.replaceState; + }, - /** - * Returns true if FF4. - * @example: beef.browser.isFF4() - */ - isFF4: function() { - return !!window.globalStorage && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/4\./) != null; - }, + /** + * Returns true if FF4. + * @example: beef.browser.isFF4() + */ + isFF4:function () { + return !!window.globalStorage && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/4\./) != null; + }, - /** - * Returns true if FF5. - * @example: beef.browser.isFF5() - */ - isFF5: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/5\./) != null; - }, + /** + * Returns true if FF5. + * @example: beef.browser.isFF5() + */ + isFF5:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/5\./) != null; + }, - /** - * Returns true if FF6. - * @example: beef.browser.isFF6() - */ - isFF6: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/6\./) != null; - }, + /** + * Returns true if FF6. + * @example: beef.browser.isFF6() + */ + isFF6:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/6\./) != null; + }, - /** - * Returns true if FF7. - * @example: beef.browser.isFF7() - */ - isFF7: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/7\./) != null; - }, + /** + * Returns true if FF7. + * @example: beef.browser.isFF7() + */ + isFF7:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/7\./) != null; + }, - /** - * Returns true if FF8. - * @example: beef.browser.isFF8() - */ - isFF8: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/8\./) != null; - }, + /** + * Returns true if FF8. + * @example: beef.browser.isFF8() + */ + isFF8:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/8\./) != null; + }, - /** - * Returns true if FF9. - * @example: beef.browser.isFF9() - */ - isFF9: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/9\./) != null; - }, + /** + * Returns true if FF9. + * @example: beef.browser.isFF9() + */ + isFF9:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/9\./) != null; + }, - /** - * Returns true if FF10. - * @example: beef.browser.isFF10() - */ - isFF10: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/10\./) != null; - }, + /** + * Returns true if FF10. + * @example: beef.browser.isFF10() + */ + isFF10:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/10\./) != null; + }, - /** - * Returns true if FF11. - * @example: beef.browser.isFF11() - */ - isFF11: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/11\./) != null; - }, + /** + * Returns true if FF11. + * @example: beef.browser.isFF11() + */ + isFF11:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/11\./) != null; + }, - /** - * Returns true if FF12 - * @example: beef.browser.isFF12() - */ - isFF12: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/12\./) != null; - }, + /** + * Returns true if FF12 + * @example: beef.browser.isFF12() + */ + isFF12:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/12\./) != null; + }, - /** - * Returns true if FF13 - * @example: beef.browser.isFF13() - */ - isFF13: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/13\./) != null; - }, + /** + * Returns true if FF13 + * @example: beef.browser.isFF13() + */ + isFF13:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/13\./) != null; + }, - /** - * Returns true if FF14 - * @example: beef.browser.isFF14() - */ - isFF14: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/14\./) != null; - }, + /** + * Returns true if FF14 + * @example: beef.browser.isFF14() + */ + isFF14:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/14\./) != null; + }, - /** - * Returns true if FF15 - * @example: beef.browser.isFF15() - */ - isFF15: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/15\./) != null; - }, + /** + * Returns true if FF15 + * @example: beef.browser.isFF15() + */ + isFF15:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/15\./) != null; + }, - /** - * Returns true if FF16 - * @example: beef.browser.isFF16() - */ - isFF16: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/16\./) != null; - }, + /** + * Returns true if FF16 + * @example: beef.browser.isFF16() + */ + isFF16:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/16\./) != null; + }, - /** - * Returns true if FF17 - * @example: beef.browser.isFF17() - */ - isFF17: function() { - return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/17\./) != null; - }, + /** + * Returns true if FF17 + * @example: beef.browser.isFF17() + */ + isFF17:function () { + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/17\./) != null; + }, - /** - * Returns true if FF18 - * @example: beef.browser.isFF18() - */ - isFF18: function() { - return !!window.devicePixelRatio && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/18\./) != null; - }, + /** + * Returns true if FF18 + * @example: beef.browser.isFF18() + */ + isFF18:function () { + return !!window.devicePixelRatio && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/18\./) != null; + }, - /** - * Returns true if FF19 - * @example: beef.browser.isFF19() - */ - isFF19: function() { -return !!window.devicePixelRatio && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/19\./) != null; - }, + /** + * Returns true if FF19 + * @example: beef.browser.isFF19() + */ + isFF19:function () { + return !!window.devicePixelRatio && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/19\./) != null; + }, - /** - * Returns true if FF. - * @example: beef.browser.isFF() - */ - 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(); - }, + /** + * Returns true if FF. + * @example: beef.browser.isFF() + */ + 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(); + }, - /** - * Returns true if Safari 4.xx - * @example: beef.browser.isS4() - */ - 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)); - }, + /** + * Returns true if Safari 4.xx + * @example: beef.browser.isS4() + */ + 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)); + }, - /** - * Returns true if Safari 5.xx - * @example: beef.browser.isS5() - */ - 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)); - }, + /** + * Returns true if Safari 5.xx + * @example: beef.browser.isS5() + */ + 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)); + }, - /** - * Returns true if Safari 6.xx - * @example: beef.browser.isS6() - */ - 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)); - }, + /** + * Returns true if Safari 6.xx + * @example: beef.browser.isS6() + */ + 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)); + }, - /** - * Returns true if Safari. - * @example: beef.browser.isS() - */ - isS: function() { - return this.isS4() || this.isS5() || this.isS6(); - }, + /** + * Returns true if Safari. + * @example: beef.browser.isS() + */ + isS:function () { + return this.isS4() || this.isS5() || this.isS6(); + }, - /** - * Returns true if Chrome 5. - * @example: beef.browser.isC5() - */ - 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); - }, + /** + * Returns true if Chrome 5. + * @example: beef.browser.isC5() + */ + 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); + }, - /** - * Returns true if Chrome 6. - * @example: beef.browser.isC6() - */ - 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); - }, + /** + * Returns true if Chrome 6. + * @example: beef.browser.isC6() + */ + 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); + }, - /** - * Returns true if Chrome 7. - * @example: beef.browser.isC7() - */ - 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); - }, + /** + * Returns true if Chrome 7. + * @example: beef.browser.isC7() + */ + 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); + }, - /** - * Returns true if Chrome 8. - * @example: beef.browser.isC8() - */ - 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); - }, + /** + * Returns true if Chrome 8. + * @example: beef.browser.isC8() + */ + 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); + }, - /** - * Returns true if Chrome 9. - * @example: beef.browser.isC9() - */ - 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); - }, + /** + * Returns true if Chrome 9. + * @example: beef.browser.isC9() + */ + 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); + }, - /** - * Returns true if Chrome 10. - * @example: beef.browser.isC10() - */ - 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); - }, + /** + * Returns true if Chrome 10. + * @example: beef.browser.isC10() + */ + 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); + }, - /** - * Returns true if Chrome 11. - * @example: beef.browser.isC11() - */ - 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); - }, + /** + * Returns true if Chrome 11. + * @example: beef.browser.isC11() + */ + 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); + }, - /** - * Returns true if Chrome 12. - * @example: beef.browser.isC12() - */ - 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); - }, + /** + * Returns true if Chrome 12. + * @example: beef.browser.isC12() + */ + 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); + }, - /** - * Returns true if Chrome 13. - * @example: beef.browser.isC13() - */ - 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); - }, + /** + * Returns true if Chrome 13. + * @example: beef.browser.isC13() + */ + 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); + }, - /** - * Returns true if Chrome 14. - * @example: beef.browser.isC14() - */ - 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); - }, + /** + * Returns true if Chrome 14. + * @example: beef.browser.isC14() + */ + 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); + }, - /** - * Returns true if Chrome 15. - * @example: beef.browser.isC15() - */ - 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); - }, + /** + * Returns true if Chrome 15. + * @example: beef.browser.isC15() + */ + 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); + }, - /** - * Returns true if Chrome 16. - * @example: beef.browser.isC16() - */ - 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); - }, + /** + * Returns true if Chrome 16. + * @example: beef.browser.isC16() + */ + 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); + }, /** * Returns true if Chrome 17. * @example: beef.browser.isC17() */ - 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); + 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); }, - /** - * Returns true if Chrome 18. - * @example: beef.browser.isC18() - */ - 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); - }, + /** + * Returns true if Chrome 18. + * @example: beef.browser.isC18() + */ + 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); + }, - /** - * Returns true if Chrome 19. - * @example: beef.browser.isC19() - */ - 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); - }, + /** + * Returns true if Chrome 19. + * @example: beef.browser.isC19() + */ + 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); + }, - /** - * Returns true if Chrome 20. - * @example: beef.browser.isC20() - */ - 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); - }, + /** + * Returns true if Chrome 20. + * @example: beef.browser.isC20() + */ + 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); + }, /** * Returns true if Chrome 21. * @example: beef.browser.isC21() */ - 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); + 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); }, - /** - * Returns true if Chrome 22. - * @example: beef.browser.isC22() - */ - 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); - }, + /** + * Returns true if Chrome 22. + * @example: beef.browser.isC22() + */ + 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); + }, /** * Returns true if Chrome 23. * @example: beef.browser.isC23() */ - 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); + 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); }, /** * Returns true if Chrome 24. * @example: beef.browser.isC24() */ - 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); + 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); }, - /** - * 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(); - }, + /** + * 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(); + }, - /** - * Returns true if Opera 9.50 through 9.52. - * @example: beef.browser.isO9_52() - */ - isO9_52: function() { - return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.5/) != null)); - }, + /** + * Returns true if Opera 9.50 through 9.52. + * @example: beef.browser.isO9_52() + */ + isO9_52:function () { + return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.5/) != null)); + }, - /** - * Returns true if Opera 9.60 through 9.64. - * @example: beef.browser.isO9_60() - */ - isO9_60: function() { - return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.6/) != null)); - }, + /** + * Returns true if Opera 9.60 through 9.64. + * @example: beef.browser.isO9_60() + */ + isO9_60:function () { + return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.6/) != null)); + }, - /** - * Returns true if Opera 10.xx. - * @example: beef.browser.isO10() - */ - isO10: function() { - return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/10\./) != null)); - }, + /** + * Returns true if Opera 10.xx. + * @example: beef.browser.isO10() + */ + isO10:function () { + return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/10\./) != null)); + }, - /** - * Returns true if Opera 11.xx. - * @example: beef.browser.isO11() - */ - isO11: function() { - return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/11\./) != null)); - }, + /** + * Returns true if Opera 11.xx. + * @example: beef.browser.isO11() + */ + isO11:function () { + return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/11\./) != null)); + }, - /** - * Returns true if Opera 12.xx. - * @example: beef.browser.isO12() - */ - isO12: function() { - return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/12\./) != null)); - }, + /** + * Returns true if Opera 12.xx. + * @example: beef.browser.isO12() + */ + isO12:function () { + return (!!window.opera && (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/12\./) != null)); + }, - /** - * Returns true if Opera. - * @example: beef.browser.isO() - */ - isO: function() { - return this.isO9_52() || this.isO9_60() || this.isO10() || this.isO11() || this.isO12(); - }, + /** + * Returns true if Opera. + * @example: beef.browser.isO() + */ + isO:function () { + return this.isO9_52() || this.isO9_60() || this.isO10() || this.isO11() || this.isO12(); + }, - /** - * Returns the type of browser being used. - * @example: beef.browser.type().IE6 - * @example: beef.browser.type().FF - * @example: beef.browser.type().O - */ - type: function() { + /** + * Returns the type of browser being used. + * @example: beef.browser.type().IE6 + * @example: beef.browser.type().FF + * @example: beef.browser.type().O + */ + 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 - C20: this.isC20(), // Chrome 20 - C21: this.isC21(), // Chrome 21 - C22: this.isC22(), // Chrome 22 - C23: this.isC23(), // Chrome 23 - C24: this.isC24(), // Chrome 24 - C: this.isC(), // Chrome any version + 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 + C20:this.isC20(), // Chrome 20 + C21:this.isC21(), // Chrome 21 + C22:this.isC22(), // Chrome 22 + C23:this.isC23(), // Chrome 23 + C24:this.isC24(), // Chrome 24 + 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 - 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 + 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 - 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 + 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 11.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 11.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 - S: this.isS() // Safari any version - } - }, + S4:this.isS4(), // Safari 4.xx + S5:this.isS5(), // Safari 5.xx + S6:this.isS6(), // Safari 6.x + S:this.isS() // Safari any version + } + }, - /** - * Returns the type of browser being used. - * @return: {String} User agent software and version. - * - * @example: beef.browser.getBrowserVersion() - */ - getBrowserVersion: function() { + /** + * Returns the type of browser being used. + * @return: {String} User agent software and version. + * + * @example: beef.browser.getBrowserVersion() + */ + getBrowserVersion:function () { - if (this.isC5()) { return '5' }; // Chrome 5 - if (this.isC6()) { return '6' }; // Chrome 6 - if (this.isC7()) { return '7' }; // Chrome 7 - if (this.isC8()) { return '8' }; // Chrome 8 - if (this.isC9()) { return '9' }; // Chrome 9 - if (this.isC10()) { return '10' }; // Chrome 10 - if (this.isC11()) { return '11' }; // Chrome 11 - if (this.isC12()) { return '12' }; // Chrome 12 - if (this.isC13()) { return '13' }; // Chrome 13 - if (this.isC14()) { return '14' }; // Chrome 14 - if (this.isC15()) { return '15' }; // Chrome 15 - if (this.isC16()) { return '16' }; // Chrome 16 - if (this.isC17()) { return '17' }; // Chrome 17 - if (this.isC18()) { return '18' }; // Chrome 18 - if (this.isC19()) { return '19' }; // Chrome 19 - if (this.isC20()) { return '20' }; // Chrome 20 - if (this.isC21()) { return '21' }; // Chrome 21 - if (this.isC22()) { return '22' }; // Chrome 22 - if (this.isC23()) { return '23' }; // Chrome 23 - if (this.isC24()) { return '24' }; // Chrome 24 + if (this.isC5()) { + return '5' + } + ; // Chrome 5 + if (this.isC6()) { + return '6' + } + ; // Chrome 6 + if (this.isC7()) { + return '7' + } + ; // Chrome 7 + if (this.isC8()) { + return '8' + } + ; // Chrome 8 + if (this.isC9()) { + return '9' + } + ; // Chrome 9 + if (this.isC10()) { + return '10' + } + ; // Chrome 10 + if (this.isC11()) { + return '11' + } + ; // Chrome 11 + if (this.isC12()) { + return '12' + } + ; // Chrome 12 + if (this.isC13()) { + return '13' + } + ; // Chrome 13 + if (this.isC14()) { + return '14' + } + ; // Chrome 14 + if (this.isC15()) { + return '15' + } + ; // Chrome 15 + if (this.isC16()) { + return '16' + } + ; // Chrome 16 + if (this.isC17()) { + return '17' + } + ; // Chrome 17 + if (this.isC18()) { + return '18' + } + ; // Chrome 18 + if (this.isC19()) { + return '19' + } + ; // Chrome 19 + if (this.isC20()) { + return '20' + } + ; // Chrome 20 + if (this.isC21()) { + return '21' + } + ; // Chrome 21 + if (this.isC22()) { + return '22' + } + ; // Chrome 22 + if (this.isC23()) { + return '23' + } + ; // Chrome 23 + if (this.isC24()) { + return '24' + } + ; // Chrome 24 - if (this.isFF2()) { return '2' }; // Firefox 2 - if (this.isFF3()) { return '3' }; // Firefox 3 - if (this.isFF3_5()) { return '3.5'}; // Firefox 3.5 - if (this.isFF3_6()) { return '3.6'}; // Firefox 3.6 - if (this.isFF4()) { return '4' }; // Firefox 4 - if (this.isFF5()) { return '5' }; // Firefox 5 - if (this.isFF6()) { return '6' }; // Firefox 6 - if (this.isFF7()) { return '7' }; // Firefox 7 - if (this.isFF8()) { return '8' }; // Firefox 8 - if (this.isFF9()) { return '9' }; // Firefox 9 - if (this.isFF10()) { return '10' }; // Firefox 10 - if (this.isFF11()) { return '11' }; // Firefox 11 - if (this.isFF12()) { return '12' }; // Firefox 12 - if (this.isFF13()) { return '13' }; // Firefox 13 - if (this.isFF14()) { return '14' }; // Firefox 14 - if (this.isFF15()) { return '15' }; // Firefox 15 - if (this.isFF16()) { return '16' }; // Firefox 16 - if (this.isFF17()) { return '17' }; // Firefox 17 - if (this.isFF18()) { return '18' }; // Firefox 18 - if (this.isFF19()) { return '19' }; // Firefox 19 + if (this.isFF2()) { + return '2' + } + ; // Firefox 2 + if (this.isFF3()) { + return '3' + } + ; // Firefox 3 + if (this.isFF3_5()) { + return '3.5' + } + ; // Firefox 3.5 + if (this.isFF3_6()) { + return '3.6' + } + ; // Firefox 3.6 + if (this.isFF4()) { + return '4' + } + ; // Firefox 4 + if (this.isFF5()) { + return '5' + } + ; // Firefox 5 + if (this.isFF6()) { + return '6' + } + ; // Firefox 6 + if (this.isFF7()) { + return '7' + } + ; // Firefox 7 + if (this.isFF8()) { + return '8' + } + ; // Firefox 8 + if (this.isFF9()) { + return '9' + } + ; // Firefox 9 + if (this.isFF10()) { + return '10' + } + ; // Firefox 10 + if (this.isFF11()) { + return '11' + } + ; // Firefox 11 + if (this.isFF12()) { + return '12' + } + ; // Firefox 12 + if (this.isFF13()) { + return '13' + } + ; // Firefox 13 + if (this.isFF14()) { + return '14' + } + ; // Firefox 14 + if (this.isFF15()) { + return '15' + } + ; // Firefox 15 + if (this.isFF16()) { + return '16' + } + ; // Firefox 16 + if (this.isFF17()) { + return '17' + } + ; // Firefox 17 + if (this.isFF18()) { + return '18' + } + ; // Firefox 18 + if (this.isFF19()) { + return '19' + } + ; // Firefox 19 - if (this.isIE6()) { return '6' }; // Internet Explorer 6 - if (this.isIE7()) { return '7' }; // Internet Explorer 7 - if (this.isIE8()) { return '8' }; // Internet Explorer 8 - if (this.isIE9()) { return '9' }; // Internet Explorer 9 - if (this.isIE10()) { return '10' }; // Internet Explorer 10 + if (this.isIE6()) { + return '6' + } + ; // Internet Explorer 6 + if (this.isIE7()) { + return '7' + } + ; // Internet Explorer 7 + if (this.isIE8()) { + return '8' + } + ; // Internet Explorer 8 + if (this.isIE9()) { + return '9' + } + ; // Internet Explorer 9 + if (this.isIE10()) { + return '10' + } + ; // Internet Explorer 10 - if (this.isS4()) { return '4' }; // Safari 4 - if (this.isS5()) { return '5' }; // Safari 5 - if (this.isS6()) { return '6' }; // Safari 6 + if (this.isS4()) { + return '4' + } + ; // Safari 4 + if (this.isS5()) { + return '5' + } + ; // Safari 5 + if (this.isS6()) { + return '6' + } + ; // Safari 6 - if (this.isO9_52()) { return '9.5'}; // Opera 9.5x - if (this.isO9_60()) { return '9.6'}; // Opera 9.6 - if (this.isO10()) { return '10' }; // Opera 10.xx - if (this.isO11()) { return '11' }; // Opera 11.xx - if (this.isO12()) { return '12' }; // Opera 12.xx + if (this.isO9_52()) { + return '9.5' + } + ; // Opera 9.5x + if (this.isO9_60()) { + return '9.6' + } + ; // Opera 9.6 + if (this.isO10()) { + return '10' + } + ; // Opera 10.xx + if (this.isO11()) { + return '11' + } + ; // Opera 11.xx + if (this.isO12()) { + return '12' + } + ; // Opera 12.xx - return 'UNKNOWN'; // Unknown UA - }, + return 'UNKNOWN'; // Unknown UA + }, - /** - * Returns the type of user agent by hooked browser. - * @return: {String} User agent software. - * - * @example: beef.browser.getBrowserName() - */ - getBrowserName: function() { + /** + * Returns the type of user agent by hooked browser. + * @return: {String} User agent software. + * + * @example: beef.browser.getBrowserName() + */ + getBrowserName:function () { - if (this.isC()) { return 'C' }; // Chrome any version - if (this.isFF()) { return 'FF'}; // Firefox any version - if (this.isIE()) { return 'IE'}; // Internet Explorer any version - if (this.isO()) { return 'O' }; // Opera any version - if (this.isS()) { return 'S' }; // Safari any version - return 'UNKNOWN'; // Unknown UA - }, + if (this.isC()) { + return 'C' + } + ; // Chrome any version + if (this.isFF()) { + return 'FF' + } + ; // Firefox any version + if (this.isIE()) { + return 'IE' + } + ; // Internet Explorer any version + if (this.isO()) { + return 'O' + } + ; // Opera any version + if (this.isS()) { + return 'S' + } + ; // Safari any version + return 'UNKNOWN'; // Unknown UA + }, - /** - * Checks if the zombie has flash installed and enabled. - * @return: {Boolean} true or false. - * - * @example: if(beef.browser.hasFlash()) { ... } - */ - hasFlash: function() { - if (!this.type().IE) { - return (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]); - } else { - flash_versions = 11; - flash_installed = false; + /** + * Checks if the zombie has flash installed and enabled. + * @return: {Boolean} true or false. + * + * @example: if(beef.browser.hasFlash()) { ... } + */ + hasFlash:function () { + if (!this.type().IE) { + return (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]); + } else { + flash_versions = 11; + flash_installed = false; - if (window.ActiveXObject) { - for (x = 2; x <= flash_versions; x++) { - try { - Flash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');"); - if (Flash) { - flash_installed = true; - } - } - catch(e) { } - } - }; - return flash_installed; - } - }, + if (window.ActiveXObject) { + for (x = 2; x <= flash_versions; x++) { + try { + Flash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');"); + if (Flash) { + flash_installed = true; + } + } + catch (e) { + } + } + } + ; + return flash_installed; + } + }, - /** - * Checks if the zombie has the QuickTime plugin installed. - * @return: {Boolean} true or false. - * - * @example: if ( beef.browser.hasQuickTime() ) { ... } - */ - hasQuickTime: function() { - - var quicktime = false; - - // Not Internet Explorer - if ( !this.type().IE ) { - - for ( i=0; i < navigator.plugins.length; i++ ) { - - if ( navigator.plugins[i].name.indexOf("QuickTime") >= 0 ) { - quicktime = true; - } - - } - - // Internet Explorer - } else { - - try { - - var qt_test = new ActiveXObject('QuickTime.QuickTime'); - - } catch (e) { } - - if ( qt_test ) { quicktime = true; } - - } - - return quicktime; - - }, + /** + * Checks if the zombie has the QuickTime plugin installed. + * @return: {Boolean} true or false. + * + * @example: if ( beef.browser.hasQuickTime() ) { ... } + */ + hasQuickTime:function () { - /** - * Checks if the zombie has Java enabled. - * @return: {Boolean} true or false. - * - * @example: if(beef.browser.javaEnabled()) { ... } - */ - javaEnabled: function() { + var quicktime = false; - if(!this.isIE()) - { + // Not Internet Explorer + if (!this.type().IE) { + + for (i = 0; i < navigator.plugins.length; i++) { + + if (navigator.plugins[i].name.indexOf("QuickTime") >= 0) { + quicktime = true; + } + + } + + // Internet Explorer + } else { + + try { + + var qt_test = new ActiveXObject('QuickTime.QuickTime'); + + } catch (e) { + } + + if (qt_test) { + quicktime = true; + } + + } + + return quicktime; + + }, + + /** + * Checks if the zombie has Java enabled. + * @return: {Boolean} true or false. + * + * @example: if(beef.browser.javaEnabled()) { ... } + */ + javaEnabled:function () { + + if (!this.isIE()) { // Cross-browser Java Deployment Toolkit Script // Source: http://java.com/js/deployJava.js - deployJava=function(){var l={core:["id","class","title","style"],i18n:["lang","dir"],events:["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onkeypress","onkeydown","onkeyup"],applet:["codebase","code","name","archive","object","width","height","alt","align","hspace","vspace"],object:["classid","codebase","codetype","data","type","archive","declare","standby","height","width","usemap","name","tabindex","align","border","hspace","vspace"]};var b=l.object.concat(l.core,l.i18n,l.events);var m=l.applet.concat(l.core);function g(n){if(!d.debug){return}if(console.log){console.log(n)}else{alert(n)}}function k(o,n){if(o==null||o.length==0){return true}var q=o.charAt(o.length-1);if(q!="+"&&q!="*"&&(o.indexOf("_")!=-1&&q!="_")){o=o+"*";q="*"}o=o.substring(0,o.length-1);if(o.length>0){var p=o.charAt(o.length-1);if(p=="."||p=="_"){o=o.substring(0,o.length-1)}}if(q=="*"){return(n.indexOf(o)==0)}else{if(q=="+"){return o<=n}}return false}function e(){var n="//java.com/js/webstart.png";try{return document.location.protocol.indexOf("http")!=-1?n:"http:"+n}catch(o){return"http:"+n}}function j(p,o){var n=p.length;for(var q=0;q'}if(!u){p+=''}if(w){n+=(' code="dummy"')}n+=">";document.write(n+"\n"+p+"\n"+r)},versionCheck:function(o){var u=0;var w="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?(\\*|\\+)?$";var x=o.match(w);if(x!=null){var q=false;var t=false;var p=new Array();for(var r=1;r'}else{if(o=="Netscape Family"){p=''}}if(document.body=="undefined"||document.body==null){document.write(p);document.location=t}else{var r=document.createElement("div");r.id="div1";r.style.position="relative";r.style.left="-10000px";r.style.margin="0px auto";r.className="dynamicDiv";r.innerHTML=p;document.body.appendChild(r)}},createWebStartLaunchButtonEx:function(p,o){if(this.returnPage==null){this.returnPage=p}var n="javascript:deployJava.launchWebStartApplication('"+p+"');";document.write('')},createWebStartLaunchButton:function(p,o){if(this.returnPage==null){this.returnPage=p}var n="javascript:if (!deployJava.isWebStartInstalled(""+o+"")) {if (deployJava.installLatestJRE()) {if (deployJava.launch(""+p+"")) {}}} else {if (deployJava.launch(""+p+"")) {}}";document.write('')},launch:function(n){document.location=n;return true},isPluginInstalled:function(){var n=this.getPlugin();if(n&&n.jvms){return true}else{return false}},isAutoUpdateEnabled:function(){if(this.isPluginInstalled()){return this.getPlugin().isAutoUpdateEnabled()}return false},setAutoUpdateEnabled:function(){if(this.isPluginInstalled()){return this.getPlugin().setAutoUpdateEnabled()}return false},setInstallerType:function(n){this.installType=n;if(this.isPluginInstalled()){return this.getPlugin().setInstallerType(n)}return false},setAdditionalPackages:function(n){if(this.isPluginInstalled()){return this.getPlugin().setAdditionalPackages(n)}return false},setEarlyAccess:function(n){this.EAInstallEnabled=n},isPlugin2:function(){if(this.isPluginInstalled()){if(this.versionCheck("1.6.0_10+")){try{return this.getPlugin().isPlugin2()}catch(n){}}}return false},allowPlugin:function(){this.getBrowser();var n=("Safari"!=this.browserName2&&"Opera"!=this.browserName2);return n},getPlugin:function(){this.refresh();var n=null;if(this.allowPlugin()){n=document.getElementById("deployJavaPlugin")}return n},compareVersionToPattern:function(u,o,q,r){if(u==undefined||o==undefined){return false}var v="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";var w=u.match(v);if(w!=null){var t=0;var x=new Array();for(var p=1;po[p]){return true}}}return true}else{for(var p=0;p "+n);if((n.indexOf("msie")!=-1)&&(n.indexOf("opera")==-1)){this.browserName="MSIE";this.browserName2="MSIE"}else{if(n.indexOf("iphone")!=-1){this.browserName="Netscape Family";this.browserName2="iPhone"}else{if((n.indexOf("firefox")!=-1)&&(n.indexOf("opera")==-1)){this.browserName="Netscape Family";this.browserName2="Firefox"}else{if(n.indexOf("chrome")!=-1){this.browserName="Netscape Family";this.browserName2="Chrome"}else{if(n.indexOf("safari")!=-1){this.browserName="Netscape Family";this.browserName2="Safari"}else{if((n.indexOf("mozilla")!=-1)&&(n.indexOf("opera")==-1)){this.browserName="Netscape Family";this.browserName2="Other"}else{if(n.indexOf("opera")!=-1){this.browserName="Netscape Family";this.browserName2="Opera"}else{this.browserName="?";this.browserName2="unknown"}}}}}}}g("[getBrowser()] Detected browser name:"+this.browserName+", "+this.browserName2)}return this.browserName},testUsingActiveX:function(n){var p="JavaWebStart.isInstalled."+n+".0";if(typeof ActiveXObject=="undefined"||!ActiveXObject){g("[testUsingActiveX()] Browser claims to be IE, but no ActiveXObject object?");return false}try{return(new ActiveXObject(p)!=null)}catch(o){return false}},testForMSVM:function(){var o="{08B0E5C0-4FCB-11CF-AAA5-00401C608500}";if(typeof oClientCaps!="undefined"){var n=oClientCaps.getComponentVersion(o,"ComponentID");if((n=="")||(n=="5,0,5000,0")){return false}else{return true}}else{return false}},testUsingMimeTypes:function(o){if(!navigator.mimeTypes){g("[testUsingMimeTypes()] Browser claims to be Netscape family, but no mimeTypes[] array?");return false}for(var p=0;pn[0]){return true}if(o[0]n[1]){return true}if(o[1]n[2]){return true}if(o[2]')}else{if(n=="Netscape Family"&&this.allowPlugin()){this.writeEmbedTag()}}},refresh:function(){navigator.plugins.refresh(false);var n=this.getBrowser();if(n=="Netscape Family"&&this.allowPlugin()){var o=document.getElementById("deployJavaPlugin");if(o==null){this.writeEmbedTag()}}},writeEmbedTag:function(){var n=false;if(navigator.mimeTypes!=null){for(var o=0;o