selenium_tor 0.1.2 → 0.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/.jshintrc +3 -0
- data/.rubocop.yml +12 -1
- data/.ruby-version +1 -1
- data/.yamllint +7 -0
- data/CHANGELOG.md +31 -1
- data/Guardfile +3 -19
- data/README.md +33 -17
- data/Rakefile +2 -1
- data/lib/tor/driver.rb +20 -14
- data/lib/tor/driver_not_yet_connected_to_tor_network.rb +1 -0
- data/lib/tor/options.rb +8 -7
- data/lib/tor/profile.rb +0 -2
- data/lib/tor/tor_prefs.rb +26 -0
- data/lib/tor/version.rb +1 -1
- data/selenium_tor.gemspec +7 -8
- metadata +27 -14
- data/lib/firefox_driver_lock_file_patch.rb +0 -18
- data/lib/mixin.rb +0 -13
- data/lib/tor/prefs.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53381bfb6eec61ccbffdd84ce01dd3e83413822c139ef6877f1873505fdf9560
|
4
|
+
data.tar.gz: b0aaf6755f2139ab92f66941f6874a38a1ee0d5da6c4a4891968c2c22afb114f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5ce3f9a6def6cf03b4ddcb9eaa24548f70d87f7624d2c6b8deae473210f6a02e7239a80a4ba5ba9a925b8a33f9bb9e4adde8182d93fe90c17a8dd581de25351
|
7
|
+
data.tar.gz: c153ff3ea434a2a141f3f15670e923b0800159e1ee2126414b7fd498fbe937e155de652735255d9f4576735789ab9215f259c2983922627e0d68fbcad33825a7
|
data/.jshintrc
ADDED
data/.rubocop.yml
CHANGED
@@ -6,10 +6,21 @@ require:
|
|
6
6
|
|
7
7
|
AllCops:
|
8
8
|
NewCops: enable
|
9
|
-
TargetRubyVersion: 2.7
|
10
9
|
|
11
10
|
Style/HashSyntax:
|
12
11
|
Enabled: false # yuk Ruby 3.1
|
13
12
|
|
14
13
|
Layout/LineLength:
|
15
14
|
Max: 120
|
15
|
+
|
16
|
+
Security/Eval:
|
17
|
+
Exclude:
|
18
|
+
- 'test/test_readme.rb'
|
19
|
+
|
20
|
+
Lint/RescueException:
|
21
|
+
Exclude:
|
22
|
+
- 'test/test_readme.rb'
|
23
|
+
|
24
|
+
Style/RegexpLiteral:
|
25
|
+
Exclude:
|
26
|
+
- 'Guardfile'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.4
|
data/.yamllint
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
## master (unreleased)
|
2
2
|
|
3
|
+
## [0.2.0] - 2024-07-10
|
4
|
+
|
5
|
+
### Breaking changes
|
6
|
+
|
7
|
+
* RUN_HEADED_TESTS env var now ignored
|
8
|
+
|
9
|
+
### New features
|
10
|
+
|
11
|
+
* add README code block tests
|
12
|
+
* fingerprintjs tests cover WebGL llvmpipe driver and WebGL being disabled
|
13
|
+
* special test added to test WebGL fingerprint when code run with vglrun
|
14
|
+
|
15
|
+
### Bug fixes
|
16
|
+
|
17
|
+
* [#4](https://gitlab.com/matzfan/selenium-tor/-/issues/4)
|
18
|
+
* [#5](https://gitlab.com/matzfan/selenium-tor/-/issues/5)
|
19
|
+
* [#7](https://gitlab.com/matzfan/selenium-tor/-/issues/7)
|
20
|
+
|
21
|
+
## [0.1.3] - 2023-12-08
|
22
|
+
|
23
|
+
### Bug fixes
|
24
|
+
|
25
|
+
* added selenium-webdriver as runtime dependency
|
26
|
+
* [#2](https://gitlab.com/matzfan/selenium-tor/-/issues/2) fixed, fingerprintjs VisitorId now same as TB's
|
27
|
+
|
28
|
+
### New features
|
29
|
+
|
30
|
+
* Fix circular require issue
|
31
|
+
* Expand fingerprint tests
|
32
|
+
|
3
33
|
## [0.1.2] - 2023-11-20
|
4
34
|
|
5
35
|
* Breaking change: change constant names in Tor namespace - see README
|
@@ -18,7 +48,7 @@
|
|
18
48
|
### Bug fixes
|
19
49
|
|
20
50
|
* Fix inability to add options to Tor::Options
|
21
|
-
* [#1](https://gitlab.com/matzfan/
|
51
|
+
* [#1](https://gitlab.com/matzfan/selenium-tor/-/issues/1): Fix fonts leak at browserleaks
|
22
52
|
|
23
53
|
### New features
|
24
54
|
|
data/Guardfile
CHANGED
@@ -1,25 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# A sample Guardfile
|
4
|
-
# More info at https://github.com/guard/guard#readme
|
5
|
-
|
6
|
-
## Uncomment and set this to only include directories you want to watch
|
7
|
-
# directories %w(app lib config test spec features) \
|
8
|
-
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
9
|
-
|
10
|
-
## Note: if you are using the `directories` clause above and you are not
|
11
|
-
## watching the project directory ('.'), then you will want to move
|
12
|
-
## the Guardfile to a watched dir and symlink it back, e.g.
|
13
|
-
#
|
14
|
-
# $ mkdir config
|
15
|
-
# $ mv Guardfile config/
|
16
|
-
# $ ln -s config/Guardfile .
|
17
|
-
#
|
18
|
-
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
19
|
-
|
20
3
|
guard :minitest do
|
21
4
|
watch(%r{^test/(.*)/?test_(.*)\.rb$})
|
22
5
|
watch(%r{^features/(.*)/?test_(.*)\.rb$})
|
23
|
-
watch(%r{^lib/(.*/)?([^/]+)\.rb$})
|
24
|
-
watch(%r{^test/test_helper\.rb$})
|
6
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
7
|
+
watch(%r{^test/test_helper\.rb$}) { 'test' }
|
8
|
+
watch(%r{^README.md$}) { 'test/test_readme.rb' }
|
25
9
|
end
|
data/README.md
CHANGED
@@ -5,9 +5,20 @@
|
|
5
5
|
|
6
6
|
A Selenium extension for Tor Browser.
|
7
7
|
```ruby
|
8
|
-
driver = Selenium::WebDriver.for :tor
|
8
|
+
@driver = Selenium::WebDriver.for :tor
|
9
|
+
@driver.quit
|
9
10
|
```
|
10
11
|
|
12
|
+
## \_why?
|
13
|
+
|
14
|
+
I can use Firefox with Selenium and set a SOCKS proxy to use the Tor network, so why the need?
|
15
|
+
|
16
|
+
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.
|
17
|
+
|
18
|
+
## Known issues
|
19
|
+
|
20
|
+
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).
|
21
|
+
|
11
22
|
## Installation
|
12
23
|
|
13
24
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -25,12 +36,11 @@ Tor Browser is based on Firefox, so for usage please read the Selenium [docs](ht
|
|
25
36
|
A driver is instantiated like this:
|
26
37
|
```ruby
|
27
38
|
options = Selenium::WebDriver::Tor::Options.new
|
28
|
-
|
29
|
-
driver = Selenium::WebDriver.for :tor, options: options
|
39
|
+
@driver = Selenium::WebDriver.for :tor, options: options
|
30
40
|
|
31
|
-
driver.get 'https://check.torproject.org'
|
32
|
-
|
33
|
-
|
41
|
+
@driver.get 'https://check.torproject.org'
|
42
|
+
@driver.title # => Congratulations. This browser is configured to use Tor.
|
43
|
+
@driver.quit
|
34
44
|
```
|
35
45
|
The driver will not be instantiated until a connection to the Tor network is made. If the network is inaccessible for any reason a `TorNetworkError` will result.
|
36
46
|
|
@@ -42,23 +52,25 @@ A number of constants are set during driver initialization based upon values fou
|
|
42
52
|
```ruby
|
43
53
|
Tor::TBB_DIR # path to the TBB root directory
|
44
54
|
Tor::TBB_BROWSER_DIR # path to the 'Browser' directory in the above
|
45
|
-
Tor::TBB_BINARY_PATH # path to the binary
|
55
|
+
Tor::TBB_BINARY_PATH # path to the firefox binary
|
46
56
|
Tor::TBB_PROFILE_DIR # path to the default profile directory
|
47
57
|
Tor::TBB_EXTENSIONS_DIR # path to the 'extensions' directory in the above
|
48
|
-
Tor::TBB_VERSION #
|
49
|
-
the version installed, e.g. "13.0.1", note: driver.capabilities.browser_version returns the Firefox version Tor Browser is based on
|
58
|
+
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
|
50
59
|
```
|
51
60
|
|
52
61
|
## Dependencies and configuration
|
53
62
|
|
63
|
+
[Tor Browser](https://www.torproject.org/download).
|
64
|
+
|
54
65
|
As with Firefox browser, `geckodriver` needs to be installed and in your PATH.
|
55
66
|
|
56
|
-
The gem needs to know the location of the Tor Browser Bundle (TBB).
|
67
|
+
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:
|
57
68
|
```ruby
|
69
|
+
options = Selenium::WebDriver::Tor::Options.new
|
58
70
|
options.binary = '/some/path/to/tor_firefox_binary' # UNNECESSARY
|
59
71
|
```
|
60
72
|
|
61
|
-
The location of the TBB is not expected to change during execution.
|
73
|
+
The location of the TBB is not expected to change during code execution.
|
62
74
|
|
63
75
|
Tor Selenium is tested on **Linux only** right now.
|
64
76
|
|
@@ -66,11 +78,15 @@ Tor Selenium is tested on **Linux only** right now.
|
|
66
78
|
|
67
79
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run the tests.
|
68
80
|
|
69
|
-
Tests are run in
|
81
|
+
Tests are run in the display set by the `DISPLAY` env var, :0 by default. To run headless tests, set it to another value:
|
82
|
+
|
83
|
+
$ DISPLAY=:99 bundle exec rake
|
84
|
+
|
85
|
+
If you find tests are failing with `TorNetworkError` and a timeout message, check you have no other Tor Browser processes running. The processes to look for are either "firefox.real" or "firefox-esr". The latter may be legitimate if you are also running Firefox browser. You may also want to check the Tor network is actually up, it isn't always..
|
70
86
|
|
71
|
-
|
87
|
+
If you wish run the `vglrun` WebGL fingerprint test (excluded from Rake) install VirtualGL (see above, assumes you have the relevent drivers installed) and run the following command:
|
72
88
|
|
73
|
-
|
89
|
+
$ DISPLAY=:99 vglrun bundle exec ruby test/features/fingerprinting/test_fingerprintjs_with_vglrun.rb
|
74
90
|
|
75
91
|
## Development
|
76
92
|
|
@@ -80,9 +96,9 @@ To install this gem onto your local machine, run `bundle exec rake install`.
|
|
80
96
|
|
81
97
|
## Contributing
|
82
98
|
|
83
|
-
Bug reports and pull requests are welcome on GitLab at https://gitlab.com/matzfan/
|
99
|
+
Bug reports and pull requests are welcome on GitLab at https://gitlab.com/matzfan/selenium-tor. For a pull request please checkout a suitably named feature branch before making and submitting changes.
|
84
100
|
|
85
|
-
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/matzfan/
|
101
|
+
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/matzfan/selenium-tor/CODE_OF_CONDUCT.md).
|
86
102
|
|
87
103
|
## License
|
88
104
|
|
@@ -90,4 +106,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
90
106
|
|
91
107
|
## Code of Conduct
|
92
108
|
|
93
|
-
Everyone interacting in the Selenium Tor project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/matzfan/
|
109
|
+
Everyone interacting in the Selenium Tor project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/matzfan/selenium-tor/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
@@ -6,7 +6,8 @@ require 'rake/testtask'
|
|
6
6
|
Rake::TestTask.new(:test) do |t|
|
7
7
|
t.libs << 'test'
|
8
8
|
t.libs << 'lib'
|
9
|
-
t.test_files = FileList['test/**/test_*.rb']
|
9
|
+
t.test_files = FileList['test/**/test_*.rb'] - ['test/features/fingerprinting/test_fingerprintjs_with_vglrun.rb']
|
10
|
+
# t.warning = false
|
10
11
|
end
|
11
12
|
|
12
13
|
require 'rubocop/rake_task'
|
data/lib/tor/driver.rb
CHANGED
@@ -2,40 +2,46 @@
|
|
2
2
|
|
3
3
|
require 'open-uri'
|
4
4
|
require_relative 'driver_not_yet_connected_to_tor_network'
|
5
|
-
require_relative '../mixin'
|
6
5
|
|
7
6
|
module Selenium
|
8
7
|
module WebDriver
|
9
8
|
module Tor
|
10
9
|
# tor driver
|
11
|
-
class Driver < DelegateClass(
|
12
|
-
include Mixin
|
13
|
-
|
10
|
+
class Driver < DelegateClass(DriverNotYetConnectedToTorNetwork)
|
14
11
|
class TorNetworkError < StandardError; end
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
CONNECT_BUTTON_ID = 'network-status-tor-connect-button' # visible only until connected
|
14
|
+
TOR_PREFS_CONNECTION_URL = 'about:preferences#connection'
|
15
|
+
|
16
|
+
attr_reader :support_data
|
19
17
|
|
20
18
|
def initialize(...)
|
21
|
-
|
22
|
-
super
|
19
|
+
instantiate_driver_from_tbb_dir(...)
|
20
|
+
super(@instance)
|
23
21
|
wait_for_tor_connection
|
24
|
-
|
22
|
+
install_extensions
|
25
23
|
end
|
26
24
|
|
27
25
|
private
|
28
26
|
|
27
|
+
def instantiate_driver_from_tbb_dir(...)
|
28
|
+
cwd = FileUtils.pwd
|
29
|
+
FileUtils.cd TBB_BROWSER_DIR # crucial - fixes [#2](https://gitlab.com/matzfan/selenium-tor/-/issues/2)
|
30
|
+
@instance = DriverNotYetConnectedToTorNetwork.new(...)
|
31
|
+
ensure
|
32
|
+
FileUtils.cd cwd
|
33
|
+
end
|
34
|
+
|
29
35
|
def wait_for_tor_connection
|
30
|
-
@instance.get
|
31
|
-
|
36
|
+
@instance.get TOR_PREFS_CONNECTION_URL
|
37
|
+
Wait.new(timeout: 10).until { !@instance.find_element(:id, CONNECT_BUTTON_ID).displayed? }
|
32
38
|
rescue Selenium::WebDriver::Error::TimeoutError => e
|
33
39
|
@instance.quit # abort initialization
|
34
40
|
raise TorNetworkError, "Cannot connect to Tor network: #{e.message}"
|
35
41
|
end
|
36
42
|
|
37
|
-
def
|
38
|
-
@instance.install_addon
|
43
|
+
def install_extensions
|
44
|
+
Pathname.new(TBB_EXTENSIONS_DIR).children.each { |xpi_path| @instance.install_addon xpi_path }
|
39
45
|
end
|
40
46
|
end
|
41
47
|
end
|
data/lib/tor/options.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '
|
3
|
+
require_relative 'tor_prefs'
|
4
4
|
require 'selenium-webdriver'
|
5
5
|
|
6
6
|
module Selenium
|
@@ -17,23 +17,24 @@ module Selenium
|
|
17
17
|
Tor::TBB_VERSION = JSON.parse(File.read(File.join(Tor::TBB_BROWSER_DIR, 'tbb_version.json')))['version']
|
18
18
|
|
19
19
|
def initialize(log_level: nil, **opts)
|
20
|
-
super(log_level: log_level, **tor_options.merge(opts))
|
20
|
+
super(log_level: log_level, **tor_options(opts.delete(:prefs)).merge(opts))
|
21
21
|
do_start_tor_browser_script_stuff # stuff the start-tor-browser script in TBB does
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
|
-
def tor_options
|
27
|
-
{ binary: TBB_BINARY_PATH, prefs:
|
26
|
+
def tor_options(prefs)
|
27
|
+
{ binary: TBB_BINARY_PATH, prefs: (prefs || {}).merge(TOR_PREFS) }
|
28
28
|
end
|
29
29
|
|
30
30
|
def do_start_tor_browser_script_stuff
|
31
|
+
ENV['SESSION_MANAGER'] = nil
|
31
32
|
ENV['XAUTHORITY'] = File.join(Dir.home, '.Xauthority') unless ENV.fetch('XAUTHORITY', nil)
|
32
|
-
ENV['
|
33
|
-
ENV['FONTCONFIG_PATH'] = "#{TBB_BROWSER_DIR}/fontconfig" # these two stop font leaks [#1]
|
33
|
+
ENV['FONTCONFIG_PATH'] = File.join Tor::TBB_BROWSER_DIR, 'fontconfig' # supposed to stop font leaks..
|
34
34
|
ENV['FONTCONFIG_FILE'] = 'fonts.conf'
|
35
|
+
FileUtils.rm_rf File.join(Tor::TBB_BROWSER_DIR, *%w[TorBrowser Data fontconfig])
|
35
36
|
ENV['GSETTINGS_BACKEND'] = 'memory'
|
36
|
-
|
37
|
+
# cd to TBB_BROWSER_DIR now handled in Tor::Driver
|
37
38
|
end
|
38
39
|
end
|
39
40
|
end
|
data/lib/tor/profile.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Selenium
|
4
|
+
module WebDriver
|
5
|
+
module Tor
|
6
|
+
FIRST_CONNECTION_PREFS = {
|
7
|
+
'extensions.torlauncher.prompt_at_startup' => false,
|
8
|
+
'privacy.purge_trackers.date_in_cookie_database' => '0',
|
9
|
+
'torbrowser.settings.bridges.builtin_type' => '',
|
10
|
+
'torbrowser.settings.bridges.enabled' => false,
|
11
|
+
'torbrowser.settings.bridges.source' => -1,
|
12
|
+
'torbrowser.settings.enabled' => true,
|
13
|
+
'torbrowser.settings.firewall.enabled' => false,
|
14
|
+
'torbrowser.settings.proxy.enabled' => false,
|
15
|
+
'torbrowser.settings.quickstart.enabled' => true
|
16
|
+
}.freeze
|
17
|
+
|
18
|
+
OTHER_PREFS = {
|
19
|
+
'intl.language_notification.shown' => true, # affects font fingerprint (viewport size)
|
20
|
+
'remote.active-protocols' => 3 # new some time after selenium-webdriver 4.16
|
21
|
+
}.freeze
|
22
|
+
|
23
|
+
TOR_PREFS = FIRST_CONNECTION_PREFS.merge OTHER_PREFS
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/tor/version.rb
CHANGED
data/selenium_tor.gemspec
CHANGED
@@ -6,19 +6,16 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'selenium_tor'
|
7
7
|
spec.version = Selenium::WebDriver::Tor::VERSION
|
8
8
|
spec.authors = ['MatzFan']
|
9
|
-
spec.email = ['matzfan@mailinator.com']
|
10
9
|
|
11
10
|
spec.summary = 'Selenium extension for Tor Browser'
|
12
|
-
spec.description = '
|
13
|
-
spec.homepage = 'https://gitlab.com/matzfan/
|
11
|
+
spec.description = 'An extension for Selenium::WebDriver that automates Tor Browser'
|
12
|
+
spec.homepage = 'https://gitlab.com/matzfan/selenium-tor'
|
14
13
|
spec.license = 'MIT'
|
15
|
-
spec.required_ruby_version = '>=
|
16
|
-
|
17
|
-
# spec.metadata['allowed_push_host'] =
|
14
|
+
spec.required_ruby_version = '>= 3.3.3'
|
18
15
|
|
19
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
-
spec.metadata['source_code_uri'] = 'https://gitlab.com/matzfan/
|
21
|
-
spec.metadata['changelog_uri'] = 'https://gitlab.com/matzfan/
|
17
|
+
spec.metadata['source_code_uri'] = 'https://gitlab.com/matzfan/selenium-tor'
|
18
|
+
spec.metadata['changelog_uri'] = 'https://gitlab.com/matzfan/selenium-tor/CHANGELOG.md'
|
22
19
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
23
20
|
|
24
21
|
# Specify which files should be added to the gem when it is released.
|
@@ -32,4 +29,6 @@ Gem::Specification.new do |spec|
|
|
32
29
|
spec.bindir = 'exe'
|
33
30
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
34
31
|
spec.require_paths = ['lib']
|
32
|
+
|
33
|
+
spec.add_runtime_dependency 'selenium-webdriver', '~> 4.22'
|
35
34
|
end
|
metadata
CHANGED
@@ -1,24 +1,39 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium_tor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MatzFan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: selenium-webdriver
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.22'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.22'
|
27
|
+
description: An extension for Selenium::WebDriver that automates Tor Browser
|
14
28
|
email:
|
15
|
-
- matzfan@mailinator.com
|
16
29
|
executables: []
|
17
30
|
extensions: []
|
18
31
|
extra_rdoc_files: []
|
19
32
|
files:
|
33
|
+
- ".jshintrc"
|
20
34
|
- ".rubocop.yml"
|
21
35
|
- ".ruby-version"
|
36
|
+
- ".yamllint"
|
22
37
|
- CHANGELOG.md
|
23
38
|
- CODE_OF_CONDUCT.md
|
24
39
|
- Guardfile
|
@@ -26,26 +41,24 @@ files:
|
|
26
41
|
- README.md
|
27
42
|
- Rakefile
|
28
43
|
- lib/driver.rb
|
29
|
-
- lib/firefox_driver_lock_file_patch.rb
|
30
|
-
- lib/mixin.rb
|
31
44
|
- lib/options.rb
|
32
45
|
- lib/selenium_tor.rb
|
33
46
|
- lib/service.rb
|
34
47
|
- lib/tor/driver.rb
|
35
48
|
- lib/tor/driver_not_yet_connected_to_tor_network.rb
|
36
49
|
- lib/tor/options.rb
|
37
|
-
- lib/tor/prefs.rb
|
38
50
|
- lib/tor/profile.rb
|
51
|
+
- lib/tor/tor_prefs.rb
|
39
52
|
- lib/tor/version.rb
|
40
53
|
- selenium_tor.gemspec
|
41
54
|
- sig/tor.rbs
|
42
|
-
homepage: https://gitlab.com/matzfan/
|
55
|
+
homepage: https://gitlab.com/matzfan/selenium-tor
|
43
56
|
licenses:
|
44
57
|
- MIT
|
45
58
|
metadata:
|
46
|
-
homepage_uri: https://gitlab.com/matzfan/
|
47
|
-
source_code_uri: https://gitlab.com/matzfan/
|
48
|
-
changelog_uri: https://gitlab.com/matzfan/
|
59
|
+
homepage_uri: https://gitlab.com/matzfan/selenium-tor
|
60
|
+
source_code_uri: https://gitlab.com/matzfan/selenium-tor
|
61
|
+
changelog_uri: https://gitlab.com/matzfan/selenium-tor/CHANGELOG.md
|
49
62
|
rubygems_mfa_required: 'true'
|
50
63
|
post_install_message:
|
51
64
|
rdoc_options: []
|
@@ -55,14 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
55
68
|
requirements:
|
56
69
|
- - ">="
|
57
70
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
71
|
+
version: 3.3.3
|
59
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
73
|
requirements:
|
61
74
|
- - ">="
|
62
75
|
- !ruby/object:Gem::Version
|
63
76
|
version: '0'
|
64
77
|
requirements: []
|
65
|
-
rubygems_version: 3.5.
|
78
|
+
rubygems_version: 3.5.14
|
66
79
|
signing_key:
|
67
80
|
specification_version: 4
|
68
81
|
summary: Selenium extension for Tor Browser
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Selenium
|
4
|
-
module WebDriver
|
5
|
-
module Firefox
|
6
|
-
# patched class
|
7
|
-
class Profile
|
8
|
-
alias old_delete_lock_files delete_lock_files
|
9
|
-
|
10
|
-
def delete_lock_files(directory)
|
11
|
-
%w[.parentlock parent.lock lock].each do |name| # 'lock' file missing from Selenium < 4.16
|
12
|
-
FileUtils.rm_f File.join(directory, name)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/lib/mixin.rb
DELETED
data/lib/tor/prefs.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Selenium
|
4
|
-
module WebDriver
|
5
|
-
module Tor
|
6
|
-
PREFS = { 'extensions.torlauncher.prompt_at_startup' => false,
|
7
|
-
'intl.language_notification.shown' => true,
|
8
|
-
'torbrowser.settings.bridges.builtin_type' => '',
|
9
|
-
'torbrowser.settings.bridges.enabled' => false,
|
10
|
-
'torbrowser.settings.bridges.source' => -1,
|
11
|
-
'torbrowser.settings.enabled' => true,
|
12
|
-
'torbrowser.settings.firewall.enabled' => false,
|
13
|
-
'torbrowser.settings.proxy.enabled' => false,
|
14
|
-
'torbrowser.settings.quickstart.enabled' => true }.freeze
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|