browser_sniffer 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a77c63b7563c544ce8ca42c0025fb9bad4dffe07be91652510f78d8e95c1c77
4
- data.tar.gz: dd49278682198e0563dcd22171fdaa7fa5a2f7364e3c0e5bd52dad6c2fd68b41
3
+ metadata.gz: 5b1981cafa7ca5c8a1eb77724557e5dc4d6205253bdf658323b9eb18ab9694a1
4
+ data.tar.gz: d41f6ccc6071d9c89dd56aa63d618ab42bc10fcafb27ebc15d01d42b489bb14a
5
5
  SHA512:
6
- metadata.gz: ab86e531c4cebcd5d6a5537e6a41cba81865b875f588d0d44296f89773321b935d9026ef5e3e2d05f1b30ae2082a603f6899b0b72e2eb3cf566141466ba347b7
7
- data.tar.gz: 35fc400e3501ff5ed0f3682c914c80221c7c9c83a02f3f924792edf0eed98c8e32708c3b44658afbf68fe71577624e4a916d025e6a7ccca646c7f6d8ef6012af
6
+ metadata.gz: d51befa9a0a988ce65e5a1aa14d9f37c8f67ce88e1b38066c5df3ce333ca052d21221024d9bb559c3113310b077f374367fe545184f510b9e068a3217eb8d690
7
+ data.tar.gz: 3b791421e11af2584a89f6984563a9ca7ab3c81d67ff4a0f084440bca90c4b81a5ef0ea5098a2c75b0276e78c8d3ae96e5c6857cc98de6a686663c858f33d4da
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
@@ -1,6 +1,7 @@
1
1
  name: Ruby CI
2
2
 
3
3
  on:
4
+ workflow_dispatch:
4
5
  pull_request:
5
6
  push:
6
7
  branches: master
data/dev.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: BrowserSniffer
3
+ up:
4
+ - ruby: 3.1.2
5
+ - bundler
6
+ commands:
7
+ test: bundle exec rake test
@@ -157,6 +157,16 @@ class BrowserSniffer
157
157
  /(mosaic)[\/\s]((\d+)?[\w\.]+)/i # Mosaic
158
158
  ], [:name, :version, :major]
159
159
  ],
