Sha256: d2916f8fa88ae3d214d8d9113675aa83de425b6f346fecf6f2ea5c97765750e7

Contents?: true

Size: 1.16 KB

Versions: 15

Compression:

Stored size: 1.16 KB

Contents

class UserAgent
  module Browsers
    module InternetExplorer
      def self.extend?(agent)
        agent.application &&
          agent.application.comment &&
          agent.application.comment[0] == "compatible" &&
          agent.application.comment[1] =~ /MSIE/
      end

      def browser
        "Internet Explorer"
      end

      def version
        application.comment[1].sub("MSIE ", "")
      end

      def compatibility
        application.comment[0]
      end

      def compatible?
        compatibility == "compatible"
      end

      # Before version 4.0, Chrome Frame declared itself (unversioned) in a comment;
      # as of 4.0 it can declare itself versioned in a comment
      # or as a separate product with a version

      def chromeframe
        cf = application.comment.include?("chromeframe") || detect_product("chromeframe")
        return cf if cf
        cf_comment = application.comment.detect{|c| c['chromeframe/']}
        cf_comment ? UserAgent.new(*cf_comment.split('/', 2)) : nil
      end

      def platform
        "Windows"
      end

      def os
        OperatingSystems.normalize_os(application.comment[2])
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
useragent-0.4.12 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.11 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.10 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.9 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.8 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.7 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.6 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.5 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.4 lib/user_agent/browsers/internet_explorer.rb
useragent-fl-0.4.3 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.3 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.2 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.1 lib/user_agent/browsers/internet_explorer.rb
useragent-0.4.0 lib/user_agent/browsers/internet_explorer.rb
useragent-0.3.2 lib/user_agent/browsers/internet_explorer.rb