selenium_tor 1.5.4 → 1.7.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.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -5
  3. data/CHANGELOG.md +17 -0
  4. data/README.md +8 -10
  5. data/Rakefile +1 -2
  6. data/fonts/000_README.txt +1 -2
  7. data/fonts/Arimo-Bold.ttf +0 -0
  8. data/fonts/Arimo-BoldItalic.ttf +0 -0
  9. data/fonts/Arimo-Italic.ttf +0 -0
  10. data/fonts/Arimo-Regular.ttf +0 -0
  11. data/fonts/Cousine-Bold.ttf +0 -0
  12. data/fonts/Cousine-BoldItalic.ttf +0 -0
  13. data/fonts/Cousine-Italic.ttf +0 -0
  14. data/fonts/Cousine-Regular.ttf +0 -0
  15. data/fonts/NotoNaskhArabic-Regular.ttf +0 -0
  16. data/fonts/NotoSansAdlam-Regular.ttf +0 -0
  17. data/fonts/NotoSansArmenian-Regular.ttf +0 -0
  18. data/fonts/NotoSansBalinese-Regular.ttf +0 -0
  19. data/fonts/NotoSansBamum-Regular.ttf +0 -0
  20. data/fonts/NotoSansBassaVah-Regular.ttf +0 -0
  21. data/fonts/NotoSansBatak-Regular.ttf +0 -0
  22. data/fonts/NotoSansBengali-Regular.ttf +0 -0
  23. data/fonts/NotoSansBuginese-Regular.ttf +0 -0
  24. data/fonts/NotoSansBuhid-Regular.ttf +0 -0
  25. data/fonts/NotoSansCanadianAboriginal-Regular.ttf +0 -0
  26. data/fonts/NotoSansChakma-Regular.ttf +0 -0
  27. data/fonts/NotoSansCham-Regular.ttf +0 -0
  28. data/fonts/NotoSansCherokee-Regular.ttf +0 -0
  29. data/fonts/NotoSansCoptic-Regular.ttf +0 -0
  30. data/fonts/NotoSansDeseret-Regular.ttf +0 -0
  31. data/fonts/NotoSansDevanagari-Regular.ttf +0 -0
  32. data/fonts/NotoSansElbasan-Regular.ttf +0 -0
  33. data/fonts/NotoSansEthiopic-Regular.ttf +0 -0
  34. data/fonts/NotoSansGeorgian-Regular.ttf +0 -0
  35. data/fonts/NotoSansGrantha-Regular.ttf +0 -0
  36. data/fonts/NotoSansGujarati-Regular.ttf +0 -0
  37. data/fonts/NotoSansGunjalaGondi-Regular.ttf +0 -0
  38. data/fonts/NotoSansGurmukhi-Regular.ttf +0 -0
  39. data/fonts/NotoSansHanifiRohingya-Regular.ttf +0 -0
  40. data/fonts/NotoSansHanunoo-Regular.ttf +0 -0
  41. data/fonts/NotoSansHebrew-Regular.ttf +0 -0
  42. data/fonts/NotoSansJP-Regular.otf +0 -0
  43. data/fonts/NotoSansJavanese-Regular.ttf +0 -0
  44. data/fonts/NotoSansKR-Regular.otf +0 -0
  45. data/fonts/NotoSansKannada-Regular.ttf +0 -0
  46. data/fonts/NotoSansKayahLi-Regular.ttf +0 -0
  47. data/fonts/NotoSansKhmer-Regular.ttf +0 -0
  48. data/fonts/NotoSansKhojki-Regular.ttf +0 -0
  49. data/fonts/NotoSansKhudawadi-Regular.ttf +0 -0
  50. data/fonts/NotoSansLao-Regular.ttf +0 -0
  51. data/fonts/NotoSansLepcha-Regular.ttf +0 -0
  52. data/fonts/NotoSansLimbu-Regular.ttf +0 -0
  53. data/fonts/NotoSansLisu-Regular.ttf +0 -0
  54. data/fonts/NotoSansMahajani-Regular.ttf +0 -0
  55. data/fonts/NotoSansMalayalam-Regular.ttf +0 -0
  56. data/fonts/NotoSansMandaic-Regular.ttf +0 -0
  57. data/fonts/NotoSansMasaramGondi-Regular.ttf +0 -0
  58. data/fonts/NotoSansMedefaidrin-Regular.ttf +0 -0
  59. data/fonts/NotoSansMeeteiMayek-Regular.ttf +0 -0
  60. data/fonts/NotoSansMendeKikakui-Regular.ttf +0 -0
  61. data/fonts/NotoSansMiao-Regular.ttf +0 -0
  62. data/fonts/NotoSansModi-Regular.ttf +0 -0
  63. data/fonts/NotoSansMongolian-Regular.ttf +0 -0
  64. data/fonts/NotoSansMro-Regular.ttf +0 -0
  65. data/fonts/NotoSansMultani-Regular.ttf +0 -0
  66. data/fonts/NotoSansNKo-Regular.ttf +0 -0
  67. data/fonts/NotoSansNewTaiLue-Regular.ttf +0 -0
  68. data/fonts/NotoSansNewa-Regular.ttf +0 -0
  69. data/fonts/NotoSansOlChiki-Regular.ttf +0 -0
  70. data/fonts/NotoSansOriya-Regular.ttf +0 -0
  71. data/fonts/NotoSansOsage-Regular.ttf +0 -0
  72. data/fonts/NotoSansOsmanya-Regular.ttf +0 -0
  73. data/fonts/NotoSansPahawhHmong-Regular.ttf +0 -0
  74. data/fonts/NotoSansPauCinHau-Regular.ttf +0 -0
  75. data/fonts/NotoSansRejang-Regular.ttf +0 -0
  76. data/fonts/NotoSansRunic-Regular.ttf +0 -0
  77. data/fonts/NotoSansSC-Regular.otf +0 -0
  78. data/fonts/NotoSansSamaritan-Regular.ttf +0 -0
  79. data/fonts/NotoSansSaurashtra-Regular.ttf +0 -0
  80. data/fonts/NotoSansSharada-Regular.ttf +0 -0
  81. data/fonts/NotoSansShavian-Regular.ttf +0 -0
  82. data/fonts/NotoSansSinhala-Regular.ttf +0 -0
  83. data/fonts/NotoSansSoraSompeng-Regular.ttf +0 -0
  84. data/fonts/NotoSansSoyombo-Regular.ttf +0 -0
  85. data/fonts/NotoSansSundanese-Regular.ttf +0 -0
  86. data/fonts/NotoSansSylotiNagri-Regular.ttf +0 -0
  87. data/fonts/NotoSansSymbols-Regular.ttf +0 -0
  88. data/fonts/NotoSansSymbols2-Regular.ttf +0 -0
  89. data/fonts/NotoSansSyriac-Regular.ttf +0 -0
  90. data/fonts/NotoSansTC-Regular.otf +0 -0
  91. data/fonts/NotoSansTagalog-Regular.ttf +0 -0
  92. data/fonts/NotoSansTagbanwa-Regular.ttf +0 -0
  93. data/fonts/NotoSansTaiLe-Regular.ttf +0 -0
  94. data/fonts/NotoSansTaiTham-Regular.ttf +0 -0
  95. data/fonts/NotoSansTaiViet-Regular.ttf +0 -0
  96. data/fonts/NotoSansTakri-Regular.ttf +0 -0
  97. data/fonts/NotoSansTamil-Regular.ttf +0 -0
  98. data/fonts/NotoSansTelugu-Regular.ttf +0 -0
  99. data/fonts/NotoSansThaana-Regular.ttf +0 -0
  100. data/fonts/NotoSansThai-Regular.ttf +0 -0
  101. data/fonts/NotoSansTifinagh-Regular.ttf +0 -0
  102. data/fonts/NotoSansTifinaghAPT-Regular.ttf +0 -0
  103. data/fonts/NotoSansTifinaghAdrar-Regular.ttf +0 -0
  104. data/fonts/NotoSansTifinaghAgrawImazighen-Regular.ttf +0 -0
  105. data/fonts/NotoSansTifinaghAhaggar-Regular.ttf +0 -0
  106. data/fonts/NotoSansTifinaghAir-Regular.ttf +0 -0
  107. data/fonts/NotoSansTifinaghAzawagh-Regular.ttf +0 -0
  108. data/fonts/NotoSansTifinaghGhat-Regular.ttf +0 -0
  109. data/fonts/NotoSansTifinaghHawad-Regular.ttf +0 -0
  110. data/fonts/NotoSansTifinaghRhissaIxa-Regular.ttf +0 -0
  111. data/fonts/NotoSansTifinaghSIL-Regular.ttf +0 -0
  112. data/fonts/NotoSansTifinaghTawellemmet-Regular.ttf +0 -0
  113. data/fonts/NotoSansTirhuta-Regular.ttf +0 -0
  114. data/fonts/NotoSansVai-Regular.ttf +0 -0
  115. data/fonts/NotoSansWancho-Regular.ttf +0 -0
  116. data/fonts/NotoSansWarangCiti-Regular.ttf +0 -0
  117. data/fonts/NotoSansYi-Regular.ttf +0 -0
  118. data/fonts/NotoSansZanabazarSquare-Regular.ttf +0 -0
  119. data/fonts/NotoSerifArmenian-Regular.ttf +0 -0
  120. data/fonts/NotoSerifBalinese-Regular.ttf +0 -0
  121. data/fonts/NotoSerifBengali-Regular.ttf +0 -0
  122. data/fonts/NotoSerifDevanagari-Regular.ttf +0 -0
  123. data/fonts/NotoSerifDogra-Regular.ttf +0 -0
  124. data/fonts/NotoSerifEthiopic-Regular.ttf +0 -0
  125. data/fonts/NotoSerifGeorgian-Regular.ttf +0 -0
  126. data/fonts/NotoSerifGrantha-Regular.ttf +0 -0
  127. data/fonts/NotoSerifGujarati-Regular.ttf +0 -0
  128. data/fonts/NotoSerifGurmukhi-Regular.ttf +0 -0
  129. data/fonts/NotoSerifHebrew-Regular.ttf +0 -0
  130. data/fonts/NotoSerifKannada-Regular.ttf +0 -0
  131. data/fonts/NotoSerifKhmer-Regular.ttf +0 -0
  132. data/fonts/NotoSerifKhojki-Regular.ttf +0 -0
  133. data/fonts/NotoSerifLao-Regular.ttf +0 -0
  134. data/fonts/NotoSerifMalayalam-Regular.ttf +0 -0
  135. data/fonts/NotoSerifMyanmar-Regular.ttf +0 -0
  136. data/fonts/NotoSerifNPHmong-Regular.ttf +0 -0
  137. data/fonts/NotoSerifSinhala-Regular.ttf +0 -0
  138. data/fonts/NotoSerifTamil-Regular.ttf +0 -0
  139. data/fonts/NotoSerifTelugu-Regular.ttf +0 -0
  140. data/fonts/NotoSerifThai-Regular.ttf +0 -0
  141. data/fonts/NotoSerifTibetan-Regular.ttf +0 -0
  142. data/fonts/NotoSerifYezidi-Regular.ttf +0 -0
  143. data/fonts/Pyidaungsu-2.5.3_Regular.ttf +0 -0
  144. data/fonts/STIXTwoMath-Regular.otf +0 -0
  145. data/fonts/Tinos-Bold.ttf +0 -0
  146. data/fonts/Tinos-BoldItalic.ttf +0 -0
  147. data/fonts/Tinos-Italic.ttf +0 -0
  148. data/fonts/Tinos-Regular.ttf +0 -0
  149. data/fonts/TwemojiMozilla.ttf +0 -0
  150. data/fonts/fonts.conf +183 -0
  151. data/lib/tor/driver.rb +1 -8
  152. data/lib/tor/libxul_checksums.yml +79 -0
  153. data/lib/tor/libxul_patchable.rb +22 -5
  154. data/lib/tor/options.rb +0 -9
  155. data/lib/tor/tor_prefs.rb +1 -1
  156. data/lib/tor/tor_process.rb +39 -10
  157. data/lib/tor/version.rb +1 -1
  158. metadata +151 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45483bd8f793aa018296ee9ae0e06c496d0dd4dde2155e5421f05f7da9d497c1