160
+ :in_app_browser => [
161
+ [
162
+ /FBAN\/FBIOS/,
163
+ /FB_IAB\/FB4A/,
164
+ /FBAN\/MessengerForiOS/,
165
+ /FB_IAB\/MESSENGER/,
166
+ ], [[:type, :facebook]], [
167
+ /Instagram/,
168
+ ], [[:type, :instagram]],
169
+ ],
160
170
  :device => [
161
171
  [
162
172
  # Shopify Mobile for iPhone
@@ -1,3 +1,3 @@
1
1
  class BrowserSniffer
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -89,6 +89,12 @@ class BrowserSniffer
89
89
 
90
90
 
91
91
 
92
+ def in_app_browser
93
+ in_app_browser_info[:type]
94
+ end
95
+
96
+
97
+
92
98
  def device
93
99
  device_info[:name]
94
100
  end
@@ -121,6 +127,10 @@ class BrowserSniffer
121
127
  @browser_info ||= parse_user_agent_for(BrowserSniffer::REGEX_MAP[:browser])
122
128
  end
123
129
 
130
+ def in_app_browser_info
131
+ @in_app_browser_info = parse_user_agent_for(BrowserSniffer::REGEX_MAP[:in_app_browser])
132
+ end
133
+
124
134
  def engine_info
125
135
  @engine_info ||= parse_user_agent_for(BrowserSniffer::REGEX_MAP[:engine])
126
136
  end
@@ -135,9 +145,8 @@ class BrowserSniffer
135
145
 
136
146
  def parse_user_agent_for(type)
137
147
  result = {}
138
- type.each_slice(2) do |slice|
139
- format = slice[1]
140
- slice[0].each do |regex|
148
+ type.each_slice(2) do |regexps, format|
149
+ regexps.each do |regex|
141
150
  regex.match(user_agent) do |match|
142
151
  format.each_with_index do |field, index|
143
152
  if field.class == Symbol
@@ -13,7 +13,8 @@ class BrowserSnifferTest < Minitest::Test
13
13
  :os => :ios,
14
14
  :os_version => '3.2',
15
15
  :browser => :safari,
16
- :major_browser_version => 4
16
+ :major_browser_version => 4,
17
+ :in_app_browser => nil,
17
18
  },
18
19
  :ipad_new => {
19
20
  :user_agent => "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
@@ -26,7 +27,8 @@ class BrowserSnifferTest < Minitest::Test
26
27
  :os => :ios,
27
28
  :os_version => '3.2',
28
29
  :browser => :safari,
29
- :major_browser_version => 4
30
+ :major_browser_version => 4,
31
+ :in_app_browser => nil,
30
32
  },
31
33
  :ipad_chrome => {
32
34
  :user_agent => "Mozilla/5.0 (iPad; CPU OS 6_0_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/21.0.1180.82 Mobile/10A523 Safari/7534.48.3",
@@ -39,7 +41,8 @@ class BrowserSnifferTest < Minitest::Test
39
41
  :os => :ios,
40
42
  :os_version => '6.0.1',
41
43
  :browser => :chrome,
42
- :major_browser_version => 21
44
+ :major_browser_version => 21,
45
+ :in_app_browser => nil,
43
46
  },
44
47
  :iphone => {
45
48
  :user_agent => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16",
@@ -52,7 +55,8 @@ class BrowserSnifferTest < Minitest::Test
52
55
  :os => :ios,
53
56
  :os_version => '3.1.2',
54
57
  :browser => :safari,
55
- :major_browser_version => 4
58
+ :major_browser_version => 4,
59
+ :in_app_browser => nil,
56
60
  },
57
61
  :ipod_touch => {
58
62
  :user_agent => "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20",
@@ -65,7 +69,8 @@ class BrowserSnifferTest < Minitest::Test
65
69
  :os => :ios,
66
70
  :os_version => '2.2.1',
67
71
  :browser => :safari,
68
- :major_browser_version => 3
72
+ :major_browser_version => 3,
73
+ :in_app_browser => nil,
69
74
  },
70
75
  :ipod_touch_ios4 => {
71
76
  :user_agent => "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
@@ -78,7 +83,8 @@ class BrowserSnifferTest < Minitest::Test
78
83
  :os => :ios,
79
84
  :os_version => '4.3.3',
80
85
  :browser => :safari,
81
- :major_browser_version => 5
86
+ :major_browser_version => 5,
87
+ :in_app_browser => nil,
82
88
  },
83
89
  :ipod_touch_ios7 => {
84
90
  :user_agent => "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53",
@@ -91,7 +97,8 @@ class BrowserSnifferTest < Minitest::Test
91
97
  :os => :ios,
92
98
  :os_version => '7.0.4',
93
99
  :browser => :safari,
94
- :major_browser_version => 7
100
+ :major_browser_version => 7,
101
+ :in_app_browser => nil,
95
102
  },
96
103
  :nexus_one => {
97
104
  :user_agent => "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
@@ -104,7 +111,8 @@ class BrowserSnifferTest < Minitest::Test
104
111
  :os => :android,
105
112
  :os_version => '2.2',
106
113
  :browser => :safari,
107
- :major_browser_version => 4
114
+ :major_browser_version => 4,
115
+ :in_app_browser => nil,
108
116
  },
109
117
  :htc_droid => {
110
118
  :user_agent => "Mozilla/5.0 (Linux; U; Android 2.2; nl-nl; Desire_A8181 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
@@ -117,7 +125,8 @@ class BrowserSnifferTest < Minitest::Test
117
125
  :os => :android,
118
126
  :os_version => '2.2',
119
127
  :browser => :safari,
120
- :major_browser_version => 4
128
+ :major_browser_version => 4,
129
+ :in_app_browser => nil,
121
130
  },
122
131
  :bb_torch => {
123
132
  :user_agent => "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+",
@@ -130,7 +139,8 @@ class BrowserSnifferTest < Minitest::Test
130
139
  :os => :blackberry,
131
140
  :os_version => nil,
132
141
  :browser => :safari,
133
- :major_browser_version => 6
142
+ :major_browser_version => 6,
143
+ :in_app_browser => nil,
134
144
  },
135
145
  :bb_8830 => {
136
146
  :user_agent => "BlackBerry8330/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105",
@@ -143,7 +153,8 @@ class BrowserSnifferTest < Minitest::Test
143
153
  :os => :blackberry,
144
154
  :os_version => '4.3.0',
145
155
  :browser => nil,
146
- :major_browser_version => nil
156
+ :major_browser_version => nil,
157
+ :in_app_browser => nil,
147
158
  },
148
159
  :kindle => {
149
160
  :user_agent => "Mozilla/4.0 (compatible; Linux 2.6.22) NetFront/3.4 Kindle/2.0 (screen 600x800)",
@@ -157,7 +168,8 @@ class BrowserSnifferTest < Minitest::Test
157
168
  :os_version => '2.6.22',
158
169
  :browser => nil,
159
170
  :browser_name => 'Kindle',
160
- :major_browser_version => 2
171
+ :major_browser_version => 2,
172
+ :in_app_browser => nil,
161
173
  },
162
174
  :nokia_classic => {
163
175
  :user_agent => "Nokia3120Classic/2.0 (06.20) Profile/MIDP-2.1 Configuration/CLDC-1.1",
@@ -170,7 +182,8 @@ class BrowserSnifferTest < Minitest::Test
170
182
  :os => nil,
171
183
  :os_version => nil,
172
184
  :browser => nil,
173
- :major_browser_version => nil
185
+ :major_browser_version => nil,
186
+ :in_app_browser => nil,
174
187
  },
175
188
  :nokia_3200 => {
176
189
  :user_agent => "Nokia3200/1.0 (5.29) Profile/MIDP-1.0 Configuration/CLDC-1.0\nUP.Link/6.3.1.13.0",
@@ -183,7 +196,8 @@ class BrowserSnifferTest < Minitest::Test
183
196
  :os => nil,
184
197
  :os_version => nil,
185
198
  :browser => nil,
186
- :major_browser_version => nil
199
+ :major_browser_version => nil,
200
+ :in_app_browser => nil,
187
201
  },
188
202
  :att => {
189
203
  :user_agent => "Opera/9.51 Beta (Microsoft Windows; PPC; Opera Mobi/1718; U; en)",
@@ -196,7 +210,8 @@ class BrowserSnifferTest < Minitest::Test
196
210
  :os => :windows,
197
211
  :os_version => nil,
198
212
  :browser => :opera,
199
- :major_browser_version => 9
213
+ :major_browser_version => 9,
214
+ :in_app_browser => nil,
200
215
  },
201
216
  :benq => {
202
217
  :user_agent => "BenQ-CF61/1.00/WAP2.0/MIDP2.0/CLDC1.0 UP.Browser/6.3.0.4.c.1.102 (GUI) MMP/2.0",
@@ -209,7 +224,8 @@ class BrowserSnifferTest < Minitest::Test
209
224
  :os => nil,
210
225
  :os_version => nil,
211
226
  :browser => nil,
212
- :major_browser_version => nil
227
+ :major_browser_version => nil,
228
+ :in_app_browser => nil,
213
229
  },
214
230
  :dell_streak => {
215
231
  :user_agent => "Mozilla/5.0 (Linux; U; Android 1.6; en-gb; Dell Streak Build/Donut AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/ 525.20.1",
@@ -221,7 +237,8 @@ class BrowserSnifferTest < Minitest::Test
221
237
  :major_engine_version => 528,
222
238
  :os => :android,
223
239
  :os_version => '1.6',
224
- :major_browser_version => 3
240
+ :major_browser_version => 3,
241
+ :in_app_browser => nil,
225
242
  },
226
243
  :hp_ipaq => {
227
244
  :user_agent => "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; HP iPAQ h6300)",
@@ -234,7 +251,8 @@ class BrowserSnifferTest < Minitest::Test
234
251
  :os => :windows,
235
252
  :os_version => 'CE',
236
253
  :browser => :ie,
237
- :major_browser_version => 4
254
+ :major_browser_version => 4,
255
+ :in_app_browser => nil,
238
256
  },
239
257
  :nintendo_ds => {
240
258
  :user_agent => "Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [en Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [ja]",
@@ -247,7 +265,8 @@ class BrowserSnifferTest < Minitest::Test
247
265
  :os => nil,
248
266
  :os_version => nil,
249
267
  :browser => :opera,
250
- :major_browser_version => 8
268
+ :major_browser_version => 8,
269
+ :in_app_browser => nil,
251
270
  },
252
271
  :firefox_linux => {
253
272
  :user_agent => "Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8",
@@ -260,7 +279,8 @@ class BrowserSnifferTest < Minitest::Test
260
279
  :os => :linux,
261
280
  :os_version => '10.04',
262
281
  :browser => :firefox,
263
- :major_browser_version => 3
282
+ :major_browser_version => 3,
283
+ :in_app_browser => nil,
264
284
  },
265
285
  :safari_mac => {
266
286
  :user_agent => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-ca) AppleWebKit/534.6+ (KHTML, like Gecko) Version/5.0 Safari/533.16",
@@ -273,7 +293,8 @@ class BrowserSnifferTest < Minitest::Test
273
293
  :os => :mac,
274
294
  :os_version => '10.6.3',
275
295
  :browser => :safari,
276
- :major_browser_version => 5
296
+ :major_browser_version => 5,
297
+ :in_app_browser => nil,
277
298
  },
