Sha256: 69af6a20d50eea5f71252bc01a9bee57b970ccef1ca93b39b80602a5c2265073
Contents?: true
Size: 1.15 KB
Versions: 11
Compression:
Stored size: 1.15 KB
Contents
class UserAgent module Browsers module Gecko def self.extend?(agent) agent.application && agent.application.product == "Mozilla" end GeckoBrowsers = %w( Firefox Camino Iceweasel Seamonkey ).freeze def browser GeckoBrowsers.detect { |browser| respond_to?(browser) } || super end def version send(browser).version || super end def platform if comment = application.comment if comment[0] == 'compatible' nil elsif /^Windows / =~ comment[0] 'Windows' else comment[0] end end end def security Security[application.comment[1]] || :strong end def os if comment = application.comment i = if comment[1] == 'U' 2 elsif /^Windows / =~ comment[0] 0 else 1 end OperatingSystems.normalize_os(comment[i]) end end def localization if comment = application.comment comment[3] end end end end end
Version data entries
11 entries across 11 versions & 3 rubygems