Imported Upstream version 1.0.1
Balasankar C
8 years ago
0 | ClassLength: | |
1 | Enabled: false | |
2 | ||
3 | CyclomaticComplexity: | |
4 | Enabled: false | |
5 | ||
6 | Documentation: | |
7 | Enabled: false | |
8 | ||
9 | Encoding: | |
10 | Enabled: false | |
11 | ||
12 | FileName: | |
13 | Enabled: false | |
14 | ||
15 | IfUnlessModifier: | |
16 | Enabled: false | |
17 | ||
18 | MethodLength: | |
19 | Enabled: false | |
20 | ||
21 | ModuleFunction: | |
22 | Enabled: false | |
23 | ||
24 | OneLineConditional: | |
25 | Enabled: false | |
26 | ||
27 | ParameterLists: | |
28 | Enabled: false | |
29 | ||
30 | Proc: | |
31 | Enabled: false | |
32 | ||
33 | SingleLineBlockParams: | |
34 | Enabled: false | |
35 | ||
36 | VariableInterpolation: | |
37 | Enabled: false | |
38 | ||
39 | TrailingComma: | |
40 | Enabled: false | |
41 | ||
42 | WhileUntilModifier: | |
43 | Enabled: false | |
44 | ||
45 | PredicateName: | |
46 | NamePrefixBlacklist: | |
47 | - is_ | |
48 | ||
49 | StringLiterals: | |
50 | EnforcedStyle: double_quotes | |
51 | SupportedStyles: | |
52 | - single_quotes | |
53 | - double_quotes | |
54 | ||
55 | DotPosition: | |
56 | EnforcedStyle: leading | |
57 | ||
58 | SpaceBeforeBlockBraces: | |
59 | EnforcedStyle: space | |
60 | ||
61 | SpaceInsideBlockBraces: | |
62 | EnforcedStyle: no_space | |
63 | ||
64 | DoubleNegation: | |
65 | Enabled: false | |
66 | ||
67 | SpaceInsideBlockBraces: | |
68 | SpaceBeforeBlockParameters: false | |
69 | ||
70 | LineLength: | |
71 | Max: 130 | |
72 | ||
73 | RegexpLiteral: | |
74 | MaxSlashes: 0 | |
75 | ||
76 | SpaceInsideHashLiteralBraces: | |
77 | Enabled: false | |
78 | ||
79 | PercentLiteralDelimiters: | |
80 | PreferredDelimiters: | |
81 | '%': '[]' | |
82 | '%i': '[]' | |
83 | '%q': '[]' | |
84 | '%Q': '[]' | |
85 | '%r': '[]' | |
86 | '%s': '[]' | |
87 | '%w': '[]' | |
88 | '%W': '[]' | |
89 | '%x': '[]' |
0 | 0 | language: ruby |
1 | sudo: false | |
2 | cache: bundler | |
1 | 3 | rvm: |
2 | - 1.9.3 | |
3 | - 2.0.0 | |
4 | - 2.1.4 | |
4 | - '2.2' | |
5 | - '2.1' | |
6 | - '2.0' | |
5 | 7 | gemfile: |
6 | 8 | - Gemfile |
7 | 9 | - gemfiles/rails3.gemfile |
8 | 10 | script: "bundle exec rake spec" |
11 | notifications: | |
12 | email: false |
1 | 1 | |
2 | 2 | [![Travis-CI](https://travis-ci.org/fnando/browser.png)](https://travis-ci.org/fnando/browser) |
3 | 3 | [![CodeClimate](https://codeclimate.com/github/fnando/browser.png)](https://codeclimate.com/github/fnando/browser) |
4 | [![Gem Version](https://badge.fury.io/rb/browser.svg)](http://badge.fury.io/rb/browser) | |
4 | 5 | |
5 | 6 | Do some browser detection with Ruby. Includes ActionController integration. |
6 | 7 | |
30 | 31 | browser.firefox? |
31 | 32 | browser.ie? |
32 | 33 | browser.ie6? # this goes up to 11 |
34 | browser.edge? # Newest MS browser | |
33 | 35 | browser.modern? # Webkit, Firefox 17+, IE 9+ and Opera 12+ |
34 | 36 | browser.platform # return :mac, :windows, :linux or :other |
35 | 37 | browser.mac? |
60 | 62 | * Firefox Tablet 14+ |
61 | 63 | * Opera 12+ |
62 | 64 | |
63 | You can define your your rules. A rule must be a proc/lambda or any object that implements the method === and accepts the browser object. To redefine all rules, clear the existing rules before adding your own. | |
65 | You can define your own rules. A rule must be a proc/lambda or any object that implements the method === and accepts the browser object. To redefine all rules, clear the existing rules before adding your own. | |
64 | 66 | |
65 | 67 | ```ruby |
66 | 68 | # Only Chrome Canary is considered modern. |
83 | 85 | <p class="disclaimer">You're running an older IE version. Please update it!</p> |
84 | 86 | <% end %> |
85 | 87 | ``` |
88 | ||
89 | ### Internet Explorer | |
90 | ||
91 | Internet Explorer has a compatibility view mode that allows newer versions (IE8+) to run as an older version. Browser will always return the navigator version, ignoring the compatibility view version, when defined. If you need to get the engine's version, you have to use `Browser#msie_version` and `Browser#msie_full_version`. | |
92 | ||
93 | So, let's say an user activates compatibility view in a IE11 browser. This is what you'll get: | |
94 | ||
95 | ```ruby | |
96 | browser.version | |
97 | #=> 11 | |
98 | ||
99 | browser.full_version | |
100 | #=> 11.0 | |
101 | ||
102 | browser.msie_version | |
103 | #=> 7 | |
104 | ||
105 | browser.msie_full_version | |
106 | #=> 7.0 | |
107 | ||
108 | browser.compatibility_view? | |
109 | #=> true | |
110 | ||
111 | browser.modern? | |
112 | #=> false | |
113 | ``` | |
114 | ||
115 | This behavior changed in `v1.0.0`; previously there wasn't a way of getting the real browser version. | |
86 | 116 | |
87 | 117 | ### Bots |
88 | 118 | |
120 | 150 | end |
121 | 151 | ``` |
122 | 152 | |
153 | If you need acccess to the `Rack::Request` object (e.g. to exclude a path), you can do so with `request`. | |
154 | ```ruby | |
155 | Rails.configuration.middleware.use Browser::Middleware do | |
156 | redirect_to upgrade_path unless browser.modern? || request.env['PATH_INFO'] == '/exclude_me' | |
157 | end | |
158 | ``` | |
159 | ||
123 | 160 | ## Maintainer |
124 | 161 | |
125 | 162 | * Nando Vieira - http://nandovieira.com.br |
6 | 6 | Apache-HttpClient: "Java http library" |
7 | 7 | ApacheBench: "ApacheBench (ab)" |
8 | 8 | AppEngine-Google: "Google App Engine" |
9 | Applebot: "Apple Bot" | |
9 | 10 | Ask Jeeves: "Ask Jeeves" |
10 | 11 | AsyncHttpClient: "Java http and WebSocket client library" |
11 | 12 | awe.sm: "Awe.sm URL expander" |
13 | 14 | Baiduspider: "Chinese search engine" |
14 | 15 | bingbot: "Microsoft bing bot" |
15 | 16 | bitlybot: "bit.ly bot" |
17 | BLEXBot: "webmeup-crawler.com" | |
16 | 18 | bot@linkfluence.net: "Linkfluence bot" |
17 | 19 | BuiBui-CheckBot: "email: buibui[at]dadapro[dot]com" |
18 | 20 | Butterfly: "Topsy Labs" |
34 | 36 | EvriNid: "Evri bot" |
35 | 37 | Exabot: "Exalead's bot" |
36 | 38 | ExaleadCloudView: "ExaleadCloudView" |
37 | facebookexternalhit: "facebook bot" | |
39 | facebookexternalhit: "Facebook Bot" | |
40 | Facebot: "Facebook Bot" | |
38 | 41 | FeedBurner: "RSS bot" |
39 | 42 | Feedfetcher-Google: "Google Feedfetcher" |
40 | 43 | FlipboardProxy: "FlipboardProxy" |
43 | 46 | Gigabot: "Gigabot spider" |
44 | 47 | Go http package: "Go http library" |
45 | 48 | Google Web Preview: "Google Instant Previews crawler" |
49 | Google Page Speed Insights: "Google Page Speed Insights" | |
46 | 50 | Googlebot: "Google spider" |
47 | 51 | Hatena::Bookmark: "Hatena::Bookmark" |
48 | 52 | heritrix: "heritrix" |
84 | 88 | magpie-crawler: "magpie-crawler" |
85 | 89 | Mail.RU_Bot: "Mail.ru Bot" |
86 | 90 | Mediapartners-Google: "Google Adsense bot" |
91 | MegaIndex.ru: "Mozilla/5.0 (compatible; MegaIndex.ru/2.0; +https://www.megaindex.ru/?tab=linkAnalyze)" | |
87 | 92 | MetaURI: "MetaURI" |
88 | 93 | MetaURI: "URI meta information extractor bot" |
89 | 94 | MFE_expand: "Mcafee spider" |
111 | 116 | python-requests: "Python http library" |
112 | 117 | python-requests: "python-requests" |
113 | 118 | Python-urllib: "Python http library" |
119 | QuerySeeker: "QuerySeekerSpider ( http://queryseeker.com/bot.html )" | |
114 | 120 | QuickLook: "QuickLook" |
115 | 121 | Readability: "Readability" |
116 | 122 | RebelMouse: "RebelMouse" |
128 | 134 | ShowyouBot: "Showyou iOS app spider" |
129 | 135 | Siege: "Joe Dog Siege" |
130 | 136 | SiteUptime: "Site monitoring services" |
137 | Slack: "Slackbot-LinkExpanding" | |
131 | 138 | Slurp: "Yahoo spider" |
132 | 139 | Sogou: "Chinese search engine" |
133 | 140 | spider: "generic web spider" |
152 | 159 | Webscout: "Webscout" |
153 | 160 | Wget: "wget unix CLI http client" |
154 | 161 | WordPress: "WordPress spider" |
162 | Wormly: "WormlyBot" | |
155 | 163 | Xenu Link Sleuth: "Xenu Link Sleuth" |
156 | 164 | XoviBot: "XoviBot" |
157 | 165 | YandexBot: "Yandex spider" |
161 | 169 | zelist.ro: "feed parser" |
162 | 170 | ZIBB: "ZIBB spider" |
163 | 171 | ZyBorg: "Zyborg? Hmmm...." |
172 | StructuredDataTestingTool: 'Google-StructuredDataTestingTool' |
10 | 10 | s.homepage = "http://github.com/fnando/browser" |
11 | 11 | s.summary = "Do some browser detection with Ruby." |
12 | 12 | s.description = s.summary |
13 | s.license = 'MIT' | |
13 | 14 | |
14 | 15 | s.files = `git ls-files`.split("\n") |
15 | 16 | s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") |
16 | 17 | s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } |
17 | 18 | s.require_paths = ["lib"] |
18 | 19 | |
20 | s.post_install_message = [ | |
21 | "", | |
22 | "#################### WARNING ##############################" , | |
23 | "# #" , | |
24 | "# Internet Explorer detection has changed on v1.0.0+. #" , | |
25 | "# If this is important for you, please read #" , | |
26 | "# https://github.com/fnando/browser#internet-explorer #" , | |
27 | "# #" , | |
28 | "###########################################################" , | |
29 | "\n" | |
30 | ].join("\n") | |
31 | ||
19 | 32 | s.add_development_dependency "bundler", ">= 0" |
20 | 33 | s.add_development_dependency "rake" |
21 | 34 | s.add_development_dependency "rails" |
22 | 35 | s.add_development_dependency "rack-test" |
23 | 36 | s.add_development_dependency "minitest" |
37 | s.add_development_dependency "minitest-utils" | |
24 | 38 | end |
18 | 18 | def bot_name |
19 | 19 | return unless bot? |
20 | 20 | return "Generic Bot" if bot_with_empty_ua? |
21 | BOTS.find {|key, description| ua.include?(key) }.first | |
21 | BOTS.find {|key, _| ua.include?(key) }.first | |
22 | 22 | end |
23 | 23 | |
24 | 24 | def search_engine? |
1 | 1 | module IE |
2 | 2 | TRIDENT_VERSION_REGEX = %r[Trident/([0-9.]+)] |
3 | 3 | MODERN_IE = %r[Trident/.*?; rv:(.*?)] |
4 | MSIE = %r{MSIE ([\d.]+)|Trident/.*?; rv:([\d.]+)} | |
5 | EDGE = %r{(Edge/[\d.]+|Trident/8)} | |
6 | ||
7 | # https://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx#TriToken | |
8 | TRIDENT_MAPPING = { | |
9 | "4.0" => "8", | |
10 | "5.0" => "9", | |
11 | "6.0" => "10", | |
12 | "7.0" => "11", | |
13 | "8.0" => "12" | |
14 | } | |
15 | ||
16 | def ie_version | |
17 | TRIDENT_MAPPING[trident_version] || msie_version | |
18 | end | |
19 | ||
20 | def ie_full_version | |
21 | "#{ie_version}.0" | |
22 | end | |
23 | ||
24 | def msie_full_version | |
25 | (ua.match(MSIE) && ($1 || $2)) || "0.0" | |
26 | end | |
27 | ||
28 | def msie_version | |
29 | msie_full_version.to_s.split(".").first || "0" | |
30 | end | |
31 | ||
32 | # Return the trident version. | |
33 | def trident_version | |
34 | ua.match(TRIDENT_VERSION_REGEX) && $1 | |
35 | end | |
4 | 36 | |
5 | 37 | # Detect if browser is Internet Explorer. |
6 | 38 | def ie? |
37 | 69 | ie? && version == "11" |
38 | 70 | end |
39 | 71 | |
72 | # Detect if browser is Microsoft Edge. | |
73 | def edge? | |
74 | !!(ua =~ EDGE) | |
75 | end | |
76 | ||
40 | 77 | # Detect if IE is running in compatibility mode. |
41 | 78 | def compatibility_view? |
42 | match = ua.match(TRIDENT_VERSION_REGEX) | |
43 | ie? && match && version.to_i < (match[1].to_i + 4) | |
79 | ie? && trident_version && msie_version.to_i < (trident_version.to_i + 4) | |
44 | 80 | end |
45 | 81 | |
46 | 82 | private |
25 | 25 | def detect_mobile? |
26 | 26 | !!( |
27 | 27 | psp? || |
28 | /zunewp7/i.match(ua) || | |
28 | 29 | /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.match(ua) || |
29 | 30 | /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.match(ua[0..3]) |
30 | 31 | ) |
69 | 69 | !!(ua =~ /Windows/) |
70 | 70 | end |
71 | 71 | |
72 | ## More info here => http://msdn.microsoft.com/fr-FR/library/ms537503.aspx#PltToken | |
73 | def windows_xp? | |
74 | windows? && !!(ua =~ /Windows NT 5.1/) | |
75 | end | |
76 | ||
77 | def windows_vista? | |
78 | windows? && !!(ua =~ /Windows NT 6.0/) | |
79 | end | |
80 | ||
81 | def windows7? | |
82 | windows? && !!(ua =~ /Windows NT 6.1/) | |
83 | end | |
84 | ||
72 | 85 | def windows8? |
73 | 86 | windows? && !!(ua =~ /Windows NT 6.[2-3]/) |
74 | 87 | end |
75 | 88 | |
89 | def windows8_1? | |
90 | windows? && !!(ua =~ /Windows NT 6\.3/) | |
91 | end | |
92 | ||
93 | def windows10? | |
94 | windows? && !!(ua =~ /Windows NT 10/) | |
95 | end | |
96 | ||
76 | 97 | def windows_rt? |
77 | 98 | windows8? && !!(ua =~ /ARM/) |
78 | end | |
79 | ||
80 | # Detect if current platform is Linux flavor. | |
81 | def linux? | |
82 | !!(ua =~ /Linux/) | |
83 | 99 | end |
84 | 100 | |
85 | 101 | # Detect if current platform is Windows Mobile. |
95 | 111 | # Detect if current platform is Windows in 64-bit architecture. |
96 | 112 | def windows_x64? |
97 | 113 | windows? && !!(ua =~ /(Win64|x64)/) && !!(ua =~ /x64/) |
114 | end | |
115 | ||
116 | def windows_wow64? | |
117 | windows? && !!(ua =~ /WOW64/i) | |
118 | end | |
119 | ||
120 | def windows_x64_inclusive? | |
121 | windows_x64? || windows_wow64? | |
122 | end | |
123 | ||
124 | # Detect if current platform is Linux flavor. | |
125 | def linux? | |
126 | !!(ua =~ /Linux/) | |
98 | 127 | end |
99 | 128 | |
100 | 129 | # Detect if current platform is ChromeOS |
0 | 0 | class Browser |
1 | 1 | module Version |
2 | MAJOR = 0 | |
3 | MINOR = 8 | |
4 | PATCH = 0 | |
2 | MAJOR = 1 | |
3 | MINOR = 0 | |
4 | PATCH = 1 | |
5 | 5 | STRING = "#{MAJOR}.#{MINOR}.#{PATCH}" |
6 | 6 | end |
7 | 7 | end |
41 | 41 | alias_method :ua=, :user_agent= |
42 | 42 | |
43 | 43 | NAMES = { |
44 | ie: "Internet Explorer", # Must come before android | |
45 | chrome: "Chrome", # Must come before android | |
44 | edge: "Microsoft Edge", # Must come before everything | |
45 | ie: "Internet Explorer", # Must come before android | |
46 | chrome: "Chrome", # Must come before android | |
47 | firefox: "Firefox", # Must come before android | |
46 | 48 | android: "Android", |
47 | 49 | blackberry: "BlackBerry", |
48 | 50 | core_media: "Apple CoreMedia", |
49 | firefox: "Firefox", | |
50 | 51 | ipad: "iPad", |
51 | 52 | iphone: "iPhone", |
52 | 53 | ipod: "iPod Touch", |
64 | 65 | } |
65 | 66 | |
66 | 67 | VERSIONS = { |
68 | edge: %r[Edge/([\d.]+)], | |
67 | 69 | chrome: %r[(?:Chrome|CriOS)/([\d.]+)], |
68 | 70 | default: %r[(?:Version|MSIE|Firefox|QuickTime|BlackBerry[^/]+|CoreMedia v|PhantomJS|AdobeAIR)[/ ]?([a-z0-9.]+)]i, |
69 | 71 | opera: %r[(?:Opera/.*? Version/([\d.]+)|Chrome/.*?OPR/([\d.]+))], |
87 | 89 | self.modern_rules.tap do |rules| |
88 | 90 | rules << -> b { b.webkit? } |
89 | 91 | rules << -> b { b.firefox? && b.version.to_i >= 17 } |
90 | rules << -> b { b.ie? && b.version.to_i >= 9 } | |
92 | rules << -> b { b.ie? && b.version.to_i >= 9 && !b.compatibility_view? } | |
93 | rules << -> b { b.edge? && !b.compatibility_view? } | |
91 | 94 | rules << -> b { b.opera? && b.version.to_i >= 12 } |
92 | 95 | rules << -> b { b.firefox? && b.tablet? && b.android? && b.version.to_i >= 14 } |
93 | 96 | end |
120 | 123 | |
121 | 124 | # Return major version. |
122 | 125 | def version |
123 | full_version.to_s.split(".").first | |
126 | if ie? | |
127 | ie_version | |
128 | else | |
129 | full_version.to_s.split(".").first | |
130 | end | |
124 | 131 | end |
125 | 132 | |
126 | 133 | # Return the full version. |
127 | 134 | def full_version |
128 | _, *v = *ua.match(VERSIONS.fetch(id, VERSIONS[:default])) | |
129 | v.compact.first || "0.0" | |
135 | if ie? | |
136 | ie_full_version | |
137 | else | |
138 | _, *v = *ua.match(VERSIONS.fetch(id, VERSIONS[:default])) | |
139 | v.compact.first || "0.0" | |
140 | end | |
130 | 141 | end |
131 | 142 | |
132 | 143 | # Return true if browser is modern (Webkit, Firefox 17+, IE9+, Opera 12+). |
136 | 147 | |
137 | 148 | # Detect if browser is WebKit-based. |
138 | 149 | def webkit? |
139 | !!(ua =~ /AppleWebKit/i) | |
150 | ua =~ /AppleWebKit/i && !edge? | |
140 | 151 | end |
141 | 152 | |
142 | 153 | # Detect if browser is QuickTime |
170 | 181 | |
171 | 182 | # Detect if browser is Chrome. |
172 | 183 | def chrome? |
173 | !!(ua =~ /Chrome|CriOS/) && !opera? | |
184 | ua =~ /Chrome|CriOS/ && !opera? && !edge? | |
174 | 185 | end |
175 | 186 | |
176 | 187 | # Detect if browser is Opera. |
0 | 0 | --- !ruby/object:Gem::Specification |
1 | 1 | name: browser |
2 | 2 | version: !ruby/object:Gem::Version |
3 | version: 0.8.0 | |
3 | version: 1.0.1 | |
4 | 4 | platform: ruby |
5 | 5 | authors: |
6 | 6 | - Nando Vieira |
7 | 7 | autorequire: |
8 | 8 | bindir: bin |
9 | 9 | cert_chain: [] |
10 | date: 2014-11-20 00:00:00.000000000 Z | |
10 | date: 2015-08-25 00:00:00.000000000 Z | |
11 | 11 | dependencies: |
12 | 12 | - !ruby/object:Gem::Dependency |
13 | 13 | name: bundler |
79 | 79 | - - ">=" |
80 | 80 | - !ruby/object:Gem::Version |
81 | 81 | version: '0' |
82 | - !ruby/object:Gem::Dependency | |
83 | name: minitest-utils | |
84 | requirement: !ruby/object:Gem::Requirement | |
85 | requirements: | |
86 | - - ">=" | |
87 | - !ruby/object:Gem::Version | |
88 | version: '0' | |
89 | type: :development | |
90 | prerelease: false | |
91 | version_requirements: !ruby/object:Gem::Requirement | |
92 | requirements: | |
93 | - - ">=" | |
94 | - !ruby/object:Gem::Version | |
95 | version: '0' | |
82 | 96 | description: Do some browser detection with Ruby. |
83 | 97 | email: |
84 | 98 | - fnando.vieira@gmail.com |
88 | 102 | files: |
89 | 103 | - ".gitignore" |
90 | 104 | - ".hound.yml" |
105 | - ".rubocop.yml" | |
91 | 106 | - ".travis.yml" |
92 | 107 | - CONTRIBUTING.md |
93 | 108 | - Gemfile |
131 | 146 | - test/spec_helper.rb |
132 | 147 | - test/ua.yml |
133 | 148 | homepage: http://github.com/fnando/browser |
134 | licenses: [] | |
149 | licenses: | |
150 | - MIT | |
135 | 151 | metadata: {} |
136 | post_install_message: | |
152 | post_install_message: |2+ | |
153 | ||
154 | #################### WARNING ############################## | |
155 | # # | |
156 | # Internet Explorer detection has changed on v1.0.0+. # | |
157 | # If this is important for you, please read # | |
158 | # https://github.com/fnando/browser#internet-explorer # | |
159 | # # | |
160 | ########################################################### | |
161 | ||
137 | 162 | rdoc_options: [] |
138 | 163 | require_paths: |
139 | 164 | - lib |
149 | 174 | version: '0' |
150 | 175 | requirements: [] |
151 | 176 | rubyforge_project: |
152 | rubygems_version: 2.2.2 | |
177 | rubygems_version: 2.4.5 | |
153 | 178 | signing_key: |
154 | 179 | specification_version: 4 |
155 | 180 | summary: Do some browser detection with Ruby. |
180 | 180 | |
181 | 181 | assert_equal "Internet Explorer", @browser.name |
182 | 182 | assert @browser.ie? |
183 | assert @browser.ie7? | |
184 | refute @browser.ie8? | |
183 | assert @browser.ie8? | |
185 | 184 | refute @browser.modern? |
186 | 185 | assert @browser.compatibility_view? |
187 | assert_equal "7.0", @browser.full_version | |
188 | assert_equal "7", @browser.version | |
186 | assert_equal "8.0", @browser.full_version | |
187 | assert_equal "8", @browser.version | |
188 | assert_equal "7.0", @browser.msie_full_version | |
189 | assert_equal "7", @browser.msie_version | |
189 | 190 | end |
190 | 191 | |
191 | 192 | it "detects ie9" do |
205 | 206 | |
206 | 207 | assert_equal "Internet Explorer", @browser.name |
207 | 208 | assert @browser.ie? |
208 | assert @browser.ie7? | |
209 | refute @browser.ie9? | |
209 | assert @browser.ie9? | |
210 | 210 | refute @browser.modern? |
211 | 211 | assert @browser.compatibility_view? |
212 | assert_equal "7.0", @browser.full_version | |
213 | assert_equal "7", @browser.version | |
212 | assert_equal "9.0", @browser.full_version | |
213 | assert_equal "9", @browser.version | |
214 | assert_equal "7.0", @browser.msie_full_version | |
215 | assert_equal "7", @browser.msie_version | |
214 | 216 | end |
215 | 217 | |
216 | 218 | it "detects ie10" do |
230 | 232 | |
231 | 233 | assert_equal "Internet Explorer", @browser.name |
232 | 234 | assert @browser.ie? |
233 | assert @browser.ie7? | |
234 | refute @browser.ie10? | |
235 | assert @browser.ie10? | |
235 | 236 | refute @browser.modern? |
236 | 237 | assert @browser.compatibility_view? |
237 | assert_equal "7.0", @browser.full_version | |
238 | assert_equal "7", @browser.version | |
238 | assert_equal "10.0", @browser.full_version | |
239 | assert_equal "10", @browser.version | |
240 | assert_equal "7.0", @browser.msie_full_version | |
241 | assert_equal "7", @browser.msie_version | |
239 | 242 | end |
240 | 243 | |
241 | 244 | it "detects ie11" do |
250 | 253 | assert_equal "11", @browser.version |
251 | 254 | end |
252 | 255 | |
256 | it "detects ie11 in compatibility view" do | |
257 | @browser.ua = $ua["IE11_COMPAT"] | |
258 | ||
259 | assert_equal "Internet Explorer", @browser.name | |
260 | assert @browser.ie? | |
261 | assert @browser.ie11? | |
262 | refute @browser.modern? | |
263 | assert @browser.compatibility_view? | |
264 | assert_equal "11.0", @browser.full_version | |
265 | assert_equal "11", @browser.version | |
266 | assert_equal "7.0", @browser.msie_full_version | |
267 | assert_equal "7", @browser.msie_version | |
268 | end | |
269 | ||
270 | it "detects Lumia 800" do | |
271 | @browser.ua = $ua["LUMIA800"] | |
272 | ||
273 | assert_equal "Internet Explorer", @browser.name | |
274 | assert @browser.ie? | |
275 | assert @browser.ie9? | |
276 | assert_equal "9.0", @browser.full_version | |
277 | assert_equal "9", @browser.version | |
278 | refute @browser.tablet? | |
279 | assert @browser.mobile? | |
280 | end | |
281 | ||
253 | 282 | it "detects opera" do |
254 | 283 | @browser.ua = $ua["OPERA"] |
255 | 284 | |
286 | 315 | it "detects modern firefox" do |
287 | 316 | @browser.ua = $ua["FIREFOX_MODERN"] |
288 | 317 | |
318 | assert_equal :firefox, @browser.id | |
289 | 319 | assert_equal "Firefox", @browser.name |
290 | 320 | assert @browser.firefox? |
291 | 321 | assert @browser.modern? |
296 | 326 | it "detects firefox android tablet" do |
297 | 327 | @browser.ua = $ua["FIREFOX_TABLET"] |
298 | 328 | |
299 | assert_equal "Android", @browser.name | |
329 | assert_equal :firefox, @browser.id | |
330 | assert_equal "Firefox", @browser.name | |
300 | 331 | assert @browser.firefox? |
301 | 332 | assert @browser.modern? |
302 | 333 | assert @browser.tablet? |
623 | 654 | assert @browser.windows? |
624 | 655 | end |
625 | 656 | |
657 | it "detects windows_xp" do | |
658 | @browser.ua = $ua["WINDOWS_XP"] | |
659 | ||
660 | assert @browser.windows? | |
661 | assert @browser.windows_xp? | |
662 | end | |
663 | ||
664 | it "detects windows_vista" do | |
665 | @browser.ua = $ua["WINDOWS_VISTA"] | |
666 | ||
667 | assert @browser.windows? | |
668 | assert @browser.windows_vista? | |
669 | end | |
670 | ||
671 | it "detects windows7" do | |
672 | @browser.ua = $ua["WINDOWS7"] | |
673 | ||
674 | assert @browser.windows? | |
675 | assert @browser.windows7? | |
676 | end | |
677 | ||
626 | 678 | it "detects windows8" do |
627 | 679 | @browser.ua = $ua["WINDOWS8"] |
628 | 680 | |
629 | 681 | assert @browser.windows? |
630 | 682 | assert @browser.windows8? |
683 | refute @browser.windows8_1? | |
631 | 684 | end |
632 | 685 | |
633 | 686 | it "detects windows8.1" do |
635 | 688 | |
636 | 689 | assert @browser.windows? |
637 | 690 | assert @browser.windows8? |
691 | assert @browser.windows8_1? | |
638 | 692 | end |
639 | 693 | |
640 | 694 | it "detects linux platform" do |
746 | 800 | it "detects windows x64" do |
747 | 801 | @browser.ua = $ua["IE10_X64_WINX64"] |
748 | 802 | assert @browser.windows_x64? |
803 | refute @browser.windows_wow64? | |
804 | assert @browser.windows_x64_inclusive? | |
805 | end | |
806 | ||
807 | it "detects windows wow64" do | |
808 | @browser.ua = $ua["WINDOWS_WOW64"] | |
809 | refute @browser.windows_x64? | |
810 | assert @browser.windows_wow64? | |
811 | assert @browser.windows_x64_inclusive? | |
749 | 812 | end |
750 | 813 | |
751 | 814 | it "detects ie11 touch desktop pc" do |
763 | 826 | assert_equal "11", @browser.version |
764 | 827 | end |
765 | 828 | |
829 | it "detects Microsoft Edge" do | |
830 | @browser.ua = $ua["MS_EDGE"] | |
831 | ||
832 | assert_equal :edge, @browser.id | |
833 | assert_equal "Microsoft Edge", @browser.name | |
834 | assert_equal "12.0", @browser.full_version | |
835 | assert_equal "12", @browser.version | |
836 | assert @browser.windows10? | |
837 | assert @browser.edge? | |
838 | assert @browser.modern? | |
839 | refute @browser.webkit? | |
840 | refute @browser.chrome? | |
841 | refute @browser.safari? | |
842 | refute @browser.mobile? | |
843 | end | |
844 | ||
845 | it "detects Microsoft Edge in compatibility view" do | |
846 | @browser.ua = $ua["MS_EDGE_COMPAT"] | |
847 | ||
848 | assert_equal :edge, @browser.id | |
849 | assert_equal "Microsoft Edge", @browser.name | |
850 | assert_equal "12.0", @browser.full_version | |
851 | assert_equal "12", @browser.version | |
852 | assert_equal "7.0", @browser.msie_full_version | |
853 | assert_equal "7", @browser.msie_version | |
854 | assert @browser.edge? | |
855 | assert @browser.compatibility_view? | |
856 | refute @browser.modern? | |
857 | refute @browser.webkit? | |
858 | refute @browser.chrome? | |
859 | refute @browser.safari? | |
860 | refute @browser.mobile? | |
861 | end | |
862 | ||
863 | it "detects Microsoft Edge Mobile" do | |
864 | @browser.ua = $ua["MS_EDGE_MOBILE"] | |
865 | ||
866 | assert_equal :edge, @browser.id | |
867 | assert_equal "Microsoft Edge", @browser.name | |
868 | assert_equal "12.0", @browser.full_version | |
869 | assert_equal "12", @browser.version | |
870 | refute @browser.windows10? | |
871 | assert @browser.windows_phone? | |
872 | assert @browser.edge? | |
873 | assert @browser.modern? | |
874 | assert @browser.mobile? | |
875 | refute @browser.webkit? | |
876 | refute @browser.chrome? | |
877 | refute @browser.safari? | |
878 | end | |
879 | ||
880 | it "detects IE without Trident" do | |
881 | @browser.ua = $ua["IE_WITHOUT_TRIDENT"] | |
882 | ||
883 | assert_equal :ie, @browser.id | |
884 | assert_equal "Internet Explorer", @browser.name | |
885 | assert_equal "0.0", @browser.msie_full_version | |
886 | assert_equal "0", @browser.msie_version | |
887 | assert_equal "0.0", @browser.full_version | |
888 | assert_equal "0", @browser.version | |
889 | refute @browser.windows10? | |
890 | refute @browser.windows_phone? | |
891 | refute @browser.edge? | |
892 | refute @browser.modern? | |
893 | refute @browser.mobile? | |
894 | refute @browser.webkit? | |
895 | refute @browser.chrome? | |
896 | refute @browser.safari? | |
897 | end | |
898 | ||
899 | it "detects Daumoa" do | |
900 | @browser.ua = $ua["DAUMOA"] | |
901 | ||
902 | assert_equal :ie, @browser.id | |
903 | assert_equal "Internet Explorer", @browser.name | |
904 | assert_equal "0.0", @browser.msie_full_version | |
905 | assert_equal "0", @browser.msie_version | |
906 | assert_equal "0.0", @browser.full_version | |
907 | assert_equal "0", @browser.version | |
908 | assert @browser.ie? | |
909 | refute @browser.windows10? | |
910 | refute @browser.windows_phone? | |
911 | refute @browser.edge? | |
912 | refute @browser.modern? | |
913 | refute @browser.mobile? | |
914 | refute @browser.webkit? | |
915 | refute @browser.chrome? | |
916 | refute @browser.safari? | |
917 | end | |
918 | ||
766 | 919 | it "detects kindle monochrome" do |
767 | 920 | @browser.ua = $ua["KINDLE"] |
768 | 921 | |
869 | 1022 | |
870 | 1023 | it "detects bots" do |
871 | 1024 | %w[ |
1025 | APPLE_BOT | |
872 | 1026 | DOT_BOT |
873 | 1027 | FACEBOOK_BOT |
874 | 1028 | GOOGLE_BOT |
875 | 1029 | LINKDEXBOT |
876 | 1030 | LOAD_TIME_BOT |
877 | 1031 | MAIL_RU |
1032 | MEGAINDEX_RU | |
878 | 1033 | MSN_BOT |
1034 | QUERYSEEKER | |
879 | 1035 | SCRAPY |
880 | 1036 | YANDEX_DIRECT |
881 | 1037 | YANDEX_METRIKA |
886 | 1042 | |
887 | 1043 | @browser.ua = $ua["CHROME"] |
888 | 1044 | refute @browser.bot? |
1045 | end | |
1046 | ||
1047 | it "detects Google Page Speed as a bot" do | |
1048 | @browser.ua = $ua["GOOGLE_PAGE_SPEED_INSIGHTS"] | |
1049 | assert @browser.bot? | |
889 | 1050 | end |
890 | 1051 | |
891 | 1052 | it "doesn't consider empty UA as bot" do |
951 | 1112 | end |
952 | 1113 | end |
953 | 1114 | |
1115 | it "detects Google Structured Data Testing Tool as a bot" do | |
1116 | @browser.ua = $ua["GOOGLE_STRUCTURED_DATA_TESTING_TOOL"] | |
1117 | ||
1118 | assert @browser.bot?, "Google Structured Data Testing Tool should be a bot" | |
1119 | end | |
1120 | ||
954 | 1121 | it "knows a supported browser" do |
955 | 1122 | @browser.ua = "Chrome" |
956 | 1123 | assert @browser.known? |
0 | 0 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) |
1 | 1 | require "bundler/setup" |
2 | 2 | require "minitest/autorun" |
3 | require "minitest/unit" | |
3 | require "minitest/utils" | |
4 | 4 | require "browser" |
5 | 5 | require "yaml" |
6 | 6 |
0 | 0 | ADOBE_AIR: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/13.0' |
1 | 1 | ANDROID: 'Android SDK 1.5r3: Mozilla/5.0 (Linux; U; Android 1.5; de-; sdk Build/CUPCAKE) AppleWebkit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1' |
2 | 2 | ANDROID_WITH_SAFARI: 'Mozilla/5.0 (Linux; U; Android 4.3; en-us; SCH-I535 Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30' |
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 | BAIDU: 'Baiduspider+(+http://www.baidu.com/search/spider.htm)' |
5 | 6 | BINGBOT: 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)' |
19 | 20 | FIREFOX_MODERN: 'Mozilla/5.0 (X11; Ubuntu; Linux armv7l; rv:17.0) Gecko/20100101 Firefox/17.0' |
20 | 21 | FIREFOX_TABLET: 'Mozilla/5.0 (Android; Tablet; rv:14.0) Gecko/14.0 Firefox/14.0' |
21 | 22 | GOOGLE_BOT: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' |
23 | GOOGLE_PAGE_SPEED_INSIGHTS: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko; Google Page Speed Insights) Chrome/22.0.1229 Safari/537.4' | |
24 | GOOGLE_STRUCTURED_DATA_TESTING_TOOL: 'Mozilla/5.0 (compatible; X11; Linux x86_64; Google-StructuredDataTestingTool; +http://www.google.com/webmasters/tools/richsnippets)' | |
25 | DAUMOA: Mozilla/5.0 (compatible; MSIE or Firefox mutant; not on Windows server;) Daumoa 4.0 | |
26 | IE_WITHOUT_TRIDENT: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.0) .NET CLR 2.0.50727) | |
22 | 27 | IE10: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; EIE10;ENUSMSN)' |
23 | 28 | IE10_COMPAT: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; EIE10;ENUSMSN)' |
24 | 29 | IE10_X64_WINX64: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)' |
25 | 30 | IE11: 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko' |
26 | 31 | IE11_TOUCH_SCREEN: 'Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko' |
32 | IE11_COMPAT: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)' | |
27 | 33 | IE6: 'Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)' |
28 | 34 | IE7: 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)' |
29 | 35 | IE8: 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)' |
30 | 36 | IE8_COMPAT: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; Media Center PC 5.0; .NET CLR 3.5.21022)' |
31 | 37 | IE9: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)' |
32 | 38 | IE9_COMPAT: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)' |
39 | MS_EDGE: 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0' | |
40 | MS_EDGE_COMPAT: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/8.0; .NET4.0C; .NET4.0E; Tablet PC 2.0; Microsoft Outlook 15.0.4433; ms-office; MSOffice 15)' | |
41 | MS_EDGE_MOBILE: 'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; DEVICE INFO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0' | |
33 | 42 | 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' |
34 | 43 | 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' |
35 | 44 | 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' |
44 | 53 | KINDLE_FIRE_HD_MOBILE: 'Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true' |
45 | 54 | LINKDEXBOT: 'Mozilla/5.0 (compatible; linkdexbot/2.0; +http://www.linkdex.com/bots/)' |
46 | 55 | LOAD_TIME_BOT: 'Mozilla/5.0 (compatible; LoadTimeBot/0.9; +http://www.loadtime.net/bot.html)' |
56 | LUMIA800: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; XBLWP7; ZuneWP7' | |
47 | 57 | MAIL_RU: 'Mozilla/5.0 (compatible; Linux x86_64; Mail.RU_Bot/2.0; +http://go.mail.ru/help/robots)' |
58 | MEGAINDEX_RU: 'Mozilla/5.0 (compatible; MegaIndex.ru/2.0; +https://www.megaindex.ru/?tab=linkAnalyze)' | |
48 | 59 | MOBILE_CHROME: 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3' |
49 | 60 | MSN_BOT: 'msnbot-media/1.1 (+http://search.msn.com/msnbot.htm)' |
50 | 61 | NEXUS_TABLET: 'Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19' |
62 | 73 | PSP: 'Mozilla/4.0 (PSP (PlayStation Portable); 2.00)' |
63 | 74 | PSP_VITA: 'Mozilla/5.0 (Playstation Vita 1.61) AppleWebKit/531.22.8 (KHTML, like Gecko) Silk/3.2' |
64 | 75 | QUICKTIME: 'QuickTime/7.6.8 (qtver=7.6.8;os=Windows NT 5.1Service Pack 3)' |
76 | QUERYSEEKER: 'QuerySeekerSpider ( http://queryseeker.com/bot.html )' | |
65 | 77 | SAFARI: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8' |
66 | 78 | SAFARI_IPAD_WEBAPP_MODE: 'Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405' |
67 | 79 | SAFARI_IPHONE_WEBAPP_MODE: 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.20 (KHTML, like Gecko) Mobile/7B298g' |
71 | 83 | SMART_TV: 'Mozilla/5.0 (SmartHub; SMART-TV; U; Linux/SmartTV) AppleWebKit/531.2+ (KHTML, like Gecko) WebBrowser/1.0 SmartTV Safari/531.2+' |
72 | 84 | SURFACE: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)' |
73 | 85 | TABLOID: 'Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13' |
86 | WINDOWS_XP: 'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; FDM; .NET CLR 1.1.4322)' | |
87 | WINDOWS_VISTA: 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)' | |
88 | WINDOWS7: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) chromeframe/10.0.648.205' | |
74 | 89 | WINDOWS81: 'Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko' |
75 | 90 | WINDOWS8: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)' |
91 | WINDOWS_WOW64: "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko" | |
76 | 92 | WINDOWS_MOBILE: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12)' |
77 | 93 | WINDOWS_PHONE8: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)' |
78 | 94 | WINDOWS_PHONE: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)' |