278
299
  :chrome_mac => {
279
300
  :user_agent => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/534.6 (KHTML, like Gecko) Chrome/6.0.495.0 Safari/534.6",
@@ -286,7 +307,8 @@ class BrowserSnifferTest < Minitest::Test
286
307
  :os => :mac,
287
308
  :os_version => '10.6.3',
288
309
  :browser => :chrome,
289
- :major_browser_version => 6
310
+ :major_browser_version => 6,
311
+ :in_app_browser => nil,
290
312
  },
291
313
  :chrome_win => {
292
314
  :user_agent => "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4",
@@ -299,7 +321,8 @@ class BrowserSnifferTest < Minitest::Test
299
321
  :os => :windows,
300
322
  :os_version => 'Vista',
301
323
  :browser => :chrome,
302
- :major_browser_version => 5
324
+ :major_browser_version => 5,
325
+ :in_app_browser => nil,
303
326
  },
304
327
  :ie9 => {
305
328
  :user_agent => "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)",
@@ -312,7 +335,8 @@ class BrowserSnifferTest < Minitest::Test
312
335
  :os => :windows,
313
336
  :os_version => '7',
314
337
  :browser => :ie,
315
- :major_browser_version => 9
338
+ :major_browser_version => 9,
339
+ :in_app_browser => nil,
316
340
  },
