selenium_tor 1.6.0 → 2.0.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 (161) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -5
  3. data/CHANGELOG.md +26 -0
  4. data/README.md +34 -41
  5. data/Rakefile +1 -2
  6. data/fonts/Arimo-Bold.ttf +0 -0
  7. data/fonts/Arimo-BoldItalic.ttf +0 -0
  8. data/fonts/Arimo-Italic.ttf +0 -0
  9. data/fonts/Arimo-Regular.ttf +0 -0
  10. data/fonts/Cousine-Bold.ttf +0 -0
  11. data/fonts/Cousine-BoldItalic.ttf +0 -0
  12. data/fonts/Cousine-Italic.ttf +0 -0
  13. data/fonts/Cousine-Regular.ttf +0 -0
  14. data/fonts/NotoNaskhArabic-Regular.ttf +0 -0
  15. data/fonts/NotoSansAdlam-Regular.ttf +0 -0
  16. data/fonts/NotoSansArmenian-Regular.ttf +0 -0
  17. data/fonts/NotoSansBalinese-Regular.ttf +0 -0
  18. data/fonts/NotoSansBamum-Regular.ttf +0 -0
  19. data/fonts/NotoSansBassaVah-Regular.ttf +0 -0
  20. data/fonts/NotoSansBatak-Regular.ttf +0 -0
  21. data/fonts/NotoSansBengali-Regular.ttf +0 -0
  22. data/fonts/NotoSansBuginese-Regular.ttf +0 -0
  23. data/fonts/NotoSansBuhid-Regular.ttf +0 -0
  24. data/fonts/NotoSansCanadianAboriginal-Regular.ttf +0 -0
  25. data/fonts/NotoSansChakma-Regular.ttf +0 -0
  26. data/fonts/NotoSansCham-Regular.ttf +0 -0
  27. data/fonts/NotoSansCherokee-Regular.ttf +0 -0
  28. data/fonts/NotoSansCoptic-Regular.ttf +0 -0
  29. data/fonts/NotoSansDeseret-Regular.ttf +0 -0
  30. data/fonts/NotoSansDevanagari-Regular.ttf +0 -0
  31. data/fonts/NotoSansElbasan-Regular.ttf +0 -0
  32. data/fonts/NotoSansEthiopic-Regular.ttf +0 -0
  33. data/fonts/NotoSansGeorgian-Regular.ttf +0 -0
  34. data/fonts/NotoSansGrantha-Regular.ttf +0 -0
  35. data/fonts/NotoSansGujarati-Regular.ttf +0 -0
  36. data/fonts/NotoSansGunjalaGondi-Regular.ttf +0 -0
  37. data/fonts/NotoSansGurmukhi-Regular.ttf +0 -0
  38. data/fonts/NotoSansHanifiRohingya-Regular.ttf +0 -0
  39. data/fonts/NotoSansHanunoo-Regular.ttf +0 -0
  40. data/fonts/NotoSansHebrew-Regular.ttf +0 -0
  41. data/fonts/NotoSansJP-Regular.otf +0 -0
  42. data/fonts/NotoSansJavanese-Regular.ttf +0 -0
  43. data/fonts/NotoSansKR-Regular.otf +0 -0
  44. data/fonts/NotoSansKannada-Regular.ttf +0 -0
  45. data/fonts/NotoSansKayahLi-Regular.ttf +0 -0
  46. data/fonts/NotoSansKhmer-Regular.ttf +0 -0
  47. data/fonts/NotoSansKhojki-Regular.ttf +0 -0
  48. data/fonts/NotoSansKhudawadi-Regular.ttf +0 -0
  49. data/fonts/NotoSansLao-Regular.ttf +0 -0
  50. data/fonts/NotoSansLepcha-Regular.ttf +0 -0
  51. data/fonts/NotoSansLimbu-Regular.ttf +0 -0
  52. data/fonts/NotoSansLisu-Regular.ttf +0 -0
  53. data/fonts/NotoSansMahajani-Regular.ttf +0 -0
  54. data/fonts/NotoSansMalayalam-Regular.ttf +0 -0
  55. data/fonts/NotoSansMandaic-Regular.ttf +0 -0
  56. data/fonts/NotoSansMasaramGondi-Regular.ttf +0 -0
  57. data/fonts/NotoSansMedefaidrin-Regular.ttf +0 -0
  58. data/fonts/NotoSansMeeteiMayek-Regular.ttf +0 -0
  59. data/fonts/NotoSansMendeKikakui-Regular.ttf +0 -0
  60. data/fonts/NotoSansMiao-Regular.ttf +0 -0
  61. data/fonts/NotoSansModi-Regular.ttf +0 -0
  62. data/fonts/NotoSansMongolian-Regular.ttf +0 -0
  63. data/fonts/NotoSansMro-Regular.ttf +0 -0
  64. data/fonts/NotoSansMultani-Regular.ttf +0 -0
  65. data/fonts/NotoSansNKo-Regular.ttf +0 -0
  66. data/fonts/NotoSansNewTaiLue-Regular.ttf +0 -0
  67. data/fonts/NotoSansNewa-Regular.ttf +0 -0
  68. data/fonts/NotoSansOlChiki-Regular.ttf +0 -0
  69. data/fonts/NotoSansOriya-Regular.ttf +0 -0
  70. data/fonts/NotoSansOsage-Regular.ttf +0 -0
  71. data/fonts/NotoSansOsmanya-Regular.ttf +0 -0
  72. data/fonts/NotoSansPahawhHmong-Regular.ttf +0 -0
  73. data/fonts/NotoSansPauCinHau-Regular.ttf +0 -0
  74. data/fonts/NotoSansRejang-Regular.ttf +0 -0
  75. data/fonts/NotoSansRunic-Regular.ttf +0 -0
  76. data/fonts/NotoSansSC-Regular.otf +0 -0
  77. data/fonts/NotoSansSamaritan-Regular.ttf +0 -0
  78. data/fonts/NotoSansSaurashtra-Regular.ttf +0 -0
  79. data/fonts/NotoSansSharada-Regular.ttf +0 -0
  80. data/fonts/NotoSansShavian-Regular.ttf +0 -0
  81. data/fonts/NotoSansSinhala-Regular.ttf +0 -0
  82. data/fonts/NotoSansSoraSompeng-Regular.ttf +0 -0
  83. data/fonts/NotoSansSoyombo-Regular.ttf +0 -0
  84. data/fonts/NotoSansSundanese-Regular.ttf +0 -0
  85. data/fonts/NotoSansSylotiNagri-Regular.ttf +0 -0
  86. data/fonts/NotoSansSymbols-Regular.ttf +0 -0
  87. data/fonts/NotoSansSymbols2-Regular.ttf +0 -0
  88. data/fonts/NotoSansSyriac-Regular.ttf +0 -0
  89. data/fonts/NotoSansTC-Regular.otf +0 -0
  90. data/fonts/NotoSansTagalog-Regular.ttf +0 -0
  91. data/fonts/NotoSansTagbanwa-Regular.ttf +0 -0
  92. data/fonts/NotoSansTaiLe-Regular.ttf +0 -0
  93. data/fonts/NotoSansTaiTham-Regular.ttf +0 -0
  94. data/fonts/NotoSansTaiViet-Regular.ttf +0 -0
  95. data/fonts/NotoSansTakri-Regular.ttf +0 -0
  96. data/fonts/NotoSansTamil-Regular.ttf +0 -0
  97. data/fonts/NotoSansTelugu-Regular.ttf +0 -0
  98. data/fonts/NotoSansThaana-Regular.ttf +0 -0
  99. data/fonts/NotoSansThai-Regular.ttf +0 -0
  100. data/fonts/NotoSansTifinagh-Regular.ttf +0 -0
  101. data/fonts/NotoSansTifinaghAPT-Regular.ttf +0 -0
  102. data/fonts/NotoSansTifinaghAdrar-Regular.ttf +0 -0
  103. data/fonts/NotoSansTifinaghAgrawImazighen-Regular.ttf +0 -0
  104. data/fonts/NotoSansTifinaghAhaggar-Regular.ttf +0 -0
  105. data/fonts/NotoSansTifinaghAir-Regular.ttf +0 -0
  106. data/fonts/NotoSansTifinaghAzawagh-Regular.ttf +0 -0
  107. data/fonts/NotoSansTifinaghGhat-Regular.ttf +0 -0
  108. data/fonts/NotoSansTifinaghHawad-Regular.ttf +0 -0
  109. data/fonts/NotoSansTifinaghRhissaIxa-Regular.ttf +0 -0
  110. data/fonts/NotoSansTifinaghSIL-Regular.ttf +0 -0
  111. data/fonts/NotoSansTifinaghTawellemmet-Regular.ttf +0 -0
  112. data/fonts/NotoSansTirhuta-Regular.ttf +0 -0
  113. data/fonts/NotoSansVai-Regular.ttf +0 -0
  114. data/fonts/NotoSansWancho-Regular.ttf +0 -0
  115. data/fonts/NotoSansWarangCiti-Regular.ttf +0 -0
  116. data/fonts/NotoSansYi-Regular.ttf +0 -0
  117. data/fonts/NotoSansZanabazarSquare-Regular.ttf +0 -0
  118. data/fonts/NotoSerifArmenian-Regular.ttf +0 -0
  119. data/fonts/NotoSerifBalinese-Regular.ttf +0 -0
  120. data/fonts/NotoSerifBengali-Regular.ttf +0 -0
  121. data/fonts/NotoSerifDevanagari-Regular.ttf +0 -0
  122. data/fonts/NotoSerifDogra-Regular.ttf +0 -0
  123. data/fonts/NotoSerifEthiopic-Regular.ttf +0 -0
  124. data/fonts/NotoSerifGeorgian-Regular.ttf +0 -0
  125. data/fonts/NotoSerifGrantha-Regular.ttf +0 -0
  126. data/fonts/NotoSerifGujarati-Regular.ttf +0 -0
  127. data/fonts/NotoSerifGurmukhi-Regular.ttf +0 -0
  128. data/fonts/NotoSerifHebrew-Regular.ttf +0 -0
  129. data/fonts/NotoSerifKannada-Regular.ttf +0 -0
  130. data/fonts/NotoSerifKhmer-Regular.ttf +0 -0
  131. data/fonts/NotoSerifKhojki-Regular.ttf +0 -0
  132. data/fonts/NotoSerifLao-Regular.ttf +0 -0
  133. data/fonts/NotoSerifMalayalam-Regular.ttf +0 -0
  134. data/fonts/NotoSerifMyanmar-Regular.ttf +0 -0
  135. data/fonts/NotoSerifNPHmong-Regular.ttf +0 -0
  136. data/fonts/NotoSerifSinhala-Regular.ttf +0 -0
  137. data/fonts/NotoSerifTamil-Regular.ttf +0 -0
  138. data/fonts/NotoSerifTelugu-Regular.ttf +0 -0
  139. data/fonts/NotoSerifThai-Regular.ttf +0 -0
  140. data/fonts/NotoSerifTibetan-Regular.ttf +0 -0
  141. data/fonts/NotoSerifYezidi-Regular.ttf +0 -0
  142. data/fonts/Pyidaungsu-2.5.3_Regular.ttf +0 -0
  143. data/fonts/STIXTwoMath-Regular.otf +0 -0
  144. data/fonts/Tinos-Bold.ttf +0 -0
  145. data/fonts/Tinos-BoldItalic.ttf +0 -0
  146. data/fonts/Tinos-Italic.ttf +0 -0
  147. data/fonts/Tinos-Regular.ttf +0 -0
  148. data/fonts/TwemojiMozilla.ttf +0 -0
  149. data/fonts/fonts.conf +183 -0
  150. data/lib/selenium_tor.rb +5 -1
  151. data/lib/tor/driver.rb +26 -12
  152. data/lib/tor/error.rb +18 -0
  153. data/lib/tor/libxul_checksums.yml +56 -0
  154. data/lib/tor/libxul_patchable.rb +13 -13
  155. data/lib/tor/options.rb +13 -29
  156. data/lib/tor/tor_prefs.rb +2 -2
  157. data/lib/tor/tor_process.rb +42 -13
  158. data/lib/tor/torrc.rb +14 -9
  159. data/lib/tor/version.rb +1 -1
  160. metadata +150 -6
  161. data/lib/tor/system_tor.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6f9d6ff1e71d45656e35148ac5d58b490e85c23fbe47cb977de1b0b3f0a7de2