4
- data.tar.gz: 8ca6956063b24ee1b30e3c8a4a7f2332fcc40fb12be62a9fd94058470e5ff657
3
+ metadata.gz: e0b43f3c595a9b52864114bd23e728e824349b3cd514dbc30cbf3bdaca3e1f09
4
+ data.tar.gz: 45a4d53c8881fa99b6530c11d28131195c57d355f1caba27e4ed51181d52b368
5
5
  SHA512:
6
- metadata.gz: fa1ad5934e06fb5a69c81e267e55d919cc29cce8fbc0480297b0439d65db53c79c63e27dfc718455b90d6368f5af359bd153003f570befc88a6c96bb3bc18dc4
7
- data.tar.gz: a565f2f16b886d9a70c3646775e6cb093fc586b9702e01f7707bbae481395f8207322525355a5224fe2251d119681e18285ecebec48d0b78d07b27bf775f0e4b
6
+ metadata.gz: a8cf7f476a0aaa8d25d79e904c4d485e147f0527bdde799f46e62f0d2b140a83ace68cf5601e5b21c2f47cb5106004cbdde1ed99ce8625444d5e906a0014a3e3
7
+ data.tar.gz: 81c8bef22783b315ec3e4c570f601d8dd442478b30c813c069b491b66665443f6fff05827721e7610b266f28877db38c6c85420dfa13e69e4e7e8e84b187d864
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- require:
2
+ plugins:
3
3
  - rubocop-minitest
