selenium_tor 1.5.4 → 1.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45483bd8f793aa018296ee9ae0e06c496d0dd4dde2155e5421f05f7da9d497c1
4
- data.tar.gz: 8ca6956063b24ee1b30e3c8a4a7f2332fcc40fb12be62a9fd94058470e5ff657
3
+ metadata.gz: e6f9d6ff1e71d45656e35148ac5d58b490e85c23fbe47cb977de1b0b3f0a7de2
4
+ data.tar.gz: 24a4431f5a6b7957f14ca5d222b0f630f29e9955956622e20e73cdff5c51de6c
5
5
  SHA512:
6
- metadata.gz: fa1ad5934e06fb5a69c81e267e55d919cc29cce8fbc0480297b0439d65db53c79c63e27dfc718455b90d6368f5af359bd153003f570befc88a6c96bb3bc18dc4
7
- data.tar.gz: a565f2f16b886d9a70c3646775e6cb093fc586b9702e01f7707bbae481395f8207322525355a5224fe2251d119681e18285ecebec48d0b78d07b27bf775f0e4b
6
+ metadata.gz: 3f4a53aa33461f0159c0ff8703786646df23b8f503534710d4cf83c688ee247334262e88661f9d87a9a7ce008377c62032e209b737c7abd61165a0b309d8a262
7
+ data.tar.gz: 758cbe58b60de4556ff5c95fc82761f919ea1670b131c8afad6f6e6be673092ceb2fa71e5fde1240d5e70c03786eb4d04c75197073af9425381c1d6d66777522
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ Style/HashSyntax:
13
13
 
14
14
  Naming/MethodName:
15
15
  Exclude:
16
- - !ruby/regexp /test_.*\.rb$/ # for test_FOO constant tests
16
+ - !ruby/regexp /test_.*\.rb$/ # for test_FOO constant tests
17
17
 
18
18
  Security/Eval:
19
19
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## [1.6.0] - 2024-12-04
4
+
5
+ * drop support for TB < 14.0 stable
6
+ * Remove vglrun test from CI
7
+
3
8
  ## [1.5.4] - 2024-10-10
4
9
 
5
10
  * Add Bsdiff gem dependency
data/README.md CHANGED
@@ -41,7 +41,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
41
41
 
42
42
  ## Dependencies and configuration
43
43
 