317
341
  :ie8 => {
318
342
  :user_agent => "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDC)",
@@ -325,7 +349,8 @@ class BrowserSnifferTest < Minitest::Test
325
349
  :os => :windows,
326
350
  :os_version => '7',
327
351
  :browser => :ie,
328
- :major_browser_version => 8
352
+ :major_browser_version => 8,
353
+ :in_app_browser => nil,
329
354
  },
330
355
  :ie7 => {
331
356
  :user_agent => "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.4; .NET CLR 1.1.4322; FDM; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
@@ -338,7 +363,8 @@ class BrowserSnifferTest < Minitest::Test
338
363
  :os => :windows,
339
364
  :os_version => 'XP',
340
365
  :browser => :ie,
341
- :major_browser_version => 7
366
+ :major_browser_version => 7,
367
+ :in_app_browser => nil,
342
368
  },
343
369
  :opera_win => {
344
370
  :user_agent => "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.5.24 Version/10.54",
@@ -351,7 +377,8 @@ class BrowserSnifferTest < Minitest::Test
351
377
  :os => :windows,
352
378
  :os_version => '7',
353
379
  :browser => :opera,
354
- :major_browser_version => 9
380
+ :major_browser_version => 9,
381
+ :in_app_browser => nil,
355
382
  },
356
383
  :wii => {
357
384
  :user_agent => "Opera/9.00 (Nintendo Wii; U; ; 1038-58; Wii Shop Channel/1.0; en)",
@@ -364,7 +391,8 @@ class BrowserSnifferTest < Minitest::Test
364
391
  :os => nil,
365
392
  :os_version => 'Wii',
366
393
  :browser => :opera,
367
- :major_browser_version => 9
394
+ :major_browser_version => 9,
395
+ :in_app_browser => nil,
368
396
  },
369
397
  :springboard_launched_ipod_browser => {
370
398
  :user_agent => "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8J2",
@@ -378,7 +406,8 @@ class BrowserSnifferTest < Minitest::Test
378
406
  :os_version => '4.3.3',
379
407
  :browser => :safari,
380
408
  :browser_name => 'Mobile Safari',
381
- :major_browser_version => 533
409
+ :major_browser_version => 533,
410
+ :in_app_browser => nil,
382
411
  },
383
412
  :ipod_os_4_3_3 => {
384
413
  :user_agent => "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
@@ -391,7 +420,8 @@ class BrowserSnifferTest < Minitest::Test
391
420
  :os => :ios,
392
421
  :os_version => '4.3.3',
393
422
  :browser => :safari,
394
- :major_browser_version => 5
423
+ :major_browser_version => 5,
424
+ :in_app_browser => nil,
395
425
  },
