Module: UserAgent::Browsers::InternetExplorer

Defined in:
lib/user_agent/browsers/internet_explorer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extend?(agent) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
# File 'lib/user_agent/browsers/internet_explorer.rb', line 4

def self.extend?(agent)
  agent.application &&
    agent.application.comment &&
    agent.application.comment[0] == "compatible" &&
    agent.application.comment[1] =~ /MSIE/
end

Instance Method Details

#browserObject



11
12
13
# File 'lib/user_agent/browsers/internet_explorer.rb', line 11

def browser
  "Internet Explorer"
end

#chromeframeObject

Before version 4.0, Chrome Frame declared itself (unversioned) in a comment; as of 4.0 it can declare itself versioned in a comment or as a separate product with a version



31
32
33
34
35
36
# File 'lib/user_agent/browsers/internet_explorer.rb', line 31

def chromeframe
  cf = application.comment.include?("chromeframe") || detect_product("chromeframe")
  return cf if cf
  cf_comment = application.comment.detect{|c| c['chromeframe/']}
  cf_comment ? UserAgent.new(*cf_comment.split('/', 2)) : nil
end

#compatibilityObject



19
20
21
# File 'lib/user_agent/browsers/internet_explorer.rb', line 19

def compatibility
  application.comment[0]
end

#compatible?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/user_agent/browsers/internet_explorer.rb', line 23

def compatible?
  compatibility == "compatible"
end

#osObject



42
43
44
# File 'lib/user_agent/browsers/internet_explorer.rb', line 42

def os
  OperatingSystems.normalize_os(application.comment[2])
end

#platformObject



38
39
40
# File 'lib/user_agent/browsers/internet_explorer.rb', line 38

def platform
  "Windows"
end

#versionObject



15
16
17
# File 'lib/user_agent/browsers/internet_explorer.rb', line 15

def version
  application.comment[1].sub("MSIE ", "")
end