browser_sniffer 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/browser_sniffer/patterns.rb +9 -0
- data/lib/browser_sniffer/version.rb +1 -1
- data/test/shopify_agents_test.rb +37 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87fd7513d9ddecf43413cb15db9be18169098ae928add5cc349ca34e63b8c15f
|
4
|
+
data.tar.gz: c89dd2837067fb3b13d20c47c224dd45b9f144e38a14f6bea77805be2efbc0b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0c451290816fb66e80c1239831aacd3190d447d094cbd0088586c1ba499d4f34109ccd03c4e3491a8c5ff4a2358caada40713a9b2fa54e02d761aa92c337c02
|
7
|
+
data.tar.gz: b559ca30a3cf3cf015a7235cc92f0856b83b091d11c52bc86b04895b455e4cbae211d295127e9f951a6827740b09edbd2f65f6ebab2205ba0cf2aa2ad5c01548
|
@@ -45,6 +45,9 @@ class BrowserSniffer
|
|
45
45
|
REGEX_MAP = {
|
46
46
|
:browser => [
|
47
47
|
[
|
48
|
+
# Shopify POS Go
|
49
|
+
/WSC6X|WTH1X/i
|
50
|
+
], [[:name, 'Shopify POS Go']],[
|
48
51
|
# Shopify Mobile for iPhone or iPad
|
49
52
|
%r{.*Shopify/\d+\s\((iPhone|iPad)\;\siOS\s[\d\.]+}i
|
50
53
|
], [[:name, 'Shopify Mobile']], [
|
@@ -169,6 +172,9 @@ class BrowserSniffer
|
|
169
172
|
],
|
170
173
|
:device => [
|
171
174
|
[
|
175
|
+
# Shopify POS Go
|
176
|
+
/WSC6X|WTH1X/i
|
177
|
+
], [[:type, :handheld], [:name, 'Shopify POS Go']],[
|
172
178
|
# Shopify Mobile for iPhone
|
173
179
|
%r{.*Shopify Mobile/(?:iPhone\sOS|iOS)/[\d\.]+ \((iPhone)([\d,]+)}i
|
174
180
|
], [[:type, :handheld], :model], [
|
@@ -295,6 +301,9 @@ class BrowserSniffer
|
|
295
301
|
],
|
296
302
|
:os => [
|
297
303
|
[
|
304
|
+
# Shopify Retail OS on POS Go
|
305
|
+
/WSC6X|WTH1X/i
|
306
|
+
], [[:name, 'Shopify Retail OS']],[
|
298
307
|
# Shopify Mobile for iOS
|
299
308
|
%r{.*Shopify/\d+\s\((?:iPhone|iPad)\;\s(iOS)\s([\d\.]+)}i
|
300
309
|
], [[:type, :ios], :version, [:name, 'iOS']], [
|
data/test/shopify_agents_test.rb
CHANGED
@@ -1,6 +1,43 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
3
|
describe "Shopify agents" do
|
4
|
+
|
5
|
+
it "Shopify POS Go can be sniffed with old model name" do
|
6
|
+
user_agent = "Mozilla/5.0 (Linux; Android 10; ETNA/29/BBPOS/WSC6X) Chrome"
|
7
|
+
sniffer = BrowserSniffer.new(user_agent)
|
8
|
+
|
9
|
+
assert_equal ({
|
10
|
+
name: 'Shopify POS Go',
|
11
|
+
}), sniffer.browser_info
|
12
|
+
|
13
|
+
assert_equal ({
|
14
|
+
name: 'Shopify Retail OS',
|
15
|
+
}), sniffer.os_info
|
16
|
+
|
17
|
+
assert_equal ({
|
18
|
+
type: :handheld,
|
19
|
+
name: 'Shopify POS Go',
|
20
|
+
}), sniffer.device_info
|
21
|
+
end
|
22
|
+
|
23
|
+
it "Shopify POS Go can be sniffed with new model name" do
|
24
|
+
user_agent = "Mozilla/5.0 (Linux; Android 10; ETNA/29/BBPOS/WTH1X) Chrome"
|
25
|
+
sniffer = BrowserSniffer.new(user_agent)
|
26
|
+
|
27
|
+
assert_equal ({
|
28
|
+
name: 'Shopify POS Go',
|
29
|
+
}), sniffer.browser_info
|
30
|
+
|
31
|
+
assert_equal ({
|
32
|
+
name: 'Shopify Retail OS',
|
33
|
+
}), sniffer.os_info
|
34
|
+
|
35
|
+
assert_equal ({
|
36
|
+
type: :handheld,
|
37
|
+
name: 'Shopify POS Go',
|
38
|
+
}), sniffer.device_info
|
39
|
+
end
|
40
|
+
|
4
41
|
it "Shopify Mobile on iOS can be sniffed" do
|
5
42
|
user_agent = "Shopify Mobile/iOS/5.4.4 "\
|
6
43
|
"(iPhone9,3/com.jadedpixel.shopify/OperatingSystemVersion(majorVersion: 10, minorVersion: 3, patchVersion: 2))"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser_sniffer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|