module UserAgent::Browsers::Webkit

def self.extend?(agent)

def self.extend?(agent)
  agent.detect { |useragent| useragent.product == "Safari" || useragent.product == "Chrome" }
end

def browser

def browser
  if os =~ /Android/
    'Android'
  elsif detect_product('Chrome')
    'Chrome'
  elsif platform == 'webOS' || platform == 'BlackBerry'
    platform
  else
    'Safari'
  end
end

def build

def build
  webkit.version
end

def localization

def localization
  application.comment[3]
end

def os

def os
  if platform == 'webOS'
    "Palm #{last.product} #{last.version}"
  else
    OperatingSystems.normalize_os(application.comment[2])
  end
end

def platform

def platform
  if application.comment[0] =~ /webOS/
    'webOS'
  else
    application.comment[0]
  end
end

def security

def security
  Security[application.comment[1]]
end

def version

Prior to Safari 3, the user agent did not include a version number
def version
  if os =~ /CPU (?:iPhone |iPod )?OS ([\d_]+) like Mac OS X/
    $1.gsub(/_/, '.')
  elsif product = detect_product('Version')
    product.version
  elsif browser == 'Chrome'
    chrome.version
  else
    BuildVersions[build]
  end
end

def webkit

def webkit
  detect { |useragent| useragent.product == "AppleWebKit" }
end

def webkit?

def webkit?
  true
end