(Fixed issue 295): added missing Opera browser checks, changed the Opera icon with a transparent one.

git-svn-id: https://beef.googlecode.com/svn/trunk@793 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
antisnatchor
2011-03-14 12:24:55 +00:00
parent a49f46c681
commit 8cd2a1ce7d
5 changed files with 11 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ module Constants
S = 'S' # Safari
K = 'K' # Konqueror
C = 'C' # Chrome
O = 'O' # Opera
ALL = 'ALL' # ALL
UNKNOWN = 'UN' # Unknown
@@ -37,7 +38,8 @@ module Constants
FRIENDLY_IE_NAME = 'Internet Explorer'
FRIENDLY_S_NAME = 'Safari'
FRIENDLY_K_NAME = 'Konqueror'
FRIENDLY_C_NAME = 'Chrome'
FRIENDLY_C_NAME = 'Chrome'
FRIENDLY_O_NAME = 'Opera'
FRIENDLY_UN_NAME = "UNKNOWN"
def self.friendly_name(browser_name)
@@ -48,7 +50,8 @@ module Constants
when IE; return FRIENDLY_IE_NAME
when S; return FRIENDLY_S_NAME
when K; return FRIENDLY_K_NAME
when C; return FRIENDLY_C_NAME
when C; return FRIENDLY_C_NAME
when O; return FRIENDLY_O_NAME
when UNKNOWN; return FRIENDLY_UN_NAME
end
@@ -70,6 +73,8 @@ module Constants
matches << K
when /Chrome/
matches << C
when /Opera/
matches << O
end
end
matches.uniq
@@ -93,6 +98,8 @@ module Constants
AGENT_KONQ_IMG = 'konqueror.png'
AGENT_CHROME_UA_STR = 'Chrome'
AGENT_CHROME_IMG = 'chrome.png'
AGENT_OPERA_UA_STR = 'Opera'
AGENT_OPERA_IMG = 'opera.ico'
end

View File

@@ -67,6 +67,7 @@ class BrowserDetails
return BeEF::Constants::Agents::AGENT_FIREFOX_IMG if browser.eql? "FF" # Firefox
return BeEF::Constants::Agents::AGENT_SAFARI_IMG if browser.eql? "S" # Safari
return BeEF::Constants::Agents::AGENT_CHROME_IMG if browser.eql? "C" # Chrome
return BeEF::Constants::Agents::AGENT_OPERA_IMG if browser.eql? "O" # Opera
BeEF::Constants::Agents::AGENT_UNKNOWN_IMG
end

View File

@@ -43,6 +43,7 @@ class Zombie
return BeEF::Constants::Agents::AGENT_SAFARI_IMG if agent.include? BeEF::Constants::Agents::AGENT_SAFARI_UA_STR
return BeEF::Constants::Agents::AGENT_KONQ_IMG if agent.include? BeEF::Constants::Agents::AGENT_KONQ_UA_STR
return BeEF::Constants::Agents::AGENT_CHROME_IMG if agent.include? BeEF::Constants::Agents::AGENT_CHROME_UA_STR
return BeEF::Constants::Agents::AGENT_OPERA_IMG if agent.include? BeEF::Constants::Agents::AGENT_OPERA_UA_STR
BeEF::Constants::Agents::AGENT_UNKNOWN_IMG
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B