Add support for Odyssey browser

This commit is contained in:
Brendan Coles
2016-01-27 19:06:36 +00:00
parent 5b5a1b84b9
commit 2d2edc6858
2 changed files with 15 additions and 0 deletions

View File

@@ -43,6 +43,14 @@ beef.browser = {
return window.navigator.userAgent.match(/Midori\/\d+\.\d/) != null;
},
/**
* Returns true if Odyssey
* @example: beef.browser.isOdyssey()
*/
isOdyssey: function () {
return (window.navigator.userAgent.match(/Odyssey Web Browser/) != null && window.navigator.userAgent.match(/OWB\/\d+\.\d/) != null);
},
/**
* Returns true if IE6.
* @example: beef.browser.isIE6()
@@ -1872,6 +1880,10 @@ beef.browser = {
return 'MI'
}
; // Midori any version
if (this.isOdyssey()) {
return 'OD'
}
; // Odyssey any version
return 'UNKNOWN'; // Unknown UA
},

View File

@@ -19,6 +19,7 @@ module Constants
O = 'O' # Opera
A = 'A' # Avant
MI = 'MI' # Midori
OD = 'OD' # Odyssey
ALL = 'ALL' # ALL
UNKNOWN = 'UN' # Unknown
@@ -31,6 +32,7 @@ module Constants
FRIENDLY_O_NAME = 'Opera'
FRIENDLY_A_NAME = 'Avant'
FRIENDLY_MI_NAME = 'Midori'
FRIENDLY_OD_NAME = 'Odyssey'
FRIENDLY_UN_NAME = 'UNKNOWN'
# Attempt to retrieve a browser's friendly name
@@ -48,6 +50,7 @@ module Constants
when O ; return FRIENDLY_O_NAME
when A ; return FRIENDLY_A_NAME
when MI ; return FRIENDLY_MI_NAME
when OD ; return FRIENDLY_OD_NAME
when UNKNOWN; return FRIENDLY_UN_NAME
end