browserino 4.1.0 → 4.2.0

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.
@@ -3,12 +3,17 @@
3
3
  Browserino.config.define do
4
4
  # aliasses will be defined after a Client has been initialized
5
5
  # only the aliasses matching the Client will be defined
6
- alias_for :firefox, :ff
7
- alias_for :windows, :win
8
- alias_for :macintosh, :mac, :osx, :macos
9
- alias_for :blackberry, :bb
10
- alias_for :ie, :internet_explorer
11
- alias_for :facebook, :fb
12
- alias_for :duckduckgo, :ddg
13
- alias_for :chromeos, :cros
6
+ alias_for :firefox, :ff
7
+ alias_for :windows, :win
8
+ alias_for :windows7, :win7
9
+ alias_for :windows8, :win8
10
+ alias_for :windows10, :win10
11
+ alias_for :macintosh, :mac, :osx, :macos
12
+ alias_for :blackberry, :bb
13
+ alias_for :ie, :internet_explorer
14
+ alias_for :facebook, :fb
15
+ alias_for :duckduckgo, :ddg
16
+ alias_for :chromeos, :cros
17
+ alias_for :nintendobrowser, :netfrontbrowser
18
+ alias_for :ipd, :alertsite
14
19
  end
@@ -1,35 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Browserino.config.define do
4
- # executes before parsing the user agent, 's' in this case is the actual
5
- # user agent string in full glory. Do manipulations as you wish, I'm
4
+ # executes before parsing the user agent, 'ua' in this case is the actual
5
+ # user agent string in its full glory. Do manipulations as you wish, I'm
6
6
  # using it to successfully strip lies from the user agent and to sometimes
7
7
  # simplify a word e.g. 'AppleWebKit' => 'webkit'
8
8
 
9
9
  # the returned result will be used as the user agent to parse so make
10
10
  # sure to return the final ua at the end
11
11
  before_parse do |ua|
12
- ua = ua.gsub(%r{applewebkit}i, 'webkit').gsub %r{(Mozilla/[\d\.]+)}i, ''
13
- ua = ua.gsub(%r{chrome|safari}i, '').gsub('OPR', 'opera') if ua =~ %r{OPR}
14
- ua = ua.gsub %r{9\.80}, '' if ua =~ %r{opera}i
15
- ua = ua.gsub %r{webkit/}i, '' if ua =~ %r{presto}i
16
- ua = ua.gsub %r{(?:ms)?ie\b}i, '' if ua =~ %r{rv:}i
17
- ua = ua.gsub %r{android|linux}i, '' if ua =~ %r{tizen}i
18
- ua = ua.gsub %r{linux}i, '' if ua =~ %r{android|s(unos|olaris)|w(eb)?os}i
19
- ua = ua.gsub %r{x11}i, '' if ua =~ %r{bsd|s(unos|olaris)}i
20
- ua = ua.gsub %r{windows\snt}i, '' if ua =~ %r{windows\sphone}i
21
- ua = ua.gsub %r{rv:}i, '' if ua =~ %r{servo}i
22
- ua = ua.gsub %r{mac\sos\sx}i, '' if ua =~ %r{ip(?:[ao]d|hone)}i
23
- ua = ua.gsub %r{msie}i, '' if ua =~ %r{huaweisymantecspider}i
24
- ua = ua.gsub %r{risc\sos}i, 'risc' if ua =~ %r{risc\sos}i
25
- ua = ua.gsub %r{msie}i, '' if ua =~ %r{surf|\w*bot}i
26
- ua = ua.gsub %r{safari}i, 'chrome' if ua =~ %r{bluechrome}i
27
- ua = ua.gsub %r{msie|windows}i, '' if ua =~ %r{dts\sagent}i
28
- ua = ua.gsub %r{blade\sos}i, 'blade-os' if ua =~ %r{future\sstar}i
29
- ua = ua.gsub %r{safari}i, '' if ua =~ %r{obigo}i
30
- ua = ua.gsub %r{awesomium}i, '' if ua =~ %r{flashfire}i
31
- ua = ua.gsub %r{version}i, '' if ua =~ %r{kindle/\d}i
32
- ua
12
+ subs = [[%r{applewebkit}i, 'webkit'], [%r{(Mozilla/[\d\.]+)}i, ''],
13
+ [%r{\sAdr\s}, 'Android '], ['X11', '']]
14
+ subs << [%r{Chrome|Safari}, ''] if ua =~ %r{nichrome|digg\sfeed|quiterss}i
15
+ subs << [%r{9\.80}, ''] if ua =~ %r{opera}i
16
+ subs << [%r{webkit/}i, ''] if ua =~ %r{presto}i
17
+ subs << [%r{android|linux}i, ''] if ua =~ %r{tizen|windows\sphone}i
18
+ subs << [%r{linux}i, ''] if ua =~ %r{android|s(unos|olaris)|w(eb)?os}i
19
+ subs << [%r{windows\snt}i, ''] if ua =~ %r{windows\sphone}i
20
+ subs << [%r{Windows\s\d+}, 'windows'] if ua =~ %r{^ice\sbrowser}i
21
+ subs << [%r{rv:}i, ''] if ua =~ %r{servo}i
22
+ subs << [%r{mac\sos\sx|macintosh}i, ''] if ua =~ %r{ip(?:[ao]d|hone)|fxos}i
23
+ subs << [%r{msie}i, ''] if ua =~ %r{huaweisymantecspid|surf|\w*bot
24
+ |windows-rss|yahoo(?:se)?}xi
25
+ subs << [%r{risc\sos}i, 'risc'] if ua =~ %r{risc\sos}i
26
+ subs << [%r{msie|windows}i, ''] if ua =~ %r{dts\sagent}i
27
+ subs << [%r{blade\sos}i, 'blade-os'] if ua =~ %r{future\sstar}i
28
+ subs << [%r{awesomium}i, ''] if ua =~ %r{flashfire}i
29
+ subs << [%r{firefox}i, ''] if ua =~ %r{ips-agent}i
30
+ subs << [%r{newsgator}i, ''] if ua =~ %r{newswire}i
31
+
32
+ subs.reduce(ua) { |acc, elem| acc.gsub(*elem) }
33
33
  end