44
- [Tor Browser](https://www.torproject.org/download).
44
+ [Tor Browser](https://www.torproject.org/download). Versions >= 14.0 stable are supported.
45
45
 
46
46
  As with Firefox browser, `geckodriver` needs to be installed and in your PATH.
47
47
 
data/fonts/000_README.txt CHANGED
@@ -2,6 +2,5 @@ DO NOT MODIFY THE CONTENTS OF THIS DIRECTORY
2
2
 
3
3
  Any adjustment to bundled fonts will result in an altered fingerprint. Font
4
4
  fingerprinting is more than just detecting what fonts you have, it also includes
5
- font fallbacks and characters (unicode code points) and any change in those can
5
+ font fallbacks and characters (Unicode code points) and any change in those can
6
6
  be measured.
7
-
data/lib/tor/driver.rb CHANGED
@@ -29,8 +29,7 @@ module Selenium
29
29
  @data_dir = Dir.mktmpdir
30
30
  @options = options || Options.new # fix for issue #11, 'tis a puzzlement
31
31
  add_torrc_path_to_options
32
- # @instance = DriverDelegate.new(options: @options, **)
33
- @instance = DriverDelegate.new(options: @options, **, service: service)
32
+ @instance = DriverDelegate.new(options: @options, **)
34
33
  install_extensions @instance
35
34
  create_tor_process_and_start_tor @options.tor_opts
36
35
  super(@instance)
@@ -88,12 +87,6 @@ module Selenium
88
87
  def domain
89
88
  URI(current_url).host&.match(/[^\.]+\.\w+$/)
90
89
  end
91
-
92
- def service
93
- service = Service.tor
94
- service.args << '--enable-crash-reporter' # BUG: 18, https://github.com/mozilla/geckodriver/issues/2202
95
- service
96
- end
97
90
  end
98
91
  end
99
92
  end
@@ -1,4 +1,31 @@
1
1
  ---
2
+ 14.5a1:
3
+ unpatched_libxul: 4586056dfd6584effa61f974e802b5b2103965326716423c2f76043e68571149
4
+ patched_libxul: b4463dffe43a112e509764c5e32b100bc2749112dc852244ed8817b72e631642
5
+ patch_checksum: a0397d3e9a86339c497bcedf3b8c4bed767284e9299e791e54266d42c2872b7d
6
+ 14.0.3:
7
+ unpatched_libxul: 2ddc3df2e8feb52c3bcd638249aac7d584d9c65888d67e18ad5fecceb4d5010a
8
+ patched_libxul: 9864cdfd750e504f06bd9eeca427f0a20d83d0bb5cd8e8232ae4a3ee4b2812b1
9
+ patch_checksum: 5deece766f5922c77ca4e60f194c0bdfa0374f6c80e190cdf60dd10f49d3b5e8
10
+ 14.0.2:
11
+ unpatched_libxul: 590a02a751951452b0f3eded2234b6c1ffc49ce794301192450a236db5ad11af
12
+ patched_libxul: 6a49949e01ea35f61ba0e08c05d66ec6b9591d7b148314b99a9d2e7b8334c3f4
13
+ patch_checksum: 8f3ab90326a7b995eebfd83018dc83b257f5699a72d3cd9754706df973a66852
14
+ 14.0.1:
15
+ unpatched_libxul: 02751a5f1c3390c8d8b1b062147713d9a5412797139d3a86217df3380b44a390
16
+ patched_libxul: 6df072f5e9f86bcd244b5dab416074754214b85f9735bc05f8d322bf136652ef
17
+ patch_checksum: 844e29b6131fa6d7282a0052aa81000c5decdd410da509f56e0cf9b8c24d6ca9
18
+ !!str 14.0:
19
+ unpatched_libxul: 0a9c57aa19a953af56b49e944bfb950b7ba47d12fa927bb76c5ff04b8cdcf063
20
+ patched_libxul: 3b163b5c035376883fd49eac7fa5d90bfa536d26038ee4e36508226111936cce
21
+ patch_checksum: 2821841ff51fb511731810622fecb9c132e0774f5883dc500f67869c59a81509
22
+ #######################
23
+ # NO LONGER SUPPORTED #
24
+ #######################
25
+ 14.0a9:
26
+ unpatched_libxul: af9228a9b026fb4dad1d611070421346d8f4f714f00d909bbc2bda04e4175ff4
27
+ patched_libxul: 7e1e5e733c8c258a92170b45d0bbcafc14beea628290cacbc013affda3082193
28
+ patch_checksum: cb3fef972d41f81a212b95b1b47b8b0fcb03e58271cde4bbaf6d4fe3f7ffc318
2
29
  14.0a8:
3
30
  unpatched_libxul: 3ce2cef75c68f52df50cc435c9307bae8596ecbbf53d067e0731506096fb36cd
4
31
  patched_libxul: 789bb47f02d7f5c87cae05409ea31a2cf1d222f6716c2dd81fc333f221bf8c16
@@ -14,9 +14,10 @@ module Selenium
14
14
  module LibxulPatchable
15
15
  class LibxulPatchableError < StandardError; end
16
16
 
17
- LIBXUL_CHECKSUMS = YAML.load_file(File.join(__dir__, 'libxul_checksums.yml'))[Tor::TBB_VERSION]
18
17
  PATCH_REPO = 'https://gitlab.com/matzfan/keymaster/-/raw/master/patches/tor-browser'
19
18
  ISSUES_URL = 'https://gitlab.com/matzfan/keymaster/-/issues'
19
+ NO_PATCH_MSG = "No patch for #{Tor::TBB_VERSION}, please raise an issue at #{ISSUES_URL}".freeze
20
+ UNDEF_REGEXP = /undefined method (`|')\[\]' for nil/
20
21
 
21
22
  def libxul_patched?
22
23
  libxul_checksum = checksum_for Tor::TBB_LIBXUL
@@ -35,7 +36,7 @@ module Selenium
35
36
  execute_patch patchfile
36
37
  FileUtils.cp libxul_patched, Tor::TBB_LIBXUL
37
38
  rescue OpenURI::HTTPError
38
- raise LibxulPatchableError, "No patch for #{Tor::TBB_VERSION}, please raise an issue at #{ISSUES_URL}"
39
+ raise LibxulPatchableError, NO_PATCH_MSG
39
40
  end
40
41
 
41
42
  def unpatch_libxul
@@ -63,16 +64,32 @@ module Selenium
63
64
  Bsdiff.patch libxul_original, libxul_patched, patchfile
64
65
  end
65
66
 
67
+ def libxul_checksums
68
+ @libxul_checksums ||= YAML.load_file(File.join(__dir__, 'libxul_checksums.yml'))[Tor::TBB_VERSION]
69
+ end
70
+
66
71
  def unpatched_libxul_checksum_for_version
67
- LIBXUL_CHECKSUMS['unpatched_libxul']
72
+ libxul_checksums['unpatched_libxul']
73
+ rescue NoMethodError => e
74
+ raise LibxulPatchableError, NO_PATCH_MSG if e.message.match UNDEF_REGEXP
75
+
76
+ raise e
68
77
  end
69
78
 
70
79
  def patched_libxul_checksum_for_version
71
- LIBXUL_CHECKSUMS['patched_libxul']
80
+ libxul_checksums['patched_libxul']
81
+ rescue NoMethodError => e
82
+ raise LibxulPatchableError, NO_PATCH_MSG if e.message.match UNDEF_REGEXP
83
+
84
+ raise e
72
85
  end
73
86
 
74
87
  def patch_checksum_for_version
75
- LIBXUL_CHECKSUMS['patch_checksum']
88
+ libxul_checksums['patch_checksum']
89
+ rescue NoMethodError => e
90
+ raise LibxulPatchableError, NO_PATCH_MSG if e.message.match UNDEF_REGEXP
91
+
92
+ raise e
76
93
  end
77
94
 
78
95
  def checksum_for(file)
data/lib/tor/options.rb CHANGED
@@ -42,17 +42,21 @@ module Selenium
42
42
  def do_start_tor_browser_script_stuff
43
43
  ENV['SESSION_MANAGER'] = nil
44
44
  ENV['XAUTHORITY'] = File.join(Dir.home, '.Xauthority') unless ENV.fetch('XAUTHORITY', nil)
45
- ENV['FONTCONFIG_PATH'] = File.join TBB_BROWSER_DIR, 'fontconfig'
46
- ENV['FONTCONFIG_FILE'] = 'fonts.conf'
47
45
  FileUtils.rm_rf File.join(Tor::TBB_BROWSER_DIR, *%w[TorBrowser Data fontconfig])
48
46
  ENV['GSETTINGS_BACKEND'] = 'memory'
47
+ setup_font_vars if Tor::TBB_VERSION.to_f < 14.5 # DEPRECATE when 14.5 stable drops
49
48
  end
50
49
 
51
50
  def copy_fonts
52
- return unless Dir[File.join('fonts', '*')].size == 1 # README checked into git
53
-
51
+ FileUtils.rm_rf File.join(File.expand_path('fonts'), '.')
54
52
  FileUtils.cp(Dir[File.join(Tor::TBB_BROWSER_DIR, 'fonts', '*')], File.expand_path('fonts'))
55
53
  end
54
+
55
+ # DEPRECATE when 14.5 stable drops
56
+ def setup_font_vars
57
+ ENV['FONTCONFIG_PATH'] = File.join TBB_BROWSER_DIR, 'fontconfig'
58
+ ENV['FONTCONFIG_FILE'] = 'fonts.conf'
59
+ end
56
60
  end
57
61
  end
58
62
  end
data/lib/tor/version.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Selenium
4
4
  module WebDriver
5
5
  module Tor
6
- VERSION = '1.5.4'
6
+ VERSION = '1.6.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium_tor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MatzFan
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2024-10-09 00:00:00.000000000 Z
10
+ date: 2024-12-04 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bsdiff
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.2
18
+ version: 0.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 0.0.2
25
+ version: 0.1.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: selenium-webdriver
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: '4.24'
32
+ version: '4.27'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '4.24'
39
+ version: '4.27'
40
40
  description: An extension for Selenium::WebDriver that automates Tor Browser
41
41
  executables: []
42
42
  extensions: []