browser_sniffer 1.2.2 → 1.3.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: e1d2a14cbaa027eb267424ec34f049c2a383471036e9dad156d40c26a5b78fd6
4
- data.tar.gz: a4fcca71e6189f943587910085a966a8fe7f5673600271b85f87cd82467b0281
3
+ metadata.gz: c1f122e65998d2712691f2b2dfefd9cbbdb7e824ad1a5a39bab483b4274bbac3
4
+ data.tar.gz: 002eb813a2e049806a5e409035aeb8f303c4dff4797e05461993d70e372f5c18
5
5
  SHA512:
6
- metadata.gz: 8abab760e9d58a527f5dc971ccbc93d1d524c38ccd7e6ef01fb2ca5536c9558f9e7811a2c63f1efcf6b3ddb2d4976cfc142454d86b49f9f1f455428888f61f74
7
- data.tar.gz: f4f0d813479f3d374e6a1104211052c0954768ff7af20525175dfb7971ed569f353ba3122f6e3595944d04cda1fc76519bcbded668388e5a05dceb352405983c
6
+ metadata.gz: 266ff5af2b669e477e088b0cf2caff845e7bacdbcc2abd7a6c4380921a9343e15604c2c4975260bf53cdccc0002de45b49563aef40e790c4fe46f1abc5e497b0
7
+ data.tar.gz: 9c9620bb162e584acc189d3a6e208d67470a0d16aeefd5b331f9250e5dc1eb444fc1243fef615bf242cde1a5ba4d89c9a124a0984e56119baf4c05831c545225
@@ -1,3 +1,3 @@
1
1
  class BrowserSniffer
2
- VERSION = "1.2.2"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -24,6 +24,15 @@ class BrowserSniffer
24
24
  browser == :ie && major_browser_version == 11
25
25
  end
26
26
 
27
+ # This method checks ie 11 mobile or ie11 rendering an older version in compatibility mode, in addition to `ie11?`.
28
+ # The `ie11?` method would return false in both those scenarios.
29
+ def ie11_actual?
30
+ ie11_engine = major_engine_version == 7 && engine_name == 'Trident'
31
+ ie_mobile11 = major_browser_version == 11 && browser_name == 'IEMobile'
32
+
33
+ ie11? || ie11_engine || ie_mobile11
34
+ end
35
+
27
36
  def handheld?
28
37
  form_factor == :handheld
29
38
  end
@@ -454,6 +454,7 @@ class BrowserSnifferTest < Minitest::Test
454
454
  :android? => false,
455
455
  :desktop? => true,
456
456
  :ie11? => false,
457
+ :ie11_actual? => false,
457
458
  :engine => nil,
458
459
  :major_engine_version => nil,
459
460
  :os => :mac,
@@ -467,6 +468,7 @@ class BrowserSnifferTest < Minitest::Test
467
468
  :form_factor => :desktop,
468
469
  :ios? => false,
469
470
  :ie11? => true,
471
+ :ie11_actual? => true,
470
472
  :android? => false,
471
473
  :desktop? => true,
472
474
  :engine => :trident,
@@ -481,6 +483,7 @@ class BrowserSnifferTest < Minitest::Test
481
483
  :form_factor => :desktop,
482
484
  :ios? => false,
483
485
  :ie11? => true,
486
+ :ie11_actual? => true,
484
487
  :android? => false,
485
488
  :desktop? => true,
486
489
  :engine => :trident,
@@ -495,6 +498,7 @@ class BrowserSnifferTest < Minitest::Test
495
498
  :form_factor => :desktop,
496
499
  :ios? => false,
497
500
  :ie11? => true,
501
+ :ie11_actual? => true,
498
502
  :android? => false,
499
503
  :desktop? => true,
500
504
  :engine => :trident,
@@ -509,6 +513,7 @@ class BrowserSnifferTest < Minitest::Test
509
513
  :form_factor => :desktop,
510
514
  :ios? => false,
511
515
  :ie11? => true,
516
+ :ie11_actual? => true,
512
517
  :android? => false,
513
518
  :desktop? => true,
514
519
  :engine => :trident,
@@ -523,6 +528,7 @@ class BrowserSnifferTest < Minitest::Test
523
528
  :form_factor => :desktop,
524
529
  :ios? => false,
525
530
  :ie11? => false,
531
+ :ie11_actual? => false,
526
532
  :android? => false,
527
533
  :desktop? => true,
528
534
  :engine => :webkit,
@@ -558,6 +564,38 @@ class BrowserSnifferTest < Minitest::Test
558
564
  :browser => :chrome,
559
565
  :major_browser_version => 81,
560
566
  },
567
+ :windows_phone_8_1_ie11 => {
568
+ :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; " \
569
+ "Lumia 640 XL) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537",
570
+ :form_factor => :handheld,
571
+ :ios? => false,
572
+ :ie11? => false,
573
+ :ie11_actual? => true,
574
+ :android? => false,
575
+ :desktop? => false,
576
+ :engine => :webkit,
577
+ :major_engine_version => 53,
578
+ :os => :windows,
579
+ :os_version => "8.1",
580
+ :browser => nil,
581
+ :major_browser_version => 11
582
+ },
583
+ :win10_ie11_in_ie7_compatibility_mode => {
584
+ :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; " \
585
+ ".NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.3; Tablet PC 2.0; Zoom 3.6.0)",
586
+ :form_factor => :desktop,
587
+ :ios? => false,
588
+ :ie11? => false,
589
+ :ie11_actual? => true,
590
+ :android? => false,
591
+ :desktop? => true,
592
+ :engine => :trident,
593
+ :major_engine_version => 7,
594
+ :os => :windows,
595
+ :os_version => "10",
596
+ :browser => :ie,
597
+ :major_browser_version => 7
598
+ },
561
599
  }
562
600
 
563
601
  AGENTS.each do |agent, attributes|
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: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.0.3
99
+ rubygems_version: 3.2.20
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Parses user agent strings and boils it all down to a few simple classifications.