34
34
 
35
35
  # after a matcher is found, it's values are filtered in two stages
@@ -43,7 +43,7 @@ Browserino.config.define do
43
43
  filter do |val|
44
44
  case val
45
45
  when TrueClass, FalseClass, NilClass, Proc then val
46
- when %r{\A[\d_\.]+\z}i then val.to_s.strip.tr('_', '.')
46
+ when %r{\A[\d_\.]+\z}i then val.to_s.strip.tr '_', '.'
47
47
  else val.to_s.downcase.strip.gsub(%r{[\s-]+}i, '_').to_sym
48
48
  end
49
49
  end
@@ -57,12 +57,26 @@ Browserino.config.define do
57
57
 
58
58
  filter :platform do |val|
59
59
  if %r{ip(?:[ao]d|hone)}i =~ val then :ios
60
+ elsif %r{^symbian$}i =~ val then :symbianos
60
61
  elsif %r{w(?:eb)?os}i =~ val then :webos
61
- elsif %r{ubuntu|x11}i =~ val then :linux
62
+ elsif %r{ubuntu|debian}i =~ val then :linux
62
63
  elsif %r{mac_os_x}i =~ val then :macintosh
63
64
  elsif %r{s(?:unos|olaris)}i =~ val then :solaris
64
65
  elsif %r{cros}i =~ val then :chromeos
65
66
  elsif %r{kindle|kf\w+}i =~ val then :fire_os
67
+ elsif %r{fxos}i =~ val then :firefox_os
68
+ else val
69
+ end
70
+ end
71
+
72
+ filter :device do |val|
73
+ if %r{kf\w*}i =~ val then :kindle
74
+ elsif %r{lg[-l_]}i =~ val then :lg
75
+ elsif %r{\w+tab}i =~ val then :lenovo
76
+ elsif %r{lumia}i =~ val then :nokia
77
+ elsif %r{^moto}i =~ val then :motorola
78
+ elsif %r{\d+dl|venue}i =~ val then :dell
79
+ elsif %r{me\d+x|a\df;|transformer|slider}i =~ val then :asus
66
80
  else val
67
81
  end
68
82
  end
@@ -73,7 +87,7 @@ Browserino.config.define do
73
87
  val
74
88
  end
75
89
 
76
- filter :mobile do |value|
90
+ filter :mobile, :tablet, :smarttv, :bad do |value|
77
91
  !value.to_s.strip.empty?
78
92
  end
79
93
  end
@@ -11,41 +11,42 @@ Browserino.config.define do
11
11
  # client.platform_label? :mavericks and they can also be used in
12
12
  # the method this alias is for, e.g. client.platform? :mavericks or
13
13
  # client.is? :mavericks
14
- label :android, for: :android, range: '1'..'1.4.9'
15
- label :cupcake, for: :android, range: '1.5'..'1.9.9'
16
- label :eclair, for: :android, range: '2'..'2.1'
17
- label :froyo, for: :android, range: '2.2'..'2.2.3'
18
- label :gingerbread, for: :android, range: '2.2.4'..'2.3.7'
19
- label :honeycomb, for: :android, range: '3'..'3.2.6'
20
- label :ice_cream_sandwich, for: :android, range: '4'..'4.0.4'
21
- label :jelly_bean, for: :android, range: '4.1'..'4.3.1'
22
- label :kitkat, for: :android, range: '4.4'..'4.4.4'
23
- label :lollipop, for: :android, range: '5'..'5.1.1'
24
- label :marshmallow, for: :android, range: '6'..'6.1.1'
25
- label :nougat, for: :android, range: '7'..'7.1.1'
14
+ label :android, for: :android, range: '1'..'1.4.9'
15
+ label :cupcake, for: :android, range: '1.5'..'1.9.9'
16
+ label :eclair, for: :android, range: '2'..'2.1'
17
+ label :froyo, for: :android, range: '2.2'..'2.2.3'
18
+ label :gingerbread, for: :android, range: '2.2.4'..'2.3.7'
19
+ label :honeycomb, for: :android, range: '3'..'3.2.6'
20
+ label :ice_cream_sandwich, for: :android, range: '4'..'4.0.4'
21
+ label :jelly_bean, for: :android, range: '4.1'..'4.3.1'
22
+ label :kitkat, for: :android, range: '4.4'..'4.4.4'
23
+ label :lollipop, for: :android, range: '5'..'5.1.1'
24
+ label :marshmallow, for: :android, range: '6'..'6.1.1'
25
+ label :nougat, for: :android, range: '7'..'7.1.1'
26
+ label :oreo, for: :android, range: '8.0'..'8.0.9'
26
27
 
