class UserAgent::Browsers::Gecko

Constants

GeckoBrowsers

Public Class Methods

extend?(agent) click to toggle source
# File lib/user_agent/browsers/gecko.rb, line 4
def self.extend?(agent)
  agent.application && agent.application.product == "Mozilla"
end

Public Instance Methods

browser() click to toggle source
Calls superclass method UserAgent::Browsers::Base#browser
# File lib/user_agent/browsers/gecko.rb, line 16
def browser
  GeckoBrowsers.detect { |browser| respond_to?(browser) } || super
end
localization() click to toggle source
# File lib/user_agent/browsers/gecko.rb, line 59
def localization
  if comment = application.comment
    comment[3]
  end
end
os() click to toggle source
# File lib/user_agent/browsers/gecko.rb, line 41
def os
  if comment = application.comment
    i = if comment[1] == 'U'
          2
        elsif /^Windows / =~ comment[0] || /^Android/ =~ comment[0]
          0
        elsif comment[0] == 'Mobile'
          nil
        else
          1
        end

    return nil if i.nil?
    
    OperatingSystems.normalize_os(comment[i])
  end
end
platform() click to toggle source
# File lib/user_agent/browsers/gecko.rb, line 25
def platform
  if comment = application.comment
    if comment[0] == 'compatible' || comment[0] == 'Mobile'
      nil
    elsif /^Windows / =~ comment[0]
      'Windows'
    else
      comment[0]
    end
  end
end
security() click to toggle source
# File lib/user_agent/browsers/gecko.rb, line 37
def security
  Security[application.comment[1]] || :strong
end
version() click to toggle source
Calls superclass method UserAgent::Browsers::Base#version
# File lib/user_agent/browsers/gecko.rb, line 20
def version
  v = send(browser).version
  v.nil? ? super : v
end