class UserAgent::Browsers::InternetExplorer
def self.extend?(agent)
def self.extend?(agent) agent.application && agent.application.comment && (agent.application.comment[1] =~ /MSIE/ || agent.application.comment.join('; ') =~ /Trident.+rv:/) end
def browser
def browser "Internet Explorer" end
def chromeframe
as of 4.0 it can declare itself versioned in a comment
Before version 4.0, Chrome Frame declared itself (unversioned) in a comment;
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
def compatibility_view?
def compatibility_view? trident_version && version < real_version end
def os
def os OperatingSystems.normalize_os(application.comment.join('; ').match(/Windows NT [\d\.]+|Windows Phone (OS )?[\d\.]+/).to_s) end
def platform
def platform "Windows" end
def real_version
def real_version [trident_version, version].sort.last end
def trident_version
def trident_version if trident = application.comment.detect { |c| c['Trident/'] } trident_version = TRIDENT_ENGINES.fetch(trident, trident) Version.new(trident_version) end end
def version
def version str = application.comment.join('; ')[/(MSIE\s|rv:)([\d\.]+)/, 2] Version.new(str) end