396
426
  :iphone_4S => {
397
427
  :user_agent => "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",
@@ -404,7 +434,8 @@ class BrowserSnifferTest < Minitest::Test
404
434
  :os => :ios,
405
435
  :os_version => '5.0',
406
436
  :browser => :safari,
407
- :major_browser_version => 5
437
+ :major_browser_version => 5,
438
+ :in_app_browser => nil,
408
439
  },
409
440
  :iphone_ios7_webview => {
410
441
  :user_agent => "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11A465",
@@ -418,7 +449,8 @@ class BrowserSnifferTest < Minitest::Test
418
449
  :os_version => '7.0',
419
450
  :browser => :safari,
420
451
  :browser_name => 'Mobile Safari',
421
- :major_browser_version => 537
452
+ :major_browser_version => 537,
453
+ :in_app_browser => nil,
422
454
  },
423
455
  :ipad_ios10_webview => {
424
456
  :user_agent => "Mozilla/5.0 (iPad; CPU OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) FxiOS/6.1 Mobile/14D27 Safari/602.4.6",
@@ -432,7 +464,8 @@ class BrowserSnifferTest < Minitest::Test
432
464
  :os_version => '10.2.1',
433
465
  :browser => :firefoxios,
434
466
  :browser_name => 'Mobile Firefox',
435
- :major_browser_version => 6
467
+ :major_browser_version => 6,
468
+ :in_app_browser => nil,
436
469
  },
437
470
  :ipad_ios5 => {
438
471
  :user_agent => "Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
@@ -445,7 +478,8 @@ class BrowserSnifferTest < Minitest::Test
445
478
  :os => :ios,
446
479
  :os_version => '5.0',
447
480
  :browser => :safari,
448
- :major_browser_version => 5
481
+ :major_browser_version => 5,
482
+ :in_app_browser => nil,
449
483
  },
450
484
  :excel_mac => {
451
485
  :user_agent => "Mozilla/5.0 (Macintosh; Intel Mac OS X) Excel/14.34.0",
@@ -461,7 +495,8 @@ class BrowserSnifferTest < Minitest::Test
461
495
  :os_version => nil,
462
496
  :browser => nil,
463
497
  :browser_name => 'Excel',
464
- :major_browser_version => 14
498
+ :major_browser_version => 14,
499
+ :in_app_browser => nil,
465
500
  },
466
501
  :win7_ie11 => {
467
502
  :user_agent => "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
@@ -476,7 +511,8 @@ class BrowserSnifferTest < Minitest::Test
476
511
  :os => :windows,
477
512
  :os_version => "7",
478
513
  :browser => :ie,
479
- :major_browser_version => 11
514
+ :major_browser_version => 11,
515
+ :in_app_browser => nil,
480
516
  },
481
517
  :win8_ie11 => {
482
518
  :user_agent => "Mozilla/5.0 (Windows NT 6.2; Trident/7.0; rv:11.0) like Gecko",
@@ -491,7 +527,8 @@ class BrowserSnifferTest < Minitest::Test
491
527
  :os => :windows,
492
528
  :os_version => "8",
493
529
  :browser => :ie,
494
- :major_browser_version => 11
530
+ :major_browser_version => 11,
531
+ :in_app_browser => nil,
495
532
  },
496
533
  :win8_1_ie11 => {
497
534
  :user_agent => "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko",
@@ -506,7 +543,8 @@ class BrowserSnifferTest < Minitest::Test
506
543
  :os => :windows,
507
544
  :os_version => "8.1",
508
545
  :browser => :ie,
509
- :major_browser_version => 11
546
+ :major_browser_version => 11,
547
+ :in_app_browser => nil,
510
548
  },
511
549
  :win10_ie11 => {
512
550
  :user_agent => "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; rv:11.0) like Gecko",
@@ -521,7 +559,8 @@ class BrowserSnifferTest < Minitest::Test
521
559
  :os => :windows,
522
560
  :os_version => "10",
523
561
  :browser => :ie,
524
- :major_browser_version => 11
562
+ :major_browser_version => 11,
563
+ :in_app_browser => nil,
525
564
  },
526
565
  :win10_edge12 => {
527
566
  :user_agent => "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136",
@@ -536,7 +575,8 @@ class BrowserSnifferTest < Minitest::Test
536
575
  :os => :windows,
537
576
  :os_version => "10",
538
577
  :browser => :edge,
539
- :major_browser_version => 12
578
+ :major_browser_version => 12,
579
+ :in_app_browser => nil,
540
580
  },