4
4
  - rubocop-performance
5
5
  - rubocop-rake
@@ -7,14 +7,12 @@ require:
7
7
  AllCops:
8
8
  TargetRubyVersion: 3.2
9
9
  NewCops: enable
10
+ Exclude:
11
+ - 'vendor/**/*' # GitLab caching..
10
12
 
11
13
  Style/HashSyntax:
12
14
  Enabled: false # yuk Ruby 3.1
13
15
 
14
- Naming/MethodName:
15
- Exclude:
16
- - !ruby/regexp /test_.*\.rb$/ # for test_FOO constant tests
17
-
18
16
  Security/Eval:
19
17
  Exclude:
20
18
  - 'test/test_readme.rb'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## [1.7.0] - 2025-05-21
4
+
5
+ ### New features
6
+
7
+ * Reuse cached data files in TorProcess to speed up connection times
8
+ * drop support for TB < 14.5 stable
9
+ * add VirtualGL test to Rake tests
10
+
11
+ ### Bug fixes
12
+
13
+ * [#20](https://gitlab.com/matzfan/selenium-tor/-/issues/20)
14
+
15
+ ## [1.6.0] - 2024-12-04
16
+
17
+ * drop support for TB < 14.0 stable
18
+ * Remove vglrun test from CI
19
+
3
20
  ## [1.5.4] - 2024-10-10
4
21
 
5
22
  * Add Bsdiff gem dependency
data/README.md CHANGED
@@ -27,7 +27,7 @@ Once you have a driver instance:
27
27
 
28
28
  I can use Firefox with Selenium and set a SOCKS proxy to use the Tor network, so why the need?
29
29
 
30
- The above approach will hide your IP, but there is a good chance your browser's unique or near-unique fingerprint may be logged by site owners. Subsequent visits could identify you. A primary aim of this project is to enable Selenium to leverage Tor Browser's unique anonymity characteristics - in particular its resistance to browser fingerprinting. The aim is to ensure Selenium Tor site visits leave an identical fingerprint to the thousands of regular Tor Browser users.
30
+ The above approach will hide your IP, but there is a good chance your browser's unique or near-unique fingerprint may be logged by site owners. Subsequent visits could identify you. A primary aim of this project is to enable Selenium to leverage Tor Browser's unique anonymity characteristics - in particular its resistance to browser fingerprinting. The primary aim is to ensure Selenium Tor site visits leave an identical fingerprint to the thousands of regular Tor Browser users.
31
31
 
32
32
  ## Installation
33
33
 
@@ -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). Tests are conducted with the latest stable ('release') and alpha versions of Tor Browser. Support for older versions is periodically dropped - see the CHANGELOG.
45
45
 
