Module: UserAgent::Browsers::Webkit
- Defined in:
- lib/user_agent/browsers/webkit.rb
Constant Summary collapse
- BuildVersions =
{ "125.12" => "1.2.4", "312.6" => "1.3.2", "412.2.2" => "2.0", "412.5" => "2.0.1", "416.13" => "2.0.2", "417.9.3" => "2.0.3", "419.3" => "2.0.4" }.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #browser ⇒ Object
- #build ⇒ Object
- #localization ⇒ Object
- #os ⇒ Object
- #platform ⇒ Object
- #security ⇒ Object
-
#version ⇒ Object
Prior to Safari 3, the user agent did not include a version number.
- #webkit ⇒ Object
Class Method Details
.extend?(agent) ⇒ Boolean
4 5 6 |
# File 'lib/user_agent/browsers/webkit.rb', line 4 def self.extend?(agent) agent.detect { |useragent| useragent.product == "Safari" } end |
Instance Method Details
#browser ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/user_agent/browsers/webkit.rb', line 8 def browser if detect_product("Chrome") "Chrome" else "Safari" end end |
#build ⇒ Object
16 17 18 |
# File 'lib/user_agent/browsers/webkit.rb', line 16 def build safari.version end |
#localization ⇒ Object
57 58 59 |
# File 'lib/user_agent/browsers/webkit.rb', line 57 def localization application.comment[3] end |
#os ⇒ Object
53 54 55 |
# File 'lib/user_agent/browsers/webkit.rb', line 53 def os OperatingSystems.normalize_os(application.comment[2]) end |
#platform ⇒ Object
41 42 43 |
# File 'lib/user_agent/browsers/webkit.rb', line 41 def platform application.comment[0] end |
#security ⇒ Object
49 50 51 |
# File 'lib/user_agent/browsers/webkit.rb', line 49 def security Security[application.comment[1]] end |
#version ⇒ Object
Prior to Safari 3, the user agent did not include a version number
31 32 33 34 35 36 37 38 39 |
# File 'lib/user_agent/browsers/webkit.rb', line 31 def version if browser == "Chrome" chrome.version elsif product = detect_product("Version") product.version else BuildVersions[build] end end |
#webkit ⇒ Object
45 46 47 |
# File 'lib/user_agent/browsers/webkit.rb', line 45 def webkit detect { |useragent| useragent.product == "AppleWebKit" } end |