Module: UserAgent::Browsers::InternetExplorer
- Defined in:
- lib/user_agent/browsers/internet_explorer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #browser ⇒ Object
-
#chromeframe ⇒ Object
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.
- #compatibility ⇒ Object
- #compatibility_view? ⇒ Boolean
- #compatible? ⇒ Boolean
- #os ⇒ Object
- #platform ⇒ Object
- #version ⇒ Object
Class Method Details
.extend?(agent) ⇒ Boolean
4 5 6 7 8 9 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 4 def self.extend?(agent) agent.application && agent.application.comment && agent.application.comment[0] == "compatible" && agent.application.comment[1] =~ /MSIE/ end |
Instance Method Details
#browser ⇒ Object
11 12 13 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 11 def browser "Internet Explorer" end |
#chromeframe ⇒ Object
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
34 35 36 37 38 39 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 34 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 |
#compatibility ⇒ Object
19 20 21 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 19 def compatibility application.comment[0] end |
#compatibility_view? ⇒ Boolean
27 28 29 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 27 def compatibility_view? version == "7.0" && application.comment.detect { |c| c['Trident/'] } end |
#compatible? ⇒ Boolean
23 24 25 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 23 def compatible? compatibility == "compatible" end |
#os ⇒ Object
45 46 47 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 45 def os OperatingSystems.normalize_os(application.comment[2]) end |
#platform ⇒ Object
41 42 43 |
# File 'lib/user_agent/browsers/internet_explorer.rb', line 41 def platform "Windows" end |