class Browser::InternetExplorer
Constants
- TRIDENT_MAPPING
msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx#TriToken
Public Instance Methods
compatibility_view?()
click to toggle source
Detect if IE is running in compatibility mode.
# File lib/browser/internet_explorer.rb, line 41 def compatibility_view? trident_version && msie_version.to_i < (trident_version.to_i + 4) end
full_version()
click to toggle source
# File lib/browser/internet_explorer.rb, line 22 def full_version "#{ie_version}.0" end
id()
click to toggle source
# File lib/browser/internet_explorer.rb, line 14 def id :ie end
match?()
click to toggle source
# File lib/browser/internet_explorer.rb, line 36 def match? msie? || modern_ie? end
msie_full_version()
click to toggle source
# File lib/browser/internet_explorer.rb, line 26 def msie_full_version (ua.match(%r{MSIE ([\d.]+)|Trident/.*?; rv:([\d.]+)}) && (Regexp.last_match(1) || Regexp.last_match(2))) || "0.0" end
msie_version()
click to toggle source
# File lib/browser/internet_explorer.rb, line 32 def msie_version msie_full_version.split(".").first end
name()
click to toggle source
# File lib/browser/internet_explorer.rb, line 18 def name "Internet Explorer" end
Private Instance Methods
ie_version()
click to toggle source
# File lib/browser/internet_explorer.rb, line 45 def ie_version TRIDENT_MAPPING[trident_version] || msie_version end
modern_ie?()
click to toggle source
# File lib/browser/internet_explorer.rb, line 58 def modern_ie? ua.match?(%r{Trident/.*?; rv:(.*?)}) end
msie?()
click to toggle source
# File lib/browser/internet_explorer.rb, line 54 def msie? ua.include?("MSIE") && !ua.include?("Opera") end
trident_version()
click to toggle source
Return the trident version.
# File lib/browser/internet_explorer.rb, line 50 def trident_version ua.match(%r{Trident/([0-9.]+)}) && Regexp.last_match(1) end