541
581
  :daum => {
542
582
  :user_agent => "Mozilla/5.0 (compatible; MSIE or Firefox mutant;) Daum 4.1",
@@ -549,7 +589,8 @@ class BrowserSnifferTest < Minitest::Test
549
589
  :os => nil,
550
590
  :os_version => nil,
551
591
  :browser => nil,
552
- :major_browser_version => nil
592
+ :major_browser_version => nil,
593
+ :in_app_browser => nil,
553
594
  },
554
595
  :chromiumos_chrome => {
555
596
  :user_agent => "Mozilla/5.0 (X11; CrOS x86_64 10066.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36",
@@ -563,6 +604,7 @@ class BrowserSnifferTest < Minitest::Test
563
604
  :os_version => '10066.0.0',
564
605
  :browser => :chrome,
565
606
  :major_browser_version => 81,
607
+ :in_app_browser => nil,
566
608
  },
567
609
  :windows_phone_8_1_ie11 => {
568
610
  :user_agent => "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; Microsoft; " \
@@ -578,7 +620,8 @@ class BrowserSnifferTest < Minitest::Test
578
620
  :os => :windows,
579
621
  :os_version => "8.1",
580
622
  :browser => nil,
581
- :major_browser_version => 11
623
+ :major_browser_version => 11,
624
+ :in_app_browser => nil,
582
625
  },
583
626
  :win10_ie11_in_ie7_compatibility_mode => {
584
627
  :user_agent => "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; " \
@@ -594,7 +637,43 @@ class BrowserSnifferTest < Minitest::Test
594
637
  :os => :windows,
595
638
  :os_version => "10",
596
639
  :browser => :ie,
597
- :major_browser_version => 7
640
+ :major_browser_version => 7,
641
+ :in_app_browser => nil,
642
+ },
643
+ :facebook_in_app_browser => {
644
+ :user_agent => "Mozilla/5.0 (iPhone; CPU iPhone OS 15_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/19G82 " \
645
+ "[FBAN/FBIOS;FBDV/iPhone13,4;FBMD/iPhone;FBSN/iOS;FBSV/15.6.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5]",
646
+ :form_factor => :handheld,
647
+ :ios? => true,
648
+ :ie11? => false,
649
+ :ie11_actual? => false,
650
+ :android? => false,
651
+ :desktop? => false,
652
+ :engine => :webkit,
653
+ :major_engine_version => 605,
654
+ :os => :ios,
655
+ :os_version => "15.6.1",
656
+ :browser => :safari,
657
+ :major_browser_version => 605,
658
+ :in_app_browser => :facebook,
659
+ },
660
+ :instagram_in_app_browser => {
661
+ :user_agent => "Mozilla/5.0 (Linux; Android 12; SM-G970U1 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 " \
662
+ "Chrome/103.0.5060.129 Mobile Safari/537.36 Instagram 251.1.0.11.106 " \
663
+ "Android (31/12; 480dpi; 1080x2020; samsung; SM-G970U1; beyond0q; qcom; en_US; 396185280)",
664
+ :form_factor => :handheld,
665
+ :ios? => false,
666
+ :ie11? => false,
667
+ :ie11_actual? => false,
668
+ :android? => true,
669
+ :desktop? => false,
670
+ :engine => :webkit,
671
+ :major_engine_version => 537,
672
+ :os => :android,
673
+ :os_version => "12",
674
+ :browser => :chrome,
675
+ :major_browser_version => 103,
676
+ :in_app_browser => :instagram,
598
677
  },
599
678
  }
600
679
 
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.0.0
4
+ version: 2.1.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-05-19 00:00:00.000000000 Z
11
+ date: 2022-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,7 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".github/probots.yml"
62
+ - ".github/workflows/cla.yml"
63
63
  - ".github/workflows/test.yml"
64
64
  - ".gitignore"
65
65
  - Gemfile
@@ -67,6 +67,7 @@ files:
67
67
  - README.md
68
68
  - Rakefile
69
69
  - browser_sniffer.gemspec
70
+ - dev.yml
70
71
  - init.rb
71
72
  - lib/browser_sniffer.rb
72
73
  - lib/browser_sniffer/patterns.rb
@@ -96,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  - !ruby/object:Gem::Version
97
98
  version: '0'
98
99
  requirements: []
99
- rubygems_version: 3.2.20
100
+ rubygems_version: 3.3.3
100
101
  signing_key:
101
102
  specification_version: 4
102
103
  summary: Parses user agent strings and boils it all down to a few simple classifications.
data/.github/probots.yml DELETED
@@ -1,2 +0,0 @@
1
- enabled:
2
- - cla