27
- label :cheetah, for: :macintosh, range: '10.0'..'10.0.9'
28
- label :puma, for: :macintosh, range: '10.1'..'10.1.9'
29
- label :jaguar, for: :macintosh, range: '10.2'..'10.2.9'
30
- label :panther, for: :macintosh, range: '10.3'..'10.3.9'
31
- label :tiger, for: :macintosh, range: '10.4'..'10.4.9'
32
- label :leopard, for: :macintosh, range: '10.5'..'10.5.9'
33
- label :snow_leopard, for: :macintosh, range: '10.6'..'10.6.9'
34
- label :lion, for: :macintosh, range: '10.7'..'10.7.9'
35
- label :mountain_lion, for: :macintosh, range: '10.8'..'10.8.9'
36
- label :mavericks, for: :macintosh, range: '10.9'..'10.9.9'
37
- label :yosemite, for: :macintosh, range: '10.10'..'10.10.9'
38
- label :el_capitan, for: :macintosh, range: '10.11'..'10.11.9'
39
- label :sierra, for: :macintosh, range: '10.12'..'10.12.9'
28
+ label :cheetah, for: :macintosh, range: '10.0'..'10.0.9'
29
+ label :puma, for: :macintosh, range: '10.1'..'10.1.9'
30
+ label :jaguar, for: :macintosh, range: '10.2'..'10.2.9'
31
+ label :panther, for: :macintosh, range: '10.3'..'10.3.9'
32
+ label :tiger, for: :macintosh, range: '10.4'..'10.4.9'
33
+ label :leopard, for: :macintosh, range: '10.5'..'10.5.9'
34
+ label :snow_leopard, for: :macintosh, range: '10.6'..'10.6.9'
35
+ label :lion, for: :macintosh, range: '10.7'..'10.7.9'
36
+ label :mountain_lion, for: :macintosh, range: '10.8'..'10.8.9'
37
+ label :mavericks, for: :macintosh, range: '10.9'..'10.9.9'
38
+ label :yosemite, for: :macintosh, range: '10.10'..'10.10.9'
39
+ label :el_capitan, for: :macintosh, range: '10.11'..'10.11.9'
40
+ label :sierra, for: :macintosh, range: '10.12'..'10.12.9'
40
41
 
41
- label :dos, for: :windows, range: '3.1'..'4.0'
42
- label :windows98, for: :windows, range: '98'..'98.9.9'
43
- label :windows2000, for: :windows, range: '5.0'..'5.0.9'
44
- label :xp, for: :windows, range: '5.1'..'5.2.9'
45
- label :vista, for: :windows, range: '6.0'..'6.0.9'
46
- label :windows7, for: :windows, range: '6.1'..'6.1.9'
47
- label :windows8, for: :windows, range: '6.2'..'6.3'
48
- label :windows10, for: :windows, range: '10.0'..'10.9.9'
49
-
50
- label :outlook2016, for: :outlook, range: '16.0'..'16.9.9'
42
+ label :dos, for: :windows, range: '3.1'..'4.0'
43
+ label :windows98, for: :windows, range: '98'..'98.9.9'
44
+ label :windows2000, for: :windows, range: '5.0'..'5.0.9'
45
+ label :xp, for: :windows, range: '5.1'..'5.2.9'
46
+ label :vista, for: :windows, range: '6.0'..'6.0.9'
47
+ label :windows7, for: :windows, range: '6.1'..'6.1.9'
48
+ label :windows8, for: :windows, range: '6.2'..'6.3'
49
+ label :windows10, for: :windows, range: '10.0'..'10.9.9'
50
+ label :windows10, for: :windows_phone, range: '10.0'..'10.9.9'
51
+ label :outlook2016, for: :outlook, range: '16.0'..'16.9.9'
51
52
  end