4
- data.tar.gz: 24a4431f5a6b7957f14ca5d222b0f630f29e9955956622e20e73cdff5c51de6c
3
+ metadata.gz: d91caf67c6dbe8d0ee5a4e9e1fde84901ec736d0280dc5913b91e9d38e78bc55
4
+ data.tar.gz: e3e789ac86f09532c03472f52dd80c750695d71f1b7bd4b9b4521880d5f83751
5
5
  SHA512:
6
- metadata.gz: 3f4a53aa33461f0159c0ff8703786646df23b8f503534710d4cf83c688ee247334262e88661f9d87a9a7ce008377c62032e209b737c7abd61165a0b309d8a262
7
- data.tar.gz: 758cbe58b60de4556ff5c95fc82761f919ea1670b131c8afad6f6e6be673092ceb2fa71e5fde1240d5e70c03786eb4d04c75197073af9425381c1d6d66777522
6
+ metadata.gz: bc39fe85b2f2cceddc76d77c4e5cbbfcc35f658a0af9376affd99d397617523705e4b5a2cf11a74785ff7bfb41bf83cfbd15b87e5472649191b4d346b75f6b64
7
+ data.tar.gz: 2b0aa0060db12d4f6854b47b47979e9f50b7a013a8ad550a8fdb5268c1d9c8eda76df88090a81e620845cb1e114db6e8e1430cbdd983a0d0c5a0ef7f88758360
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'
@@ -36,3 +34,6 @@ Minitest/TestMethodName:
36
34
 