46
46
  As with Firefox browser, `geckodriver` needs to be installed and in your PATH.
47
47
 
@@ -58,7 +58,7 @@ Tor Selenium is tested on **Linux only** right now.
58
58
 
59
59
  ### Patching libxul.so
60
60
 
61
- A configuration option to patch the libxul.so packaged with Tor Browser is provided. This has the effect of preventing websites from fingerprinting Selenium-driven Tor Browser via a JS call to `navigator.webdriver`:
61
+ A configuration option to patch the `libxul.so` packaged with Tor Browser is provided. This has the effect of preventing websites from fingerprinting Selenium-driven Tor Browser via a JS call to `navigator.webdriver`:
62
62
  ```ruby
63
63
  @driver_class = Selenium::WebDriver::Tor::Driver
64
64
  @driver_class.libxul_patched? # is Tor Browser's libxul.so patched?
@@ -69,7 +69,7 @@ A configuration option to patch the libxul.so packaged with Tor Browser is provi
69
69
  @driver_class.unpatch_libxul # revert the patch and restore the libxul.so packaged with Tor Browser
70
70
  # => 0
71
71
  ```
72
- The patcher uses the [Bsdiff](https://gitlab.com/matzfan/bsdiff) gem, which in turn requires the bzip2 library (`libbz2-dev`).
72
+ The patcher uses the [Bsdiff](https://gitlab.com/matzfan/bsdiff) gem.
73
73
 
74
74
  ## Usage
75
75
  ```ruby
@@ -111,6 +111,8 @@ end
111
111
  @drivers.each(&:quit)
112
112
  # => truthy
113
113
  ```
114
+ Each Driver instance uses a separate data directory for `torrc` and other files. Starting from version 1.7 cached files created upon first connection to the tor network are copied into subsequent data dirs. This substantially reduces the time subsequent Drivers take to connect to the tor network.
115
+
114
116
  ### Tor Browser specific functionality
115
117
 
116
118
  You can get and set the security level (shield icon in TB) as follows. 4 is 'Standard', 2 is 'Safer', 1 is 'Safest'.
@@ -160,13 +162,13 @@ Known issues are recorded [here](https://gitlab.com/matzfan/selenium-tor/-/issue
160
162
 
161
163
  ### Fingerprinting
162
164
 
163
- The gem uses Xvfb to allow Tor Browser to be manipulated headlessly. Xvfb in turn uses `llvmpipe` software acceleration which may lead to issues with WebGL fingerprinting - see [issue #7](https://gitlab.com/matzfan/selenium-tor/-/issues/7). If this is a problem we recommend using [VirtualGL](https://www.virtualgl.org) to force Xvfb to use your hardware driver instead. This is done by prepending your executable code with the command `vglrun`. For an example see the section below on testing. VirtualGL can be installed from a [package repo](https://virtualgl.org/Downloads/YUM).
165
+ The gem uses Xvfb to allow Tor Browser to be manipulated headlessly. Xvfb in turn uses `llvmpipe` software acceleration which may lead to issues with WebGL fingerprinting - see [issue #7](https://gitlab.com/matzfan/selenium-tor/-/issues/7). If this is a problem we recommend using [VirtualGL](https://www.virtualgl.org) to force Xvfb to use your hardware driver instead. This is done by prepending your executable code with the command `vglrun`. For an example take a look at the `test_fingerprintjs_with_virtualgl.rb` test. VirtualGL can be installed from a [package repo](https://virtualgl.org/Downloads/YUM).
164
166
 
165
167
  ## Testing
166
168
 
167
169
  ~~After checking out the repo, run `bin/setup` to install dependencies.~~
168
170
 
169
- Tests dependencies are `[bsdiff](https://www.daemonology.net/bsdiff)`, `VirtualGL` (see Fingerprinting above) and `Xvfb` if you want to run headless tests.
171
+ Tests dependencies are `Xvfb` if you want to run headless tests and `VirtualGL` (see Fingerprinting above). The latter can be skipped by setting ENV var `CI` to `true`.
170
172
 
171
173
  Tests are run in the display set by the `DISPLAY` env var, usually :0 by default. To run headless tests, set it to another value:
172
174
 
@@ -174,10 +176,6 @@ Tests are run in the display set by the `DISPLAY` env var, usually :0 by default
174
176
 
175
177
  If you find driver instantiation failing with port bind failure error messages ( these include "Address already in use. Is Tor already running?") check you have no other tor processes running with conflicting ports. With timeout errors, you may also want to check the Tor network is actually up, it isn't always..
176
178
 
177
- If you wish run the `vglrun` WebGL fingerprint test install VirtualGL (see above, assumes you have the relevent drivers installed) and run the following command:
178
-
179
- $ DISPLAY=:99 vglrun bundle exec ruby test/features/fingerprinting/vglrun_test_fingerprintjs.rb
180
-
181
179
  ## Development
182
180
 
183
181
  You can run `bin/console` for an interactive prompt that will allow you to experiment.
data/Rakefile CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rake/testtask'
5
+ require 'rubocop/rake_task'
5
6
 
6
7
  Rake::TestTask.new(:test) do |t|
7
8
  t.libs << 'test'
@@ -10,8 +11,6 @@ Rake::TestTask.new(:test) do |t|
10
11
  # t.warning = false
11
12
  end
12
13
 
13
- require 'rubocop/rake_task'
14
-
15
14
  RuboCop::RakeTask.new
16
15
 
17
16
  task default: %i[test rubocop]
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
-
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file