Sha256: 3e0e474977f1034474657a9c3c3cec69fc569aea1aaa0cd4a85b9cff4e2cbb5f

Contents?: true

Size: 839 Bytes

Versions: 3

Compression:

Stored size: 839 Bytes

Contents

# frozen_string_literal: true

module Browser
  class Chrome < Base
    def id
      :chrome
    end

    def name
      "Chrome"
    end

    def full_version
      # Each regex on its own line to enforce precedence.
      ua[%r{Chrome/([\d.]+)}, 1] ||
        ua[%r{CriOS/([\d.]+)}, 1] ||
        ua[%r{Safari/([\d.]+)}, 1] ||
        ua[%r{AppleWebKit/([\d.]+)}, 1] ||
        "0.0"
    end

    def chromium_based?
      true
    end

    def match?
      ua.match?(/Chrome|CriOS/) &&
        !ua.match?(/PhantomJS|FxiOS|ArchiveBot/) &&
        !opera? &&
        !edge? &&
        !duck_duck_go? &&
        !yandex? &&
        !sputnik? &&
        !samsung_browser? &&
        !huawei_browser? &&
        !miui_browser? &&
        !maxthon? &&
        !qq? &&
        !sougou_browser? &&
        !google_search_app?
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
browser-6.2.0 lib/browser/chrome.rb
browser-6.1.0 lib/browser/chrome.rb
browser-6.0.0 lib/browser/chrome.rb