@@ -0,0 +1,208 @@
1
+ # frozen_string_literal: true
2
+
3
+ # automatically set type to :bot for each defined matcher
4
+ # additionally, set text to true to each of the matchers automatically
5
+ # the property 'good' here is defined as a proc, it calls an instance method
6
+ # on the current Client object (!bad).
7
+
8
+ # Since procs are defined after all other methods, the property bad defined
9
+ # here will be defined as a method before good is run, this makes
10
+ # them order-indepentent when adding them
11
+ Browserino.config.bots text: true, good: proc { !bad },
12
+ bad: %r{(extrac|harvest)}i do
13
+ match %r{huaweisymantecspider}i, name: :huaweisymantecspider
14
+ match %r{atomic_email_hunter}i, name: :atomic_email_hunter
15
+ match %r{netresearchserver}i, name: :netresearchserver
16
+ match %r{autoemailspider}i, name: :auto_email_spider
17
+ match %r{flaming\sattackbot}i, name: :flaming_attackbot
18
+ match %r{addsugarspiderbot}i, name: :addsugarspiderbot
19
+ match %r{semanticdiscovery}i, name: :semanticdiscovery
20
+ match %r{xaldon_webspider}i, name: :xaldon_webspider
21
+ match %r{yooglifetchagent}i, name: :yooglifetchagent
22
+ match %r{keyword\sdensity}i, name: :keyword_density
23
+ match %r{mass\sdownloader}i, name: :mass_downloader
24
+ match %r{safetynet\srobot}i, name: :safetynet_robot
25
+ match %r{download\sdemon}i, name: :download_demon
26
+ match %r{internet\sninja}i, name: :internet_ninja
27
+ match %r{dataparksearch}i, name: :dataparksearch
28
+ match %r{boston[_\s]project}i, name: :boston_project
29
+ match %r{emailcollector}i, name: :emailcollector
30
+ match %r{webemailextrac}i, name: :webemailextrac
31
+ match %r{sitelockspider}i, name: :sitelockspider
32
+ match %r{morning\spaper}i, name: :morning_paper
33
+ match %r{4anything}i, name: :four_anything
34
+ match %r{aqua_products}i, name: :aqua_products
35
+ match %r{arachnophilia}i, name: :arachnophilia
36
+ match %r{smartdownload}i, name: :smartdownload
37
+ match %r{emeraldshield}i, name: :emeraldshield
38
+ match %r{womlpefactory}i, name: :womlpefactory
39
+ match %r{israelisearch}i, name: :israelisearch
40
+ match %r{issuecrawler}i, name: :issuecrawler
41
+ match %r{jaxified\sbot}i, name: :jaxified_bot
42
+ match %r{stackrambler}i, name: :stackrambler
43
+ match %r{turnitinbot}i, name: :turnitinbot
44
+ match %r{covario-ids}i, name: :covario_ids
45
+ match %r{alkaline}i, name: :alkalinebot
46
+ match %r{yahoo\!\sslurp}i, name: :yahoo_slurp
47
+ match %r{propowerbot}i, name: :propowerbot
48
+ match %r{emailsiphon}i, name: :emailsiphon
49
+ match %r{backdoorbot}i, name: :backdoorbot
50
+ match %r{terrawizbot}i, name: :terrawizbot
51
+ match %r{searchsight}i, name: :searchsight
52
+ match %r{baiduspider}i, name: :baiduspider
53
+ match %r{sandcrawler}i, name: :sandcrawler
54
+ match %r{fyberspider}i, name: :fyberspider
55
+ match %r{linguee\sbot}i, name: :linguee_bot
56
+ match %r{big\sbrother}i, name: :big_brother
57
+ match %r{yahooseeker}i, name: :yahooseeker
58
+ match %r{noxtrumbot}i, name: :noxtrumbot
59
+ match %r{black\shole}i, name: :black_hole
60
+ match %r{blackwidow}i, name: :blackwidow
61
+ match %r{sosospider}i, name: :sosospider
62
+ match %r{duckduckgo}i, name: :duckduckgo
63
+ match %r{beslistbot}i, name: :beslistbot
64
+ match %r{twitterbot}i, name: :twitterbot
65
+ match %r{linkdexbot}i, name: :linkdexbot
66
+ match %r{aitcsrobot}i, name: :aitcsrobot
67
+ match %r{litefinder}i, name: :litefinder
68
+ match %r{mabontland}i, name: :mabontland
69
+ match %r{yasaklibot}i, name: :yasaklibot
70
+ match %r{rpt-httpclient}i, name: :httpclient
71
+ match %r{ahrefsbot}i, name: :ahrefsbot
72
+ match %r{mojeekbot}i, name: :mojeekbot
73
+ match %r{incywincy}i, name: :incywincy
74
+ match %r{seznambot}i, name: :seznambot
75
+ match %r{girafabot}i, name: :girafabot
76
+ match %r{becomebot}i, name: :becomebot
77
+ match %r{dts\sagent}i, name: :dts_agent
78
+ match %r{emailwolf}i, name: :emailwolf
79
+ match %r{googlebot}i, name: :googlebot
80
+ match %r{omgilibot}i, name: :omgilibot
81
+ match %r{labelgrab}i, name: :labelgrab
82
+ match %r{altavista}i, name: :altavista
83
+ match %r{yandexbot}i, name: :yandexbot
84
+ match %r{newsgator}i, name: :newsgator
85
+ match %r{instagram}i, name: :instagram
86
+ match %r{pinterest}i, name: :pinterest
87
+ match %r{gurujibot}i, name: :gurujibot
88
+ match %r{lapozzbot}i, name: :lapozzbot
89
+ match %r{mvaclient}i, name: :mvaclient
90
+ match %r{ng-search}i, name: :ng_search
91
+ match %r{youdaobot}i, name: :youdaobot
92
+ match %r{webcopier}i, name: :webcopier
93
+ match %r{ips-agent}i, name: :ips_agent
94
+ match %r{yodaobot}i, name: :yodaobot
95
+ match %r{ldspider}i, name: :ldspider
96
+ match %r{lexxebot}i, name: :lexxebot
97
+ match %r{scoutjet}i, name: :scoutjet
98
+ match %r{linkedinbot}i, name: :linkedin
99
+ match %r{bullseye}i, name: :bullseye
100
+ match %r{alexibot}i, name: :alexibot
101
+ match %r{whatsapp}i, name: :whatsapp
102
+ match %r{face(?:bookexternalhit|bot)}i, name: :facebook
103
+ match %r{getright}i, name: :getright
104
+ match %r{asterias}i, name: :asterias
105
+ match %r{catchbot}i, name: :catchbot
106
+ match %r{discobot}i, name: :discobot
107
+ match %r{geniebot}i, name: :geniebot
108
+ match %r{koepabot}i, name: :koepabot
109
+ match %r{synoobot}i, name: :synoobot
110
+ match %r{rufusbot}i, name: :rufusbot
111
+ match %r{rampybot}i, name: :rampybot
112
+ match %r{mogimogi}i, name: :mogimogi
113
+ match %r{lmspider}i, name: :lmspider
114
+ match %r{blowfish}i, name: :blowfish
115
+ match %r{superbot}i, name: :superbot
116
+ match %r{valkyrie}i, name: :valkyrie
117
+ match %r{yacybot}i, name: :yacybot
118
+ match %r{jyxobot}i, name: :jyxobot
119
+ match %r{orbiter}i, name: :orbiter
120
+ match %r{polybot}i, name: :polybot
121
+ match %r{accoona}i, name: :accoona
122
+ match %r{mj12bot}i, name: :mj12bot
123
+ match %r{aspider}i, name: :aspider
124
+ match %r{blexbot}i, name: :blexbot
125
+ match %r{bspider}i, name: :bspider
126
+ match %r{auresys}i, name: :auresys
127
+ match %r{bingbot}i, name: :bingbot
128
+ match %r{gaisbot}i, name: :gaisbot
129
+ match %r{zealbot}i, name: :zealbot
130
+ match %r{zspider}i, name: :zspider
131
+ match %r{backrub}i, name: :backrub
132
+ match %r{harvest}i, name: :harvest
133
+ match %r{nymesis}i, name: :nymesis
134
+ match %r{radian6}i, name: :radian6
135
+ match %r{scrubby}i, name: :scrubby
136
+ match %r{gcreep}i, name: :gcreep
137
+ match %r{snappy}i, name: :snappy
138
+ match %r{vortex}i, name: :vortex
139
+ match %r{tineye}i, name: :tineye
140
+ match %r{zyborg}i, name: :zyborg
141
+ match %r{sqworm}i, name: :sqworm
142
+ match %r{qseero}i, name: :qseero
143
+ match %r{pompos}i, name: :pompos
144
+ match %r{solbot}i, name: :solbot
145
+ match %r{ichiro}i, name: :ichiro
146
+ match %r{bizbot}i, name: :bizbot
147
+ match %r{msnbot}i, name: :msnbot
148
+ match %r{exabot}i, name: :exabot
149
+ match %r{msrbot}i, name: :msrbot
150
+ match %r{dotbot}i, name: :dotbot
151
+ match %r{cosmos}i, name: :cosmos
152
+ match %r{ecatch}i, name: :ecatch
153
+ match %r{scrapy}i, name: :scrapy
154
+ match %r{tumblr}i, name: :tumblr
155
+ match %r{holmes}i, name: :holmes
156
+ match %r{okhttp}i, name: :okhttp
157
+ match %r{mxbot}i, name: :mxbot
158
+ match %r{moget}i, name: :moget
159
+ match %r{occam}i, name: :occam
160
+ match %r{acoon}i, name: :acoon
161
+ match %r{nutch}i, name: :nutch
162
+ match %r{ia_archiver}i, name: :alexa
163
+ match %r{atomz}i, name: :atomz
164
+ match %r{htdig}i, name: :htdig
165
+ match %r{peew}i, name: :peew
166
+ match %r{yeti}i, name: :yeti
167
+ match %r{wf84}i, name: :wf84
168
+ match %r{vyu2}i, name: :vyu2
169
+ match %r{acoi}i, name: :acoi
170
+ match %r{\sobot}i, name: :obot
171
+ match %r{(?:ask)\sjeeves}i, name: :ask
172
+ match %r{b2w}i, name: :b2w
173
+ match %r{ipd/}i, name: :ipd
174
+ match %r{zao}i, name: :zao
175
+
176
+ match %r{furlbot}i, name: :furlbot,
177
+ version: %r{rl\ssearch\s([\d\.]+)}i
178
+
179
+ match %r{jakarta}i, name: :jakarta,
180
+ version: %r{client/([\d\.]+)}i
181
+
182
+ match %r{oegp}i, name: :oegp,
183
+ version: %r{v\.\s([\d\.]+)}i
184
+
185
+ match %r{l\.webis}i, name: :lwebis,
186
+ version: %r{webis/([\d\.]+)}i
187
+
188
+ match %r{cerberian\sdrtrs}i, name: :cerberian_drtrs,
189
+ version: %r{version[-/]([\d\.]+)}i
190
+
191
+ match %r{gigamega}i, name: :gigamega,
192
+ version: %r{mega\.bot/([\d\.]+)}i
193
+
194
+ match %r{sogou(?:\s\w+)?\s?spider}i, name: :sogou_spider,
195
+ version: %r{spider/([\d\.]+)}i
196
+
197
+ match %r{megaindex}i, name: :megaindex,
198
+ version: %r{index\.ru/([\d\.]+)}i
199
+
200
+ match %r{go\!zilla}i, name: :gozilla,
201
+ version: %r{go\!zilla\s([\d\.]+)}i
202
+
203
+ match %r{larbin}i, name: :larbin,
204
+ version: %r{larbin_([\d\.]+)}i
205
+
206
+ match %r{netseer}i, name: :netseer,
207
+ version: %r{\scrawler/([\d\.]+)}i
208
+ end
@@ -0,0 +1,377 @@
1
+ # frozen_string_literal: true
2
+
3
+ Browserino.config.browsers do
4
+ # a single matcher that will create a matcher for a specific match
5
+ # matchers are added in an array in order of definition - higher is better
6
+ # aliasses are prepended to the list instead of appended (e.g. like blocks)
7
+ # this ensures that aliasses will be matched before any regular matcher
8
+ match %r{maxthon}i do
9
+ # define properties by calling a method with the desired name and:
10
+ # -- value # => will create a static method that returns that value
11
+ # -- /(pat)/ # => will create a method that scans the UA and
12
+ # saves the first capture group
13
+ # -- { blk } # => will create a dynamic method that returns the result
14
+ # of the block, it will be executed within an
15
+ # instantiated Client object (right after creation)
16
+ name :maxthon
17
+ engine %r{(webkit|presto|gecko|trident)}i
18
+ end
19
+
20
+ match %r{ucbrowser}i do
21
+ name :ucbrowser
22
+ engine %r{(trident|gecko|webkit|presto)}i
23
+ end
24
+
25
+ match %r{edge}i do
26
+ name :edge
27
+ engine :edge
28
+ modern true
29
+ end
30
+
31
+ match %r{ope?ra?\smini}i do
32
+ name :opera_mini
33
+ version %r{ope?ra?\smini/([\d\.]+)}i
34
+ engine %r{(presto|webkit)}i
35
+ end
36
+
37
+ match %r{ope?ra?[^\w]}i do
38
+ name :opera
39
+ version %r{(?:ope?ra?[\s/]|version/)([\d\.]+)}i
40
+ engine %r{(presto|webkit)}i
41
+ end
42
+
43
+ # escape has to come before IE
44
+ match %r{escape}i, name: :escape
45
+
46
+ match %r{flock}i, name: :flock, engine: %r{(webkit|gecko|servo)}i,
47
+ engine_version: %r{(?:webkit|rv:|servo)[\s/]?([\d\.]+)}i
48
+
49
+ match %r{sunrise}i, name: :sunrise, engine: %r{(webkit|gecko|servo)}i,
50
+ engine_version: %r{(?:webkit|rv:|servo)[\s/]?([\d\.]+)}i
51
+
52
+ match %r{msie|trident}i do
53
+ name :ie
54
+ engine :trident
55
+ version %r{(?:(?:ms)?ie\s|rv:)([\d\.]+)}i
56
+ modern { version >= 10 }
57
+ end
58
+
59
+ match %r{origyn\sweb\sbrowser}i, name: :origyn, engine: :webkit
60
+ match %r{webpositive}i, name: :webpositive, engine: :webkit
61
+ match %r{nintendobrowser}i, name: :nintendobrowser, engine: :webkit
62
+ match %r{deskbrowse}i, name: :deskbrowse, engine: :webkit
63
+ match %r{qupzilla}i, name: :qupzilla, engine: :webkit
64
+ match %r{midori}i, name: :midori, engine: :webkit
65
+ match %r{shiira}i, name: :shiira, engine: :webkit
66
+ match %r{element\sbrowser}i, name: :element_browser, engine: :webkit
67
+ match %r{amigavoyager}i, name: :amigavoyager
68
+ match %r{acorn\sbrowse}i, name: :browse
69
+ match %r{mothra}i, name: :mothra
70
+ match %r{(?<!(?:net))surf}i, name: :surf
71
+ match %r{spray\-can}i, name: :spray_can
72
+ match %r{bunjalloo}i, name: :bunjalloo
73
+
74
+ match %r{inet\sbrowser}i, name: :inet_browser,
75
+ platform: :star_blade_os
76
+
77
+ match %r{webpro}i, name: :webpro,
78
+ locale: %r{\[(\w{2}(?:\-\w{2})?)\]}i
79
+
80
+ match %r{sundance}i, name: :sundance,
81
+ version: %r{(?:version/|sundance/)([\d\.]+)}i
82
+
83
+ match %r{ibm\swebexplorer}i, name: :ibm_webexplorer, platform: :os2,
84
+ version: %r{bexplorer\s?/v?([\d\.]+)}i
85
+
86
+ match %r{navscape}i, name: :navscape, engine: :webkit,
87
+ version: %r{navscape/(?:\w+-)?([\d\.]+)}i
88
+
89
+ match %r{firefox|phoenix}i do
90
+ name :firefox
91
+ engine %r{(gecko|servo)}i
92
+ engine_version %r{(?:rv:\s?|servo/)([\d\.]+)}i
93
+ modern { version >= 50 }
94
+ end
95
+
96
+ match %r{chrome(?:ium)?}i do
97
+ name :chrome
98
+ version %r{chrome(?:ium)?/([\d\.]+)}i
99
+ engine %r{(webkit|blink)}i
100
+ modern { version >= 50 }
101
+ end
102
+
103
+ match %r{safari}i do
104
+ name :safari
105
+ engine :webkit
106
+ version %r{(?:safari|version)/([\d\.]+)}i
107
+ modern { version >= 9 }
108
+ end
109
+
110
+ match %r{tizenbrowser}i, name: :tizenbrowser, engine: :webkit
111
+ match %r{epiphany}i, name: :epiphany, engine: :webkit
112
+ match %r{uzbl}i, name: :uzbl, engine: :webkit
113
+ match %r{roccat}i, name: :roccat, engine: :webkit
114
+ match %r{dolfin}i, name: :dolfin, engine: :webkit
115
+ match %r{dooble}i, name: :dooble, engine: :webkit
116
+ match %r{adobeair}i, name: :adobeair, engine: :webkit
117
+ match %r{abrowse}i, name: :abrowse, engine: :webkit
118
+ match %r{vimprobable}i, name: :vimprobable, engine: :webkit
119
+ match %r{osb\-browser}i, name: :osb_browser, engine: :webkit
120
+ match %r{edbrowse}i, name: :edbrowse, text: true
121
+ match %r{amaya}i, name: :amaya, text: true
122
+ match %r{lynx}i, name: :lynx, text: true
123
+ match %r{linemode}i, name: :linemode, text: true
124
+ match %r{elinks}i, name: :elinks, text: true
125
+ match %r{netpositive}i, name: :netpositive
126
+ match %r{mucommander}i, name: :mucommander
127
+ match %r{onebrowser}i, name: :onebrowser
128
+ match %r{flashfire}i, name: :flashfire
129
+ match %r{konqueror}i, name: :konqueror
130
+ match %r{cyberdog}i, name: :cyberdog
131
+ match %r{offbyone}i, name: :offbyone
132
+ match %r{hotjava}i, name: :hotjava
133
+ match %r{netsurf}i, name: :netsurf
134
+ match %r{contiki}i, name: :contiki
135
+ match %r{mosaic|ibrowse[^r]}i, name: :mosaic
136
+ match %r{netbox}i, name: :netbox
137
+ match %r{dillo}i, name: :dillo
138
+ match %r{ice\sbrowser}i, name: :ice_browser
139
+
140
+ match %r{emacs}i, name: :emacs, text: true,
141
+ version: %r{emacs(?:\-\w+)?/([\d\.]+)}i
142
+
143
+ match %r{UP\.Browser}, name: :openwave_browser,
144
+ version: %r{UP\.Browser/([\d\.]+)}i
145
+
146
+ match %r{alienblue}i, name: :alienblue,
147
+ version: %r{alienblue(?:hd)?/([\d\.]+)}i
148
+
149
+ match %r{ovibrowser}i, name: :ovibrowser, engine: :gecko,
150
+ engine_version: %r{rv:\s?([\d\.]+)}i
151
+
152
+ match %r{links}i, name: :links,
153
+ version: %r{links\s\(([\d\.]+)}i
154
+
155
+ match %r{oregano}i, name: :oregano,
156
+ locale: %r{\[(\w{2}(?:\-\w{2})?)\]}i
157
+
158
+ match %r{browsex}i, name: :browsex, version: %r{wsex\s\(([\d\.]+)}i,
159
+ locale: %r{\[(\w{2}(?:\-\w{2})?)\]}i
160
+
161
+ match %r{doris}i, name: :doris,
162
+ locale: %r{\[(\w{2}(?:\-\w{2})?)\]}i
163
+
164
+ match %r{retawq}i, name: :retawq, text: true,
165
+ locale: %r{\[(\w{2}(?:\-\w{2})?)\]}i
166
+
167
+ # inherit properties a standard set of properties by the name of a
168
+ # previously defined matcher, overwritten by properties added within matchers
169
+ # inherit properties from matcher where name == :chrome, (except :version)
170
+ like :chrome, except: [:version] do
171
+ match %r{steam\sgame}i, name: :steam, version: %r{eoverlay/([\d\.]+)}i
172
+ match %r{whitehat\saviator}i, name: :whitehat_aviator
173
+ match %r{c_coc_browser}i, name: :coc_coc_browser
174
+ match %r{comodo_dragon}i, name: :comodo_dragon
175
+ match %r{chromeplus}i, name: :chromeplus
176
+ match %r{bluechrome}i, name: :bluechrome
177
+ match %r{taobrowser}i, name: :taobrowser
178
+ match %r{blackhawk}i, name: :blackhawk
179
+ match %r{fabrowser}i, name: :fabrowser
180
+ match %r{mxbrowser}i, name: :mxbrowser
181
+ match %r{awesomium}i, name: :awesomium
182
+ match %r{qqbrowser}i, name: :qqbrowser
183
+ match %r{yabrowser}i, name: :yabrowser
184
+ match %r{chromeum}i, name: :chromeum
185
+ match %r{polarity}i, name: :polarity
186
+ match %r{rockmelt}i, name: :rockmelt
187
+ match %r{coolnovo}i, name: :coolnovo
188
+ match %r{slimboat}i, name: :slimboat
189
+ match %r{safepay}i, name: :safepay
190
+ match %r{vivaldi}i, name: :vivaldi
191
+ match %r{colibri}i, name: :colibri
192
+ match %r{iridium}i, name: :iridium
193
+ match %r{yowser}i, name: :yowser
194
+ match %r{origin}i, name: :origin
195
+ match %r{puffin}i, name: :puffin
196
+ match %r{amigo}i, name: :amigo
197
+ match %r{fluid}i, name: :fluid
198
+ match %r{kinza}i, name: :kinza
199
+ match %r{swing}i, name: :swing
200
+ match %r{brave}i, name: :brave
201
+ match %r{perk}i, name: :perk
202
+ match %r{hana}i, name: :hana
203
+ match %r{(?<!env)iron}i, name: :iron
204
+
205
+ match %r{nichrome}i, name: :nichrome, engine: :webkit,
206
+ version: %r{chrome[\s/]\w+[\s/]([\d\.]+)}i
207
+
208
+ match %r{mxnitro}i, name: :maxthon_nitro,
209
+ version: %r{mxnitro/([\d\.]+)}i
210
+
211
+ match %r{qtweb}i, name: :qtweb_browser,
212
+ version: %r{net\sbrowser/([\d\.]+)}i
213
+ end
214
+
215
+ # inherit properties from matcher where name == :safari, (except :version)
216
+ like :safari, except: [:version] do
217
+ match %r{obigo}i, name: :obigo, version: %r{obigo/w?([\d\.]+)}i
218
+ match %r{playbook}i, name: :playbook_browser
219
+ match %r{samsungbrowser}i, name: :samsungbrowser
220
+ match %r{nokiabrowser}i, name: :nokiabrowser
221
+ match %r{mqqbrowser}i, name: :mqqbrowser
222
+ match %r{webbrowser}i, name: :webbrowser
223
+ match %r{stainless}i, name: :stainless
224
+ match %r{cheshire}i, name: :cheshire
225
+ match %r{teashark}i, name: :teashark
226
+ match %r{omniweb}i, name: :omniweb
227
+ match %r{skyfire}i, name: :skyfire
228
+ match %r{mercury}i, name: :mercury
229
+ match %r{rekonq}i, name: :rekonq
230
+ match %r{coast}i, name: :coast
231
+ match %r{arora}i, name: :arora
232
+ match %r{maple}i, name: :maple
233
+ match %r{raptr}i, name: :raptr
234
+ match %r{icab}i, name: :icab
235
+ match %r{bolt}i, name: :bolt
236
+ match %r{silk}i, name: :silk
237
+ match %r{coda}i, name: :coda
238
+ match %r{qt(?!web)}i, name: :qt
239
+
240
+ match %r{xiaomi/miuibrowser}i, name: :xiaomi_miui,
241
+ version: %r{miuibrowser/([\d\.]+)}i
242
+
243
+ match %r{nook}i, name: :nook,
244
+ version: %r{build/\w+\s([\d\.]+)}i
245
+
246
+ match %r{kindle}i, name: :kindle
247
+
248
+ match %r{leechcraft}i, name: :leechcraft,
249
+ version: %r{craft/(?:\w+\s)?([\d\.]+)}i
250
+
251
+ match %r{webos|wosbrowser}i, name: :webosbrowser,
252
+ version: %r{(?:version|osbrowser)/([\d\.]+)}i
253
+
254
+ match %r{blackberry.*?(?=safari)}i, name: :blackberry_browser,
255
+ version: %r{version/([\d\.]+)}i
256
+ end
257
+
258
+ # inherit properties from matcher where name == :opera
259
+ like :opera do
260
+ match %r{opera\smobi}i, name: :opera_mobile,
261
+ version: %r{era\smobi/([\d\.]+)}i
262
+ end
263
+
264
+ match %r{maemo;}i, name: :maemo, like: :opera_mobile
265
+
266
+ # inherit properties from matcher where name == :firefox, (except :version)
267
+ like :firefox, except: [:version] do
268
+ # Minefield is firefox nightly, we can now do client.nightly?
269
+ # to find out wether this browser is bleeding edge
270
+ # this method will be caught by method missing if it isn't defined,
271
+ # therefore - this method can be used on every Browserino::Client
272
+ # instance
273
+ match %r{camino}i, name: :camino, locale: %r{(\w{2}(?:\-\w{2})?),}i
274
+ match %r{fireweb\snaviga}i, name: :fireweb_navigator, engine: :gecko
275
+ match %r{minefield}i, name: :minefield, nightly: true
276
+ match %r{waterfox}i, name: :waterfox, architecture: :x64
277
+ match %r{monyq}i, name: :monyq, engine: :gecko
278
+ match %r{sailfishbrowser}i, name: :sailfishbrowser
279
+ match %r{maemo\sbrowser}i, name: :maemo_browser
280
+ match %r{granparadiso}i, name: :granparadiso
281
+ match %r{swiftweasel}i, name: :swiftweasel
282
+ match %r{tenfourfox}i, name: :tenfourfox
283
+ match %r{kazehakase}i, name: :kazehakase
284
+ match %r{enigmafox}i, name: :enigmafox
285
+ match %r{iceweasel}i, name: :iceweasel
286
+ match %r{seamonkey}i, name: :seamonkey
287
+ match %r{multizilla}i, name: :multizilla
288
+ match %r{lightning}i, name: :lightning
289
+ match %r{superswan}i, name: :superswan
290
+ match %r{lunascape}i, name: :lunascape
291
+ match %r{shiretoko}i, name: :shiretoko
292
+ match %r{classilla}i, name: :classilla
293
+ match %r{cometbird}i, name: :cometbird
294
+ match %r{blackbird}i, name: :blackbird
295
+ match %r{icedragon}i, name: :icedragon
296
+ match %r{cunaguaro}i, name: :cunaguaro
297
+ match %r{swiftfox}i, name: :swiftfox
298
+ match %r{palemoon}i, name: :palemoon
299
+ match %r{cyberfox}i, name: :cyberfox
300
+ match %r{namoroka}i, name: :namoroka
301
+ match %r{songbird}i, name: :songbird
302
+ match %r{firebird}i, name: :firebird
303
+ match %r{vonkeror}i, name: :vonkeror
304
+ match %r{conkeror}i, name: :conkeror
305
+ match %r{netscape}i, name: :netscape
306
+ match %r{k-meleon}i, name: :k_meleon
307
+ match %r{k-ninja}i, name: :k_ninja
308
+ match %r{bonecho}i, name: :bonecho
309
+ match %r{sundial}i, name: :sundial
310
+ match %r{chimera}i, name: :chimera
311
+ match %r{lolifox}i, name: :lolifox
312
+ match %r{lorentz}i, name: :lorentz
313
+ match %r{myibrow}i, name: :myibrow
314
+ match %r{sylera}i, name: :sylera
315
+ match %r{fennec}i, name: :fennec
316
+ match %r{iceape}i, name: :iceape
317
+ match %r{madfox}i, name: :madfox
318
+ match %r{kapiko}i, name: :kapiko
319
+ match %r{kmlite}i, name: :kmlite
320
+ match %r{beonex}i, name: :beonex
321
+ match %r{minimo}i, name: :minimo
322
+ match %r{icecat}i, name: :icecat
323
+ match %r{galeon}i, name: :galeon
324
+ match %r{vision}i, name: :vision
325
+ match %r{strata}i, name: :strata
326
+ match %r{prism}i, name: :prism
327
+ match %r{light/}i, name: :light
328
+ match %r{wyzo}i, name: :wyzo
329
+ match %r{kylo}i, name: :kylo
330
+ match %r{epic}i, name: :epic
331
+ match %r{pogo}i, name: :pogo
332
+ match %r{orca}i, name: :orca
333
+ end
334
+
335
+ # never thought a browser would want to be like IE...
336
+ like :ie do
337
+ # version does not have to be supplied because we simply want to use
338
+ # the version supplied by the MSIE token instead (there is no version on
339
+ # the avant browser or slimbrowser etc... UA itself)
340
+ match %r{avant\sbrowser}i, name: :avant_browser
341
+ match %r{greenbrowser}i, name: :greenbrowser
342
+ match %r{slimbrowser}i, name: :slimbrowser
343
+ match %r{smart\sbro}i, name: :smart_bro
344
+ match %r{theworld}i, name: :theworld
345
+ match %r{browzar}i, name: :browzar
346
+
347
+ # below are special cases where we need to manually
348
+ # supply the version pattern
349
+ match %r{flexnetdesktopclient}i, name: :netflix_desktop,
350
+ version: %r{pclient_([\d\.\_]+)}i
351
+
352
+ match %r{MetaSr}, name: :sogou_browser,
353
+ version: %r{metasr\s([\d\.\_]+)}i
354
+
355
+ # we can exclude the default version which will then be replaced by
356
+ # the smart_matcher for :version which uses the :name token automatically
357
+ # upon creating it's pattern
358
+ preset except: [:version] do
359
+ match %r{deepnet\sexplorer}i, name: :deepnet_explorer
360
+ match %r{tencenttraveler}i, name: :tencenttraveler
361
+ match %r{enigma\sbrowser}i, name: :enigma_browser
362
+ match %r{crazy\sbrowser}i, name: :crazy_browser
363
+ match %r{simulbrowse}i, name: :simulbrowse
364
+ match %r{solid\score}i, name: :solid_core
365
+ match %r{gomezagent}i, name: :gomezagent
366
+ match %r{sitekiosk}i, name: :sitekiosk
367
+ match %r{netcaptor}i, name: :netcaptor
368
+ match %r{sleipnir}i, name: :sleipnir
369
+ match %r{irider}i, name: :irider
370
+ match %r{kkman}i, name: :kkman
371
+ match %r{lobo}i, name: :lobo
372
+ match %r{foxy}i, name: :foxy
373
+ match %r{\bIon\b}, name: :ion
374
+ match %r{aol}i, name: :aol
375
+ end
376
+ end
377
+ end