browser 6.1.0 → 6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -0
- data/browser.gemspec +1 -0
- data/lib/browser/base.rb +5 -0
- data/lib/browser/browser.rb +21 -17
- data/lib/browser/epiphany.rb +21 -0
- data/lib/browser/safari.rb +1 -0
- data/lib/browser/version.rb +1 -1
- data/test/ua.yml +1 -0
- data/test/unit/epiphany_test.rb +21 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc6ec7dfcb388ec7584be57709ff9c01fbef5cc8ce65cab9810a27d42adafd84
|
4
|
+
data.tar.gz: 34979727435f7b5a8e6fb65c758f144925c167abc192abcdefc939353eee9ed6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4859b7dcca0706511efeaa14a5eccda8c3d8754aa5223fcb1b930d93436c8cdf547f8511ce0b9e519109626c56b0b3b22f2fc527964c537500e463eead5a8709
|
7
|
+
data.tar.gz: 5f37c58194e893bb10a5d6ad95ec0f106e9d6b7f0a1db4754d69844a7d0d560620bf876199be511b75e460a0dad8227434b785e4718d84d09f6d3e78108df398
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/browser.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.metadata["rubygems_mfa_required"] = "true"
|
18
18
|
s.metadata["changelog_uri"] = "https://github.com/fnando/browser/blob/main/CHANGELOG.md"
|
19
|
+
s.metadata["funding_uri"] = "https://github.com/sponsors/fnando"
|
19
20
|
|
20
21
|
s.files = `git ls-files`.split("\n")
|
21
22
|
s.executables = `git ls-files -- exe/*`
|
data/lib/browser/base.rb
CHANGED
@@ -268,6 +268,11 @@ module Browser
|
|
268
268
|
instance_of?(Electron) && detect_version?(full_version, expected_version)
|
269
269
|
end
|
270
270
|
|
271
|
+
# Detect if the browser is Epiphany.
|
272
|
+
def epiphany?(expected_version = nil)
|
273
|
+
instance_of?(Epiphany) && detect_version?(full_version, expected_version)
|
274
|
+
end
|
275
|
+
|
271
276
|
private def validate_size(subject, input)
|
272
277
|
actual_bytesize = input.bytesize
|
273
278
|
size_limit = Browser.public_send(:"#{subject}_size_limit")
|
data/lib/browser/browser.rb
CHANGED
@@ -37,6 +37,7 @@ require_relative "miui_browser"
|
|
37
37
|
require_relative "maxthon"
|
38
38
|
require_relative "sougou_browser"
|
39
39
|
require_relative "google_search_app"
|
40
|
+
require_relative "epiphany"
|
40
41
|
|
41
42
|
require_relative "bot"
|
42
43
|
require_relative "bot/empty_user_agent_matcher"
|
@@ -77,23 +78,26 @@ module Browser
|
|
77
78
|
InternetExplorer,
|
78
79
|
Firefox,
|
79
80
|
Otter,
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
81
|
+
Epiphany,
|
82
|
+
Facebook,
|
83
|
+
Instagram,
|
84
|
+
Snapchat,
|
85
|
+
Weibo,
|
86
|
+
MicroMessenger, # must be placed before QQ
|
87
|
+
QQ,
|
88
|
+
Alipay,
|
89
|
+
Electron,
|
90
|
+
Yandex,
|
91
|
+
Sputnik,
|
92
|
+
DuckDuckGo,
|
93
|
+
SamsungBrowser,
|
94
|
+
HuaweiBrowser,
|
95
|
+
MiuiBrowser,
|
96
|
+
Maxthon,
|
97
|
+
SougouBrowser,
|
98
|
+
GoogleSearchApp,
|
99
|
+
|
100
|
+
# Must be last
|
97
101
|
Chrome,
|
98
102
|
Safari,
|
99
103
|
Unknown
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Browser
|
4
|
+
class Epiphany < Base
|
5
|
+
def id
|
6
|
+
:epiphany
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
"Epiphany"
|
11
|
+
end
|
12
|
+
|
13
|
+
def full_version
|
14
|
+
ua[%r{Epiphany/([\d.]+)}, 1] || "0.0"
|
15
|
+
end
|
16
|
+
|
17
|
+
def match?
|
18
|
+
ua.include?("Epiphany")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/browser/safari.rb
CHANGED
data/lib/browser/version.rb
CHANGED
data/test/ua.yml
CHANGED
@@ -36,6 +36,7 @@ CUSTOM_APP: "Our App 0.0.1 (Linux; Android 4.0.3; HTC Ruby Build/IML74K; en_CA)"
|
|
36
36
|
DUCKDUCKGO_BROWSER_ANDROID: Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36 DuckDuckGo/5"
|
37
37
|
DUCKDUCKGO_BROWSER_IOS: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 DuckDuckGo/7"
|
38
38
|
ELECTRON: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Electron/1.4.12 Safari/537.36"
|
39
|
+
EPIPHANY: "Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Safari/605.1.15 Ubuntu/16.04 (3.18.11-0ubuntu1) Epiphany/3.18.11"
|
39
40
|
FACEBOOK: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 [FBAN/FBIOS;FBAV/135.0.0.45.90;FBBV/66877072;FBDV/iPhone9,3;FBMD/iPhone;FBSN/iOS;FBSV/10.3.3;FBSS/2;FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5;FBRV/0]
|
40
41
|
FACEBOOK_ANDROID: "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6003 Build/PKQ1.180716.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/73.0.3683.90 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/214.0.0.43.83;]"
|
41
42
|
FACEBOOK_IOS: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57 [FBAN/FBIOS;FBDV/iPhone11,2;FBMD/iPhone;FBSN/iOS;FBSV/12.1.4;FBSS/3;FBCR/KPN NL;FBID/phone;FBLC/en_GB;FBOP/5]"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class EpiphanyBrowserTest < Minitest::Test
|
6
|
+
test "detects epiphany browser" do
|
7
|
+
browser = Browser.new(Browser["EPIPHANY"])
|
8
|
+
|
9
|
+
assert browser.epiphany?
|
10
|
+
refute browser.safari?
|
11
|
+
assert_equal "Epiphany", browser.name
|
12
|
+
assert_equal :epiphany, browser.id
|
13
|
+
assert_equal "3.18.11", browser.full_version
|
14
|
+
assert_equal "3", browser.version
|
15
|
+
end
|
16
|
+
|
17
|
+
test "detects version by range" do
|
18
|
+
browser = Browser.new(Browser["EPIPHANY"])
|
19
|
+
assert browser.epiphany?(%w[=3.18.11])
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- lib/browser/duck_duck_go.rb
|
215
215
|
- lib/browser/edge.rb
|
216
216
|
- lib/browser/electron.rb
|
217
|
+
- lib/browser/epiphany.rb
|
217
218
|
- lib/browser/facebook.rb
|
218
219
|
- lib/browser/firefox.rb
|
219
220
|
- lib/browser/google_search_app.rb
|
@@ -296,6 +297,7 @@ files:
|
|
296
297
|
- test/unit/duck_duck_go_test.rb
|
297
298
|
- test/unit/edge_test.rb
|
298
299
|
- test/unit/electron_test.rb
|
300
|
+
- test/unit/epiphany_test.rb
|
299
301
|
- test/unit/facebook_test.rb
|
300
302
|
- test/unit/firefox_test.rb
|
301
303
|
- test/unit/generic_test.rb
|
@@ -333,6 +335,7 @@ licenses:
|
|
333
335
|
metadata:
|
334
336
|
rubygems_mfa_required: 'true'
|
335
337
|
changelog_uri: https://github.com/fnando/browser/blob/main/CHANGELOG.md
|
338
|
+
funding_uri: https://github.com/sponsors/fnando
|
336
339
|
post_install_message:
|
337
340
|
rdoc_options: []
|
338
341
|
require_paths:
|
@@ -348,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
348
351
|
- !ruby/object:Gem::Version
|
349
352
|
version: '0'
|
350
353
|
requirements: []
|
351
|
-
rubygems_version: 3.5.
|
354
|
+
rubygems_version: 3.5.22
|
352
355
|
signing_key:
|
353
356
|
specification_version: 4
|
354
357
|
summary: Do some browser detection with Ruby.
|