(Fixes issue 350) There is no discernible difference between FF4 and FF5 This may prove similar to Chrome now FF are on a shorter release cycle.

As such the difference between FF4 and FF5 has had to fall back to UA string.

git-svn-id: https://beef.googlecode.com/svn/trunk@1032 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
scotty.b.brown@gmail.com
2011-06-27 11:53:39 +00:00
parent b96184a0cf
commit 27f9857d31

View File

@@ -92,7 +92,15 @@ beef.browser = {
* @example: beef.browser.isFF4()
*/
isFF4: function() {
return !!window.globalStorage && !!window.history.replaceState;
return !!window.globalStorage && !!window.history.replaceState && ((parseInt(window.navigator.userAgent.match(/Firefox\/(\d+)\./)[1], 11)==4)?true:false);
},
/**
* Returns true if FF5.
* @example: beef.browser.isFF5()
*/
isFF5: function() {
return !!window.globalStorage && !!window.history.replaceState && ((parseInt(window.navigator.userAgent.match(/Firefox\/(\d+)\./)[1], 11)==5)?true:false);
},
/**
@@ -100,7 +108,7 @@ beef.browser = {
* @example: beef.browser.isFF()
*/
isFF: function() {
return this.isFF2() || this.isFF3() || this.isFF35() || this.isFF36() || this.isFF4();
return this.isFF2() || this.isFF3() || this.isFF35() || this.isFF36() || this.isFF4() || this.isFF5();
},
/**
@@ -246,6 +254,7 @@ beef.browser = {
FF35: this.isFF35(), // Firefox 3.5
FF36: this.isFF36(), // Firefox 3.6
FF4: this.isFF4(), // Firefox 4
FF5: this.isFF5(), // Firefox 5
FF: this.isFF(), // Firefox any version
IE6: this.isIE6(), // Internet Explorer 6
IE9: this.isIE9(), // Internet Explorer 9
@@ -282,6 +291,7 @@ beef.browser = {
if (this.isFF35()) { return '3.5'}; // Firefox 3.5
if (this.isFF36()) { return '3.6'}; // Firefox 3.6
if (this.isFF4()) { return '4' }; // Firefox 4
if (this.isFF5()) { return '5' }; // Firefox 5
if (this.isIE6()) { return '6' }; // Internet Explorer 6
if (this.isIE9()) { return '9' }; // Internet Explorer 9
if (this.isIE8()) { return '8' }; // Internet Explorer 8
@@ -719,4 +729,4 @@ beef.browser = {
};
beef.regCmp('beef.browser');
beef.regCmp('beef.browser');