browser 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -8
- data/CHANGELOG.md +9 -0
- data/README.md +12 -1
- data/Rakefile +1 -1
- data/bot_exceptions.yml +2 -0
- data/bots.yml +6 -2
- data/lib/browser.rb +1 -0
- data/lib/browser/accept_language.rb +5 -1
- data/lib/browser/action_controller.rb +1 -0
- data/lib/browser/aliases.rb +32 -0
- data/lib/browser/alipay.rb +1 -0
- data/lib/browser/base.rb +37 -31
- data/lib/browser/blackberry.rb +1 -0
- data/lib/browser/bot.rb +1 -0
- data/lib/browser/browser.rb +1 -0
- data/lib/browser/chrome.rb +1 -0
- data/lib/browser/detect_version.rb +1 -0
- data/lib/browser/device.rb +2 -1
- data/lib/browser/device/base.rb +1 -0
- data/lib/browser/device/blackberry_playbook.rb +1 -0
- data/lib/browser/device/ipad.rb +1 -0
- data/lib/browser/device/iphone.rb +1 -0
- data/lib/browser/device/ipod_touch.rb +1 -0
- data/lib/browser/device/kindle.rb +1 -0
- data/lib/browser/device/kindle_fire.rb +1 -0
- data/lib/browser/device/playstation3.rb +1 -0
- data/lib/browser/device/playstation4.rb +1 -0
- data/lib/browser/device/psp.rb +1 -0
- data/lib/browser/device/psvita.rb +1 -0
- data/lib/browser/device/surface.rb +1 -0
- data/lib/browser/device/tv.rb +1 -0
- data/lib/browser/device/unknown.rb +1 -0
- data/lib/browser/device/wii.rb +1 -0
- data/lib/browser/device/wiiu.rb +1 -0
- data/lib/browser/device/xbox_360.rb +1 -0
- data/lib/browser/device/xbox_one.rb +1 -0
- data/lib/browser/edge.rb +1 -0
- data/lib/browser/firefox.rb +1 -0
- data/lib/browser/generic.rb +1 -0
- data/lib/browser/internet_explorer.rb +1 -0
- data/lib/browser/meta.rb +1 -0
- data/lib/browser/meta/base.rb +1 -0
- data/lib/browser/meta/device.rb +1 -0
- data/lib/browser/meta/generic_browser.rb +1 -0
- data/lib/browser/meta/id.rb +1 -0
- data/lib/browser/meta/ie.rb +1 -0
- data/lib/browser/meta/ios.rb +1 -0
- data/lib/browser/meta/mobile.rb +1 -0
- data/lib/browser/meta/modern.rb +1 -0
- data/lib/browser/meta/platform.rb +1 -0
- data/lib/browser/meta/proxy.rb +1 -0
- data/lib/browser/meta/safari.rb +1 -0
- data/lib/browser/meta/tablet.rb +1 -0
- data/lib/browser/meta/webkit.rb +1 -0
- data/lib/browser/micro_messenger.rb +1 -0
- data/lib/browser/middleware.rb +1 -0
- data/lib/browser/middleware/context.rb +1 -0
- data/lib/browser/middleware/context/additions.rb +1 -0
- data/lib/browser/middleware/context/url_methods.rb +1 -0
- data/lib/browser/nokia.rb +1 -0
- data/lib/browser/opera.rb +1 -0
- data/lib/browser/phantom_js.rb +1 -0
- data/lib/browser/platform.rb +5 -4
- data/lib/browser/platform/adobe_air.rb +1 -0
- data/lib/browser/platform/android.rb +1 -0
- data/lib/browser/platform/base.rb +1 -0
- data/lib/browser/platform/blackberry.rb +1 -0
- data/lib/browser/platform/chrome_os.rb +1 -0
- data/lib/browser/platform/firefox_os.rb +1 -0
- data/lib/browser/platform/ios.rb +1 -0
- data/lib/browser/platform/linux.rb +1 -0
- data/lib/browser/platform/mac.rb +1 -0
- data/lib/browser/platform/other.rb +1 -0
- data/lib/browser/platform/windows.rb +1 -0
- data/lib/browser/platform/windows_mobile.rb +1 -0
- data/lib/browser/platform/windows_phone.rb +1 -0
- data/lib/browser/qq.rb +1 -0
- data/lib/browser/rails.rb +1 -0
- data/lib/browser/safari.rb +1 -0
- data/lib/browser/testing.rb +1 -0
- data/lib/browser/uc_browser.rb +1 -0
- data/lib/browser/version.rb +2 -1
- data/lib/browser/weibo.rb +1 -0
- data/test/browser_test.rb +5 -1
- data/test/middleware_test.rb +1 -0
- data/test/rails_test.rb +1 -0
- data/test/sample_app.rb +2 -1
- data/test/test_helper.rb +3 -2
- data/test/ua.yml +1 -0
- data/test/ua_bots.yml +4 -0
- data/test/unit/accept_language_test.rb +38 -1
- data/test/unit/adobe_air_test.rb +1 -0
- data/test/unit/aliases_test.rb +42 -0
- data/test/unit/alipay_test.rb +6 -0
- data/test/unit/android_test.rb +1 -0
- data/test/unit/blackberry_test.rb +1 -0
- data/test/unit/bots_test.rb +11 -0
- data/test/unit/chrome_test.rb +11 -0
- data/test/unit/console_test.rb +1 -0
- data/test/unit/device_test.rb +8 -0
- data/test/unit/edge_test.rb +60 -0
- data/test/unit/firefox_test.rb +6 -0
- data/test/unit/generic_test.rb +1 -0
- data/test/unit/{ie_test.rb → internet_explorer_test.rb} +1 -50
- data/test/unit/ios_app_test.rb +1 -0
- data/test/unit/ios_test.rb +1 -0
- data/test/unit/kindle_test.rb +1 -0
- data/test/unit/meta_test.rb +1 -0
- data/test/unit/micro_messenger_test.rb +6 -0
- data/test/unit/nokia_test.rb +6 -0
- data/test/unit/opera_test.rb +11 -0
- data/test/unit/platform_test.rb +3 -0
- data/test/unit/proxy_test.rb +1 -0
- data/test/unit/qq_test.rb +1 -0
- data/test/unit/safari_test.rb +6 -0
- data/test/unit/uc_browser_test.rb +6 -0
- data/test/unit/weibo_test.rb +7 -1
- data/test/unit/windows_phone_test.rb +1 -0
- data/test/unit/windows_test.rb +1 -0
- metadata +10 -6
- data/gemfiles/rails3.gemfile +0 -4
data/test/rails_test.rb
CHANGED
data/test/sample_app.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "rails"
|
3
4
|
require "browser"
|
4
5
|
|
5
6
|
class PagesController < ActionController::Base
|
6
7
|
def home
|
7
|
-
render
|
8
|
+
render html: "#{browser.name}:#{browser.accept_language.first.full}"
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
data/test/test_helper.rb
CHANGED
data/test/ua.yml
CHANGED
@@ -46,6 +46,7 @@ IE9: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)'
|
|
46
46
|
IE9_CHROME_FRAME: 'Mozilla/5.0 (Windows NT 6.1; WOW64; chromeframe/26.0.1410.43) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31'
|
47
47
|
IE9_COMPAT: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)'
|
48
48
|
IE_WITHOUT_TRIDENT: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.0) .NET CLR 2.0.50727)
|
49
|
+
IOS3: 'Mozilla/5.0 (iPad; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10'
|
49
50
|
IOS4: 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7'
|
50
51
|
IOS5: 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3'
|
51
52
|
IOS6: 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'
|
data/test/ua_bots.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
ADLXBOT: 'Mozilla/5.0 (compatible; adidxbot/2.0; +http://www.bing.com/bingbot.htm)'
|
2
|
+
APIS_GOOGLE: 'APIs-Google; (+https://developers.google.com/webmasters/APIs-Google.html)'
|
2
3
|
APPLE_BOT: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 (Applebot/0.1)'
|
3
4
|
ASK: 'Mozilla/2.0 (compatible; Ask Jeeves/Teoma; +http://sp.ask.com/docs/about/tech_crawling.html)'
|
4
5
|
AWS_ELB: ELB-HealthChecker/1.0
|
@@ -27,11 +28,14 @@ MSNBOT: 'msnbot/2.0b (+http://search.msn.com/msnbot.htm)'
|
|
27
28
|
MSNBOT_MEDIA: 'msnbot-media/1.1 (+http://search.msn.com/msnbot.htm)'
|
28
29
|
NETCRAFT2: Netcraft SSL Server Survey - contact info@netcraft.com
|
29
30
|
NETCRAFT: Mozilla/5.0 (compatible; NetcraftSurveyAgent/1.0; +info@netcraft.com)
|
31
|
+
NEWRELICPINGER: NewRelicPinger/1.0 (12345)
|
30
32
|
PRIVACYAWAREBOT: 'Mozilla/5.0 (compatible; PrivacyAwareBot/1.1; +http://www.privacyaware.org)'
|
33
|
+
PROXIMIC: 'Mozilla/5.0 (compatible; proximic; +http://www.proximic.com/info/spider.php)'
|
31
34
|
QUERYSEEKER: 'QuerySeekerSpider ( http://queryseeker.com/bot.html )'
|
32
35
|
SCRAPY: 'Scrapy/0.18.4 (+http://scrapy.org)'
|
33
36
|
SEOKICKS: 'Mozilla/5.0 (compatible; SEOkicks-Robot; +http://www.seokicks.de/robot.html)'
|
34
37
|
SISTRIX: 'Mozilla/5.0 (compatible; SISTRIX Crawler; http://crawler.sistrix.net/)'
|
38
|
+
SOCIALRANKIO: SocialRankIOBot; http://socialrank.io/about
|
35
39
|
SQUIDER: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Squider/0.01'
|
36
40
|
STRIPE: 'Stripe/1.0 (+https://stripe.com/docs/webhooks)'
|
37
41
|
TINEYE: 'TinEye-bot/0.51 (see http://www.tineye.com/crawler.html)'
|
@@ -1,10 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "test_helper"
|
3
4
|
|
4
5
|
class AcceptLanguageTest < Minitest::Test
|
5
6
|
def assert_language(item, expect = {})
|
6
7
|
assert_equal expect[:code], item.code, "failed code comparison"
|
7
|
-
|
8
|
+
|
9
|
+
if expect[:region]
|
10
|
+
assert_equal expect[:region], item.region, "failed region comparison"
|
11
|
+
else
|
12
|
+
assert_nil item.region,
|
13
|
+
"region should be nil; got #{item.region.inspect} instead"
|
14
|
+
end
|
15
|
+
|
8
16
|
assert_equal expect[:quality], item.quality, "failed quality comparison"
|
9
17
|
end
|
10
18
|
|
@@ -26,6 +34,35 @@ class AcceptLanguageTest < Minitest::Test
|
|
26
34
|
assert_nil language.name
|
27
35
|
end
|
28
36
|
|
37
|
+
test "returns code" do
|
38
|
+
language = Browser::AcceptLanguage.new("en-GB")
|
39
|
+
assert_equal "en", language.code
|
40
|
+
end
|
41
|
+
|
42
|
+
test "returns formatted code" do
|
43
|
+
%w[EN-GB En-GB eN-GB].each do |locale|
|
44
|
+
language = Browser::AcceptLanguage.new(locale)
|
45
|
+
assert_equal "en", language.code
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
test "returns region" do
|
50
|
+
language = Browser::AcceptLanguage.new("en-GB")
|
51
|
+
assert_equal "GB", language.region
|
52
|
+
end
|
53
|
+
|
54
|
+
test "returns formatted region" do
|
55
|
+
%w[en-gb en-Gb en-gB].each do |locale|
|
56
|
+
language = Browser::AcceptLanguage.new(locale)
|
57
|
+
assert_equal "GB", language.region
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
test "returns nil for language without region" do
|
62
|
+
language = Browser::AcceptLanguage.new("en")
|
63
|
+
assert_nil language.region
|
64
|
+
end
|
65
|
+
|
29
66
|
test "parses language with quality" do
|
30
67
|
language = Browser::AcceptLanguage.new("en-GB;q=0.8")
|
31
68
|
assert_language language, code: "en", region: "GB", quality: 0.8
|
data/test/unit/adobe_air_test.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
require "browser/aliases"
|
5
|
+
|
6
|
+
class AliasesTest < Minitest::Test
|
7
|
+
class BrowserMock
|
8
|
+
include Browser::Aliases
|
9
|
+
|
10
|
+
def platform
|
11
|
+
@platform ||= Object.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def device
|
15
|
+
@device ||= Object.new
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Browser::Aliases::PLATFORM_ALIASES.each do |method_name|
|
20
|
+
test "adds #{method_name.inspect} as a platform alias" do
|
21
|
+
browser = BrowserMock.new
|
22
|
+
|
23
|
+
browser.platform.define_singleton_method(method_name) do
|
24
|
+
:called
|
25
|
+
end
|
26
|
+
|
27
|
+
assert_equal :called, browser.public_send(method_name)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
Browser::Aliases::DEVICE_ALIASES.each do |method_name|
|
32
|
+
test "adds #{method_name.inspect} as a device alias" do
|
33
|
+
browser = BrowserMock.new
|
34
|
+
|
35
|
+
browser.device.define_singleton_method(method_name) do
|
36
|
+
:called
|
37
|
+
end
|
38
|
+
|
39
|
+
assert_equal :called, browser.public_send(method_name)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/test/unit/alipay_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "test_helper"
|
3
4
|
|
4
5
|
class AlipayTest < Minitest::Test
|
@@ -19,4 +20,9 @@ class AlipayTest < Minitest::Test
|
|
19
20
|
assert_equal "Alipay", browser.name
|
20
21
|
assert_equal "9.0.1.073001", browser.full_version
|
21
22
|
end
|
23
|
+
|
24
|
+
test "detects version by range" do
|
25
|
+
browser = Browser.new(Browser["ALIPAY_IOS"])
|
26
|
+
assert browser.alipay?(%w[>=2 <3])
|
27
|
+
end
|
22
28
|
end
|
data/test/unit/android_test.rb
CHANGED
data/test/unit/bots_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "test_helper"
|
3
4
|
|
4
5
|
class BotsTest < Minitest::Test
|
@@ -87,4 +88,14 @@ class BotsTest < Minitest::Test
|
|
87
88
|
assert browser.platform.android?
|
88
89
|
refute browser.bot?
|
89
90
|
end
|
91
|
+
|
92
|
+
test "extends list in runtime" do
|
93
|
+
browser = Browser.new("Faraday/0.9.2")
|
94
|
+
refute browser.bot?
|
95
|
+
|
96
|
+
Browser::Bot.bots["faraday"] = "Faraday"
|
97
|
+
assert browser.bot?
|
98
|
+
|
99
|
+
Browser::Bot.bots.delete("faraday")
|
100
|
+
end
|
90
101
|
end
|
data/test/unit/chrome_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "test_helper"
|
3
4
|
|
4
5
|
class ChromeTest < Minitest::Test
|
@@ -55,6 +56,11 @@ class ChromeTest < Minitest::Test
|
|
55
56
|
assert_equal "41", browser.version
|
56
57
|
end
|
57
58
|
|
59
|
+
test "detects yandex version by range" do
|
60
|
+
browser = Browser.new(Browser["YANDEX_BROWSER"])
|
61
|
+
assert browser.yandex?(%w[>=41 <42])
|
62
|
+
end
|
63
|
+
|
58
64
|
test "detects chrome frame" do
|
59
65
|
browser = Browser.new(Browser["IE9_CHROME_FRAME"])
|
60
66
|
|
@@ -64,4 +70,9 @@ class ChromeTest < Minitest::Test
|
|
64
70
|
assert_equal "26.0.1410.43", browser.full_version
|
65
71
|
assert_equal "26", browser.version
|
66
72
|
end
|
73
|
+
|
74
|
+
test "detects version by range" do
|
75
|
+
browser = Browser.new(Browser["CHROME"])
|
76
|
+
assert browser.chrome?(%w[>=5 <6])
|
77
|
+
end
|
67
78
|
end
|
data/test/unit/console_test.rb
CHANGED
data/test/unit/device_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "test_helper"
|
3
4
|
|
4
5
|
class DeviceTest < Minitest::Test
|
@@ -36,6 +37,13 @@ class DeviceTest < Minitest::Test
|
|
36
37
|
assert_equal "iPad", device.name
|
37
38
|
end
|
38
39
|
|
40
|
+
test "detect old ipad" do
|
41
|
+
device = Browser::Device.new(Browser["IOS3"])
|
42
|
+
assert device.ipad?
|
43
|
+
assert_equal :ipad, device.id
|
44
|
+
assert_equal "iPad", device.name
|
45
|
+
end
|
46
|
+
|
39
47
|
test "detect ipod" do
|
40
48
|
device = Browser::Device.new(Browser["IPOD"])
|
41
49
|
assert device.ipod_touch?
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class EdgeTest < ActionController::TestCase
|
6
|
+
test "detects Microsoft Edge" do
|
7
|
+
browser = Browser.new(Browser["MS_EDGE"])
|
8
|
+
|
9
|
+
assert_equal :edge, browser.id
|
10
|
+
assert_equal "Microsoft Edge", browser.name
|
11
|
+
assert_equal "12.0", browser.full_version
|
12
|
+
assert_equal "12", browser.version
|
13
|
+
assert browser.platform.windows10?
|
14
|
+
assert browser.edge?
|
15
|
+
assert browser.modern?
|
16
|
+
refute browser.webkit?
|
17
|
+
refute browser.chrome?
|
18
|
+
refute browser.safari?
|
19
|
+
refute browser.device.mobile?
|
20
|
+
end
|
21
|
+
|
22
|
+
test "detects Microsoft Edge in compatibility view" do
|
23
|
+
browser = Browser.new(Browser["MS_EDGE_COMPAT"])
|
24
|
+
|
25
|
+
assert_equal :edge, browser.id
|
26
|
+
assert_equal "Microsoft Edge", browser.name
|
27
|
+
assert_equal "12.0", browser.full_version
|
28
|
+
assert_equal "12", browser.version
|
29
|
+
assert_equal "7.0", browser.msie_full_version
|
30
|
+
assert_equal "7", browser.msie_version
|
31
|
+
assert browser.edge?
|
32
|
+
assert browser.compatibility_view?
|
33
|
+
refute browser.modern?
|
34
|
+
refute browser.webkit?
|
35
|
+
refute browser.chrome?
|
36
|
+
refute browser.safari?
|
37
|
+
refute browser.device.mobile?
|
38
|
+
end
|
39
|
+
|
40
|
+
test "detects Microsoft Edge Mobile" do
|
41
|
+
browser = Browser.new(Browser["MS_EDGE_MOBILE"])
|
42
|
+
|
43
|
+
assert_equal :edge, browser.id
|
44
|
+
assert_equal "Microsoft Edge", browser.name
|
45
|
+
assert_equal "12.0", browser.full_version
|
46
|
+
assert_equal "12", browser.version
|
47
|
+
refute browser.platform.windows10?
|
48
|
+
assert browser.platform.windows_phone?
|
49
|
+
assert browser.edge?
|
50
|
+
assert browser.modern?
|
51
|
+
refute browser.webkit?
|
52
|
+
refute browser.chrome?
|
53
|
+
refute browser.safari?
|
54
|
+
end
|
55
|
+
|
56
|
+
test "detects version by range" do
|
57
|
+
browser = Browser.new(Browser["MS_EDGE"])
|
58
|
+
assert browser.edge?(%w[>=12 <13])
|
59
|
+
end
|
60
|
+
end
|
data/test/unit/firefox_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "test_helper"
|
3
4
|
|
4
5
|
class FirefoxTest < Minitest::Test
|
@@ -44,4 +45,9 @@ class FirefoxTest < Minitest::Test
|
|
44
45
|
assert_equal "14.0", browser.full_version
|
45
46
|
assert_equal "14", browser.version
|
46
47
|
end
|
48
|
+
|
49
|
+
test "detects version by range" do
|
50
|
+
browser = Browser.new(Browser["FIREFOX"])
|
51
|
+
assert browser.firefox?(%w[>=3 <4])
|
52
|
+
end
|
47
53
|
end
|
data/test/unit/generic_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "test_helper"
|
3
4
|
|
4
5
|
class IeTest < Minitest::Test
|
@@ -153,56 +154,6 @@ class IeTest < Minitest::Test
|
|
153
154
|
assert_equal "11", browser.version
|
154
155
|
end
|
155
156
|
|
156
|
-
test "detects Microsoft Edge" do
|
157
|
-
browser = Browser.new(Browser["MS_EDGE"])
|
158
|
-
|
159
|
-
assert_equal :edge, browser.id
|
160
|
-
assert_equal "Microsoft Edge", browser.name
|
161
|
-
assert_equal "12.0", browser.full_version
|
162
|
-
assert_equal "12", browser.version
|
163
|
-
assert browser.platform.windows10?
|
164
|
-
assert browser.edge?
|
165
|
-
assert browser.modern?
|
166
|
-
refute browser.webkit?
|
167
|
-
refute browser.chrome?
|
168
|
-
refute browser.safari?
|
169
|
-
refute browser.device.mobile?
|
170
|
-
end
|
171
|
-
|
172
|
-
test "detects Microsoft Edge in compatibility view" do
|
173
|
-
browser = Browser.new(Browser["MS_EDGE_COMPAT"])
|
174
|
-
|
175
|
-
assert_equal :edge, browser.id
|
176
|
-
assert_equal "Microsoft Edge", browser.name
|
177
|
-
assert_equal "12.0", browser.full_version
|
178
|
-
assert_equal "12", browser.version
|
179
|
-
assert_equal "7.0", browser.msie_full_version
|
180
|
-
assert_equal "7", browser.msie_version
|
181
|
-
assert browser.edge?
|
182
|
-
assert browser.compatibility_view?
|
183
|
-
refute browser.modern?
|
184
|
-
refute browser.webkit?
|
185
|
-
refute browser.chrome?
|
186
|
-
refute browser.safari?
|
187
|
-
refute browser.device.mobile?
|
188
|
-
end
|
189
|
-
|
190
|
-
test "detects Microsoft Edge Mobile" do
|
191
|
-
browser = Browser.new(Browser["MS_EDGE_MOBILE"])
|
192
|
-
|
193
|
-
assert_equal :edge, browser.id
|
194
|
-
assert_equal "Microsoft Edge", browser.name
|
195
|
-
assert_equal "12.0", browser.full_version
|
196
|
-
assert_equal "12", browser.version
|
197
|
-
refute browser.platform.windows10?
|
198
|
-
assert browser.platform.windows_phone?
|
199
|
-
assert browser.edge?
|
200
|
-
assert browser.modern?
|
201
|
-
refute browser.webkit?
|
202
|
-
refute browser.chrome?
|
203
|
-
refute browser.safari?
|
204
|
-
end
|
205
|
-
|
206
157
|
test "detects IE without Trident" do
|
207
158
|
browser = Browser.new(Browser["IE_WITHOUT_TRIDENT"])
|
208
159
|
|
data/test/unit/ios_app_test.rb
CHANGED
data/test/unit/ios_test.rb
CHANGED
data/test/unit/kindle_test.rb
CHANGED