webfontloader 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v1.3.2 (March 27, 2013)
2
+ * Add support for the Amazon 1 and 2+ browsers.
3
+
1
4
  v1.3.1 (March 14, 2013)
2
5
  * Change code to use explicit dependencies
3
6
  * Fix unit tests in older browsers
data/lib/webfontloader.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'webfontloader/modules'
4
4
 
5
5
  module WebFontLoader
6
- VERSION = '1.3.1'
6
+ VERSION = '1.3.2'
7
7
 
8
8
  ProjectRoot = File.expand_path(File.dirname(__FILE__) + "/..")
9
9
 
@@ -705,6 +705,188 @@ describe('UserAgentParser', function () {
705
705
  });
706
706
  });
707
707
 
708
+ describe('Amazon Silk', function () {
709
+ it('should detect 2nd generation', function () {
710
+ expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFOT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
711
+ .toMatchUserAgent({
712
+ name: 'Silk',
713
+ version: '2.6',
714
+ platform: 'Android',
715
+ platformVersion: '4.0.3',
716
+ engine: 'AppleWebKit',
717
+ engineVersion: '535.19',
718
+ documentMode: undefined,
719
+ browserInfo: {
720
+ hasWebFontSupport: true,
721
+ hasWebKitFallbackBug: true,
722
+ hasWebKitMetricsBug: false
723
+ }
724
+ });
725
+ });
726
+
727
+ it('should detect 2nd generation (Desktop mode)', function () {
728
+ expect(parse('Mozilla/5.0 (Linux; U; en-us; KFOT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
729
+ .toMatchUserAgent({
730
+ name: 'Silk',
731
+ version: '2.6',
732
+ platform: 'Linux',
733
+ platformVersion: 'Unknown',
734
+ engine: 'AppleWebKit',
735
+ engineVersion: '535.19',
736
+ documentMode: undefined,
737
+ browserInfo: {
738
+ hasWebFontSupport: true,
739
+ hasWebKitFallbackBug: true,
740
+ hasWebKitMetricsBug: false
741
+ }
742
+ })
743
+ });
744
+
745
+ it('HD 7"', function () {
746
+ expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
747
+ .toMatchUserAgent({
748
+ name: 'Silk',
749
+ version: '2.6',
750
+ platform: 'Android',
751
+ platformVersion: '4.0.3',
752
+ engine: 'AppleWebKit',
753
+ engineVersion: '535.19',
754
+ documentMode: undefined,
755
+ browserInfo: {
756
+ hasWebFontSupport: true,
757
+ hasWebKitFallbackBug: true,
758
+ hasWebKitMetricsBug: false
759
+ }
760
+ });
761
+ });
762
+
763
+ it('HD 7" (Desktop mode)', function () {
764
+ expect(parse('Mozilla/5.0 (Linux; U; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
765
+ .toMatchUserAgent({
766
+ name: 'Silk',
767
+ version: '2.6',
768
+ platform: 'Linux',
769
+ platformVersion: 'Unknown',
770
+ engine: 'AppleWebKit',
771
+ engineVersion: '535.19',
772
+ documentMode: undefined,
773
+ browserInfo: {
774
+ hasWebFontSupport: true,
775
+ hasWebKitFallbackBug: true,
776
+ hasWebKitMetricsBug: false
777
+ }
778
+ });
779
+ });
780
+
781
+ it('HD 8.9" Wi-Fi', function () {
782
+ expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFJWI Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
783
+ .toMatchUserAgent({
784
+ name: 'Silk',
785
+ version: '2.6',
786
+ platform: 'Android',
787
+ platformVersion: '4.0.3',
788
+ engine: 'AppleWebKit',
789
+ engineVersion: '535.19',
790
+ documentMode: undefined,
791
+ browserInfo: {
792
+ hasWebFontSupport: true,
793
+ hasWebKitFallbackBug: true,
794
+ hasWebKitMetricsBug: false
795
+ }
796
+ });
797
+ });
798
+
799
+ it('HD 8.9" Wi-Fi (Desktop mode)', function () {
800
+ expect(parse('Mozilla/5.0 (Linux; U; en-us; KFJWI Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
801
+ .toMatchUserAgent({
802
+ name: 'Silk',
803
+ version: '2.6',
804
+ platform: 'Linux',
805
+ platformVersion: 'Unknown',
806
+ engine: 'AppleWebKit',
807
+ engineVersion: '535.19',
808
+ documentMode: undefined,
809
+ browserInfo: {
810
+ hasWebFontSupport: true,
811
+ hasWebKitFallbackBug: true,
812
+ hasWebKitMetricsBug: false
813
+ }
814
+ });
815
+ });
816
+
817
+ it('HD 8.9" WAN', function () {
818
+ expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFJWA Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
819
+ .toMatchUserAgent({
820
+ name: 'Silk',
821
+ version: '2.6',
822
+ platform: 'Android',
823
+ platformVersion: '4.0.3',
824
+ engine: 'AppleWebKit',
825
+ engineVersion: '535.19',
826
+ documentMode: undefined,
827
+ browserInfo: {
828
+ hasWebFontSupport: true,
829
+ hasWebKitFallbackBug: true,
830
+ hasWebKitMetricsBug: false
831
+ }
832
+ });
833
+ });
834
+
835
+ it('HD 8.9" WAN (Desktop mode)', function () {
836
+ expect(parse('Mozilla/5.0 (Linux; U; en-us; KFJWA Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
837
+ .toMatchUserAgent({
838
+ name: 'Silk',
839
+ version: '2.6',
840
+ platform: 'Linux',
841
+ platformVersion: 'Unknown',
842
+ engine: 'AppleWebKit',
843
+ engineVersion: '535.19',
844
+ documentMode: undefined,
845
+ browserInfo: {
846
+ hasWebFontSupport: true,
847
+ hasWebKitFallbackBug: true,
848
+ hasWebKitMetricsBug: false
849
+ }
850
+ });
851
+ });
852
+
853
+ it('1st generation', function () {
854
+ expect(parse('Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Silk/1.0.22.79_10013310) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 Silk-Accelerated=false'))
855
+ .toMatchUserAgent({
856
+ name: 'Silk',
857
+ version: '1.0.22.79_10013310',
858
+ platform: 'Android',
859
+ platformVersion: '2.3.4',
860
+ engine: 'AppleWebKit',
861
+ engineVersion: '533.1',
862
+ documentMode: undefined,
863
+ browserInfo: {
864
+ hasWebFontSupport: true,
865
+ hasWebKitFallbackBug: true,
866
+ hasWebKitMetricsBug: false
867
+ }
868
+ });
869
+ });
870
+
871
+ it('1st generation (Desktop mode)', function () {
872
+ expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.22.79_10013310) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false'))
873
+ .toMatchUserAgent({
874
+ name: 'Silk',
875
+ version: '1.0.22.79_10013310',
876
+ platform: 'Macintosh',
877
+ platformVersion: '10_6_3',
878
+ engine: 'AppleWebKit',
879
+ engineVersion: '533.16',
880
+ documentMode: undefined,
881
+ browserInfo: {
882
+ hasWebFontSupport: true,
883
+ hasWebKitFallbackBug: true,
884
+ hasWebKitMetricsBug: true
885
+ }
886
+ });
887
+ });
888
+ });
889
+
708
890
  describe('Opera', function () {
709
891
  it('should detect Opera', function () {
710
892
  expect(parse('Opera/9.80 (Linux i686; U; en) Presto/2.5.22 Version/10.51'))
@@ -251,13 +251,14 @@ goog.scope(function () {
251
251
  if (webKitVersionString == "") {
252
252
  webKitVersionString = UserAgentParser.UNKNOWN;
253
253
  }
254
-
255
254
  var webKitVersion = this.parseVersion_(webKitVersionString);
256
255
  var platformVersion = this.parseVersion_(platformVersionString);
257
256
  var name = UserAgentParser.UNKNOWN;
258
257
 
259
258
  if (this.userAgent_.indexOf("Chrome") != -1 || this.userAgent_.indexOf("CrMo") != -1 || this.userAgent_.indexOf("CriOS") != -1) {
260
259
  name = "Chrome";
260
+ } else if (/Silk\/\d/.test(this.userAgent_)) {
261
+ name = "Silk";
261
262
  } else if (platform == "BlackBerry" || platform == "Android") {
262
263
  name = UserAgentParser.BUILTIN_BROWSER;
263
264
  } else if (this.userAgent_.indexOf("Safari") != -1) {
@@ -269,6 +270,9 @@ goog.scope(function () {
269
270
 
270
271
  if (name == UserAgentParser.BUILTIN_BROWSER) {
271
272
  version = UserAgentParser.UNKNOWN;
273
+ } else if (/Silk\/\d/.test(this.userAgent_)) {
274
+ version = this.getMatchingGroup_(this.userAgent_,
275
+ /Silk\/([\d\._]+)/, 1);
272
276
  } else if (this.userAgent_.indexOf("Version/") != -1) {
273
277
  version = this.getMatchingGroup_(this.userAgent_,
274
278
  /Version\/([\d\.\w]+)/, 1);
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'webfontloader'
16
- s.version = '1.3.1'
17
- s.date = '2013-03-14'
16
+ s.version = '1.3.2'
17
+ s.date = '2013-03-27'
18
18
 
19
19
  ## Make sure your summary is short. The description may be as long
20
20
  ## as you like.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webfontloader
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 1
10
- version: 1.3.1
9
+ - 2
10
+ version: 1.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Carver
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-03-14 00:00:00 Z
19
+ date: 2013-03-27 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rake