Class: Browser::Chrome
- Inherits:
-
Base
- Object
- Base
- Browser::Chrome
show all
- Defined in:
- lib/browser/chrome.rb
Instance Attribute Summary
Attributes inherited from Base
#accept_language, #ua
Instance Method Summary
collapse
Methods inherited from Base
#bot, #bot?, #chrome?, #compatibility_view?, #core_media?, #device, #edge?, #firefox?, #ie?, #initialize, #known?, #meta, #micro_messenger?, #modern?, #msie_full_version, #msie_version, #nokia?, #opera?, #opera_mini?, #phantom_js?, #platform, #proxy?, #quicktime?, #safari?, #safari_webapp_mode?, #to_s, #uc_browser?, #version, #webkit?, #webkit_full_version, #weibo?, #yandex?
Constructor Details
This class inherits a constructor from Browser::Base
Instance Method Details
#full_version ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/browser/chrome.rb', line 12
def full_version
ua[%r[Chrome/([\d.]+)], 1] ||
ua[%r[CriOS/([\d.]+)], 1] ||
ua[%r[Safari/([\d.]+)], 1] ||
ua[%r[AppleWebKit/([\d.]+)], 1] ||
"0.0"
end
|
#id ⇒ Object
4
5
6
|
# File 'lib/browser/chrome.rb', line 4
def id
:chrome
end
|
#match? ⇒ Boolean
21
22
23
|
# File 'lib/browser/chrome.rb', line 21
def match?
ua =~ /Chrome|CriOS/ && !opera? && !edge?
end
|
#name ⇒ Object
8
9
10
|
# File 'lib/browser/chrome.rb', line 8
def name
"Chrome"
end
|