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.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -5
- data/CHANGELOG.md +17 -0
- data/README.md +8 -10
- data/Rakefile +1 -2
- data/fonts/000_README.txt +1 -2
- data/fonts/Arimo-Bold.ttf +0 -0
- data/fonts/Arimo-BoldItalic.ttf +0 -0
- data/fonts/Arimo-Italic.ttf +0 -0
- data/fonts/Arimo-Regular.ttf +0 -0
- data/fonts/Cousine-Bold.ttf +0 -0
- data/fonts/Cousine-BoldItalic.ttf +0 -0
- data/fonts/Cousine-Italic.ttf +0 -0
- data/fonts/Cousine-Regular.ttf +0 -0
- data/fonts/NotoNaskhArabic-Regular.ttf +0 -0
- data/fonts/NotoSansAdlam-Regular.ttf +0 -0
- data/fonts/NotoSansArmenian-Regular.ttf +0 -0
- data/fonts/NotoSansBalinese-Regular.ttf +0 -0
- data/fonts/NotoSansBamum-Regular.ttf +0 -0
- data/fonts/NotoSansBassaVah-Regular.ttf +0 -0
- data/fonts/NotoSansBatak-Regular.ttf +0 -0
- data/fonts/NotoSansBengali-Regular.ttf +0 -0
- data/fonts/NotoSansBuginese-Regular.ttf +0 -0
- data/fonts/NotoSansBuhid-Regular.ttf +0 -0
- data/fonts/NotoSansCanadianAboriginal-Regular.ttf +0 -0
- data/fonts/NotoSansChakma-Regular.ttf +0 -0
- data/fonts/NotoSansCham-Regular.ttf +0 -0
- data/fonts/NotoSansCherokee-Regular.ttf +0 -0
- data/fonts/NotoSansCoptic-Regular.ttf +0 -0
- data/fonts/NotoSansDeseret-Regular.ttf +0 -0
- data/fonts/NotoSansDevanagari-Regular.ttf +0 -0
- data/fonts/NotoSansElbasan-Regular.ttf +0 -0
- data/fonts/NotoSansEthiopic-Regular.ttf +0 -0
- data/fonts/NotoSansGeorgian-Regular.ttf +0 -0
- data/fonts/NotoSansGrantha-Regular.ttf +0 -0
- data/fonts/NotoSansGujarati-Regular.ttf +0 -0
- data/fonts/NotoSansGunjalaGondi-Regular.ttf +0 -0
- data/fonts/NotoSansGurmukhi-Regular.ttf +0 -0
- data/fonts/NotoSansHanifiRohingya-Regular.ttf +0 -0
- data/fonts/NotoSansHanunoo-Regular.ttf +0 -0
- data/fonts/NotoSansHebrew-Regular.ttf +0 -0
- data/fonts/NotoSansJP-Regular.otf +0 -0
- data/fonts/NotoSansJavanese-Regular.ttf +0 -0
- data/fonts/NotoSansKR-Regular.otf +0 -0
- data/fonts/NotoSansKannada-Regular.ttf +0 -0
- data/fonts/NotoSansKayahLi-Regular.ttf +0 -0
- data/fonts/NotoSansKhmer-Regular.ttf +0 -0
- data/fonts/NotoSansKhojki-Regular.ttf +0 -0
- data/fonts/NotoSansKhudawadi-Regular.ttf +0 -0
- data/fonts/NotoSansLao-Regular.ttf +0 -0
- data/fonts/NotoSansLepcha-Regular.ttf +0 -0
- data/fonts/NotoSansLimbu-Regular.ttf +0 -0
- data/fonts/NotoSansLisu-Regular.ttf +0 -0
- data/fonts/NotoSansMahajani-Regular.ttf +0 -0
- data/fonts/NotoSansMalayalam-Regular.ttf +0 -0
- data/fonts/NotoSansMandaic-Regular.ttf +0 -0
- data/fonts/NotoSansMasaramGondi-Regular.ttf +0 -0
- data/fonts/NotoSansMedefaidrin-Regular.ttf +0 -0
- data/fonts/NotoSansMeeteiMayek-Regular.ttf +0 -0
- data/fonts/NotoSansMendeKikakui-Regular.ttf +0 -0
- data/fonts/NotoSansMiao-Regular.ttf +0 -0
- data/fonts/NotoSansModi-Regular.ttf +0 -0
- data/fonts/NotoSansMongolian-Regular.ttf +0 -0
- data/fonts/NotoSansMro-Regular.ttf +0 -0
- data/fonts/NotoSansMultani-Regular.ttf +0 -0
- data/fonts/NotoSansNKo-Regular.ttf +0 -0
- data/fonts/NotoSansNewTaiLue-Regular.ttf +0 -0
- data/fonts/NotoSansNewa-Regular.ttf +0 -0
- data/fonts/NotoSansOlChiki-Regular.ttf +0 -0
- data/fonts/NotoSansOriya-Regular.ttf +0 -0
- data/fonts/NotoSansOsage-Regular.ttf +0 -0
- data/fonts/NotoSansOsmanya-Regular.ttf +0 -0
- data/fonts/NotoSansPahawhHmong-Regular.ttf +0 -0
- data/fonts/NotoSansPauCinHau-Regular.ttf +0 -0
- data/fonts/NotoSansRejang-Regular.ttf +0 -0
- data/fonts/NotoSansRunic-Regular.ttf +0 -0
- data/fonts/NotoSansSC-Regular.otf +0 -0
- data/fonts/NotoSansSamaritan-Regular.ttf +0 -0
- data/fonts/NotoSansSaurashtra-Regular.ttf +0 -0
- data/fonts/NotoSansSharada-Regular.ttf +0 -0
- data/fonts/NotoSansShavian-Regular.ttf +0 -0
- data/fonts/NotoSansSinhala-Regular.ttf +0 -0
- data/fonts/NotoSansSoraSompeng-Regular.ttf +0 -0
- data/fonts/NotoSansSoyombo-Regular.ttf +0 -0
- data/fonts/NotoSansSundanese-Regular.ttf +0 -0
- data/fonts/NotoSansSylotiNagri-Regular.ttf +0 -0
- data/fonts/NotoSansSymbols-Regular.ttf +0 -0
- data/fonts/NotoSansSymbols2-Regular.ttf +0 -0
- data/fonts/NotoSansSyriac-Regular.ttf +0 -0
- data/fonts/NotoSansTC-Regular.otf +0 -0
- data/fonts/NotoSansTagalog-Regular.ttf +0 -0
- data/fonts/NotoSansTagbanwa-Regular.ttf +0 -0
- data/fonts/NotoSansTaiLe-Regular.ttf +0 -0
- data/fonts/NotoSansTaiTham-Regular.ttf +0 -0
- data/fonts/NotoSansTaiViet-Regular.ttf +0 -0
- data/fonts/NotoSansTakri-Regular.ttf +0 -0
- data/fonts/NotoSansTamil-Regular.ttf +0 -0
- data/fonts/NotoSansTelugu-Regular.ttf +0 -0
- data/fonts/NotoSansThaana-Regular.ttf +0 -0
- data/fonts/NotoSansThai-Regular.ttf +0 -0
- data/fonts/NotoSansTifinagh-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghAPT-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghAdrar-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghAgrawImazighen-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghAhaggar-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghAir-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghAzawagh-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghGhat-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghHawad-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghRhissaIxa-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghSIL-Regular.ttf +0 -0
- data/fonts/NotoSansTifinaghTawellemmet-Regular.ttf +0 -0
- data/fonts/NotoSansTirhuta-Regular.ttf +0 -0
- data/fonts/NotoSansVai-Regular.ttf +0 -0
- data/fonts/NotoSansWancho-Regular.ttf +0 -0
- data/fonts/NotoSansWarangCiti-Regular.ttf +0 -0
- data/fonts/NotoSansYi-Regular.ttf +0 -0
- data/fonts/NotoSansZanabazarSquare-Regular.ttf +0 -0
- data/fonts/NotoSerifArmenian-Regular.ttf +0 -0
- data/fonts/NotoSerifBalinese-Regular.ttf +0 -0
- data/fonts/NotoSerifBengali-Regular.ttf +0 -0
- data/fonts/NotoSerifDevanagari-Regular.ttf +0 -0
- data/fonts/NotoSerifDogra-Regular.ttf +0 -0
- data/fonts/NotoSerifEthiopic-Regular.ttf +0 -0
- data/fonts/NotoSerifGeorgian-Regular.ttf +0 -0
- data/fonts/NotoSerifGrantha-Regular.ttf +0 -0
- data/fonts/NotoSerifGujarati-Regular.ttf +0 -0
- data/fonts/NotoSerifGurmukhi-Regular.ttf +0 -0
- data/fonts/NotoSerifHebrew-Regular.ttf +0 -0
- data/fonts/NotoSerifKannada-Regular.ttf +0 -0
- data/fonts/NotoSerifKhmer-Regular.ttf +0 -0
- data/fonts/NotoSerifKhojki-Regular.ttf +0 -0
- data/fonts/NotoSerifLao-Regular.ttf +0 -0
- data/fonts/NotoSerifMalayalam-Regular.ttf +0 -0
- data/fonts/NotoSerifMyanmar-Regular.ttf +0 -0
- data/fonts/NotoSerifNPHmong-Regular.ttf +0 -0
- data/fonts/NotoSerifSinhala-Regular.ttf +0 -0
- data/fonts/NotoSerifTamil-Regular.ttf +0 -0
- data/fonts/NotoSerifTelugu-Regular.ttf +0 -0
- data/fonts/NotoSerifThai-Regular.ttf +0 -0
- data/fonts/NotoSerifTibetan-Regular.ttf +0 -0
- data/fonts/NotoSerifYezidi-Regular.ttf +0 -0
- data/fonts/Pyidaungsu-2.5.3_Regular.ttf +0 -0
- data/fonts/STIXTwoMath-Regular.otf +0 -0
- data/fonts/Tinos-Bold.ttf +0 -0
- data/fonts/Tinos-BoldItalic.ttf +0 -0
- data/fonts/Tinos-Italic.ttf +0 -0
- data/fonts/Tinos-Regular.ttf +0 -0
- data/fonts/TwemojiMozilla.ttf +0 -0
- data/fonts/fonts.conf +183 -0
- data/lib/tor/driver.rb +1 -8
- data/lib/tor/libxul_checksums.yml +79 -0
- data/lib/tor/libxul_patchable.rb +22 -5
- data/lib/tor/options.rb +0 -9
- data/lib/tor/tor_prefs.rb +1 -1
- data/lib/tor/tor_process.rb +39 -10
- data/lib/tor/version.rb +1 -1
- metadata +151 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0b43f3c595a9b52864114bd23e728e824349b3cd514dbc30cbf3bdaca3e1f09
|
4
|
+
data.tar.gz: 45a4d53c8881fa99b6530c11d28131195c57d355f1caba27e4ed51181d52b368
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8cf7f476a0aaa8d25d79e904c4d485e147f0527bdde799f46e62f0d2b140a83ace68cf5601e5b21c2f47cb5106004cbdde1ed99ce8625444d5e906a0014a3e3
|
7
|
+
data.tar.gz: 81c8bef22783b315ec3e4c570f601d8dd442478b30c813c069b491b66665443f6fff05827721e7610b266f28877db38c6c85420dfa13e69e4e7e8e84b187d864
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
|
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
|
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
|
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 `
|
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 (
|
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
|
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
|