From 9127bbeb88b15dc10028ee45f5cda90d28a5d85e Mon Sep 17 00:00:00 2001 From: "bcoles@gmail.com" Date: Fri, 16 Sep 2011 06:21:13 +0000 Subject: [PATCH] Patched browser detection Revision 1285 broke browser hooking for Opera, Chrome and Safari. This commit should fix this issue. Also: Fixes issue 514 Fixes issue 503 git-svn-id: https://beef.googlecode.com/svn/trunk@1291 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- core/main/client/browser.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index f6592fa5a..d0f92e773 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -107,7 +107,7 @@ beef.browser = { * @example: beef.browser.isFF4() */ isFF4: function() { - return !!window.globalStorage && !!window.history.replaceState && ((parseInt(window.navigator.userAgent.match(/Firefox\/(\d+)\./)[1], 11)==4)?true:false); + return !!window.globalStorage && !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/4/) != null; }, /** @@ -115,8 +115,7 @@ beef.browser = { * @example: beef.browser.isFF5() */ isFF5: function() { - //abraham.aranguren: !!window.globalStorage returns false on some Firefox 5 browsers such as mine - return !!window.history.replaceState && ((parseInt(window.navigator.userAgent.match(/Firefox\/(\d+)\./)[1], 11)==5)?true:false); + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/5/) != null; }, /** @@ -124,8 +123,7 @@ beef.browser = { * @example: beef.browser.isFF6() */ isFF6: function() { - //abraham.aranguren: !!window.globalStorage returns false on some Firefox 6 browsers such as mine - return !!window.history.replaceState && ((parseInt(window.navigator.userAgent.match(/Firefox\/(\d+)\./)[1], 11)==6)?true:false); + return !!window.history.replaceState && window.navigator.userAgent.match(/Firefox\/6/) != null; }, /** @@ -133,11 +131,9 @@ beef.browser = { * @example: beef.browser.isFF() */ isFF: function() { - result=this.isFF2() || this.isFF3() || this.isFF35() || this.isFF36() || this.isFF4() || this.isFF5() || this.isFF6(); - //alert('result='+result); - return result; + return this.isFF2() || this.isFF3() || this.isFF35() || this.isFF36() || this.isFF4() || this.isFF5() || this.isFF6(); }, - + /** * Returns true if Safari 4.xx * @example: beef.browser.isS4()