37
35
  Minitest/AssertTruthy:
38
36
  Enabled: false
37
+
38
+ Minitest/RefuteFalse:
39
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## [2.0.0] - 2025-05-31
4
+
5
+ ### New features
6
+
7
+ * SocksPort is now auto selected, 'SocksPort'/:socks_port keys are ignored in Tor::Options :tor_opts hash
8
+ * selenium-manager is disabled (avoids chance of FF being downloaded & used)
9
+ * errors in Tor namespace now subclass Selenium::WebDriver::Error::WebDriverError
10
+ * drop Xvfb/headless gem dependency
11
+ * drop deprecated :system_tor options
12
+
13
+ ### Bug fixes
14
+
15
+ * ControlPort no longer set by default in torrc (security)
16
+
17
+ ## [1.7.0] - 2025-05-21
18
+
19
+ ### New features
20
+
21
+ * Reuse cached data files in TorProcess to speed up connection times
22
+ * drop support for TB < 14.5 stable
23
+ * add VirtualGL test to Rake tests
24
+
25
+ ### Bug fixes
26
+
27
+ * [#20](https://gitlab.com/matzfan/selenium-tor/-/issues/20)
28
+
3
29
  ## [1.6.0] - 2024-12-04
4
30
 
5
31
  * drop support for TB < 14.0 stable
data/README.md CHANGED
@@ -8,7 +8,8 @@ A Selenium extension for Tor Browser.
8
8
  # before_all
9
9
  require 'selenium_tor'
10
10
 
11
- options = Selenium::WebDriver::Tor::Options.new
11
+ options = Selenium::WebDriver::Options.tor
12
+ options.args << '-headless'
12
13
  @driver = Selenium::WebDriver.for :tor, options: options
13
14
  ```
14
15
  When you are done don't forget to quit the driver. Failure to do so may leave orphaned tor processes.
@@ -18,6 +19,9 @@ When you are done don't forget to quit the driver. Failure to do so may leave or
18
19
  ```
19
20
  Once you have a driver instance:
20
21
  ```ruby
22
+ @driver
23
+ # => instance_of Selenium::WebDriver::Tor::Driver
24
+
21
25
  @driver.get 'https://check.torproject.org'
22
26
  @driver.title
23
27
  # => "Congratulations. This browser is configured to use Tor."
@@ -27,7 +31,7 @@ Once you have a driver instance:
27
31
 
28
32
  I can use Firefox with Selenium and set a SOCKS proxy to use the Tor network, so why the need?
29
33
 
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.
34
+ 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
35
 
32
36
  ## Installation
33
37
 
@@ -41,13 +45,13 @@ If bundler is not being used to manage dependencies, install the gem by executin
41
45
 
42
46
  ## Dependencies and configuration
43
47
 
44
- [Tor Browser](https://www.torproject.org/download). Versions >= 14.0 stable are supported.
48
+ [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
49
 
46
- As with Firefox browser, `geckodriver` needs to be installed and in your PATH.
50
+ As with Firefox browser, `geckodriver` needs to be installed and in your PATH. [Selenium Manager](https://www.selenium.dev/documentation/selenium_manager) is disabled for security reasons, so you are responsible for ensuring the correct (latest) version of geckodriver is installed.
47
51
 
48
52
  The gem needs to know the location of the Tor Browser Bundle (TBB). The Tor Browser download package archive must be extracted and the root TBB directory (named "tor-browser") placed somewhere on your system. By default it is assumed to be in the current user's HOME directory. An alternative location can be set via the env var `TOR_BROWSER_ROOT_DIR` - e.g. `export TOR_BROWSER_ROOT_DIR=/home/<user>/Downloads`. The Tor Browser binary location is *automatically set* by reference to this directory, so there is no need to do this:
49
53
  ```ruby
50
- options = Selenium::WebDriver::Tor::Options.new
54
+ options = Selenium::WebDriver::Options.tor
51
55
  options.binary = '/some/path/to/tor_firefox_binary' # UNNECESSARY
52
56
  # => '/some/path/to/tor_firefox_binary'
53
57
  ```
@@ -56,21 +60,6 @@ The location of the TBB is not expected to change during code execution.
56
60
 
57
61
  Tor Selenium is tested on **Linux only** right now.
58
62
 
59
- ### Patching libxul.so
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`:
62
- ```ruby
63
- @driver_class = Selenium::WebDriver::Tor::Driver
64
- @driver_class.libxul_patched? # is Tor Browser's libxul.so patched?
65
- # => false
66
- @driver_class.patch_libxul # patch libxul.so
67
- @driver_class.libxul_patched?
68
- # => true
69
- @driver_class.unpatch_libxul # revert the patch and restore the libxul.so packaged with Tor Browser
70
- # => 0
71
- ```
72
- The patcher uses the [Bsdiff](https://gitlab.com/matzfan/bsdiff) gem, which in turn requires the bzip2 library (`libbz2-dev`).
73
-
74
63
  ## Usage
75
64
  ```ruby
76
65
  require 'selenium_tor'
@@ -84,21 +73,17 @@ A separate tor process is used for each driver. Failure to call `Driver#quit` af
84
73
 
85
74
  ### Tor options
86
75
 
87
- In addition to the regular Firefox options, a :tor_opts key may be passed to an instance of `Tor::Options` with a hash of tor options. All valid tor options are recognized - see `man tor`. For convenience, "SocksPort" and "ControlPort" options may be set using snake_case symbols - i.e. :socks_port and :control_port. Additionally, a :tor_opts timeout value may be set with the :timeout key. This overrides the default time allowed for the tor process to bootstrap (10 seconds).
76
+ In addition to the regular Firefox options, a `:tor_opts` key may be passed to an instance of `Tor::Options` with a hash of tor options. All valid tor client options are recognized - see `man tor`. Snake case key symbols may be used if these can be coerced to valid camel case key strings - e.g. `:control_port` becomes 'ControlPort'. Additionally, a `:tor_opts` timeout value may be set with the `:timeout` key. This overrides the default time allowed for the tor process to bootstrap (10 seconds).
88
77
 
89
78
  ### Multiple driver instances
90
79
 
91
- Running multiple tor processes requires that each uses different ports for SocksPort (and ControlPort, if used). These must be passed using the `:tor_opts` key. An example using the [Parallel gem](https://rubygems.org/gems/parallel):
80
+ Running multiple tor processes requires that each uses different ports for SocksPort (and ControlPort, if used). From version 2.0 the SocksPort is auto selected, so no configuation is required. An example using the [Parallel gem](https://rubygems.org/gems/parallel):
92
81
  ```ruby
93
82
  require 'parallel'
94
83
 
95
- @socks_port = 9150
96
- @control_port = 9151
97
-
98
84
  def driver
99
- @socks_port += 2
100
- @control_port += 2
101
- options = Selenium::WebDriver::Tor::Options.new tor_opts: { socks_port: @socks_port, control_port: @control_port }
85
+ options = Selenium::WebDriver::Options.tor # no needs to pass SocksPort in :tor_opts from version 2.0
86
+ options.args << '-headless'
102
87
  Selenium::WebDriver.for :tor, options: options
103
88
  end
104
89
 
@@ -111,6 +96,8 @@ end
111
96
  @drivers.each(&:quit)
112
97
  # => truthy
113
98
  ```
99
+ 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.
100
+
114
101
  ### Tor Browser specific functionality
115
102
 
116
103
  You can get and set the security level (shield icon in TB) as follows. 4 is 'Standard', 2 is 'Safer', 1 is 'Safest'.
@@ -153,31 +140,37 @@ Tor::TBB_EXTENSIONS_DIR # path to the 'extensions' directory in the above
153
140
  Tor::TBB_VERSION # the version installed, e.g. "13.0.1", note: driver.capabilities.browser_version returns the Firefox version Tor Browser is based on
154
141
  # => instance_of String
155
142
  ```
143
+ ### Patching libxul.so
156
144
 
157
- ## Known issues
145
+ 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`:
146
+ ```ruby
147
+ @driver_class = Selenium::WebDriver::Tor::Driver
148
+ @driver_class.libxul_patched? # is Tor Browser's libxul.so patched?
149
+ # => false
150
+ @driver_class.patch_libxul # patch libxul.so
151
+ @driver_class.libxul_patched?
152
+ # => true
153
+ @driver_class.unpatch_libxul # revert the patch and restore the libxul.so packaged with Tor Browser
154
+ # => 0
155
+ ```
156
+ The patcher uses the [Bsdiff](https://gitlab.com/matzfan/bsdiff) gem.
158
157
 
159
- Known issues are recorded [here](https://gitlab.com/matzfan/selenium-tor/-/issues).
158
+ ### Exceptions
160
159
 
161
- ### Fingerprinting
160
+ Tor-specific webdriver funcionality raises `Tor::Error` or a subclass. `Tor::Error` itself subclasses `WebDriver::Error::WebDriverError`
162
161
 
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).
162
+ ## Known issues
163
+
164
+ Known issues are recorded [here](https://gitlab.com/matzfan/selenium-tor/-/issues).
164
165
 
165
166
  ## Testing
166
167
 
167
168
  ~~After checking out the repo, run `bin/setup` to install dependencies.~~
168
169
 
169
- Tests dependencies are `[bsdiff](https://www.daemonology.net/bsdiff)`, `VirtualGL` (see Fingerprinting above) and `Xvfb` if you want to run headless tests.
170
-
171
- 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
-
173
- $ DISPLAY=:99 bundle exec rake
170
+ $ bundle exec rake
174
171
 
175
172
  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
173
 
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
174
  ## Development
182
175
 
183
176
  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]
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