Sha256: 56a9ae90a283ed94102a14e50f23eb8f0d1bde6d42d3bd64423c88b360138dbd

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 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 match?
      ua =~ /Chrome|CriOS/ &&
        ua !~ /PhantomJS|FxiOS|YaBrowser|SputnikBrowser/ &&
        !opera? &&
        !edge?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
browser-2.7.1 lib/browser/chrome.rb