selenium_tor 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +15 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +21 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Guardfile +25 -0
- data/LICENSE.txt +21 -0
- data/README.md +87 -0
- data/Rakefile +16 -0
- data/lib/driver.rb +19 -0
- data/lib/mixin.rb +13 -0
- data/lib/options.rb +15 -0
- data/lib/selenium_tor.rb +4 -0
- data/lib/service.rb +12 -0
- data/lib/tor/driver.rb +43 -0
- data/lib/tor/driver_not_yet_connected_to_tor_network.rb +17 -0
- data/lib/tor/options.rb +39 -0
- data/lib/tor/prefs.rb +17 -0
- data/lib/tor/version.rb +9 -0
- data/selenium_tor.gemspec +35 -0
- data/sig/tor.rbs +6 -0
- metadata +67 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2e1fe6540f9a3fdb5709dd88c4594a453052aec00f00423e39f69664ec8d27e1
|
4
|
+
data.tar.gz: a0a8a23354f5c0bad149baf6d0b043e72f64845b142921492c72d6565e8120da
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c74beaf4a2c71a66fb4cbee34f9896c483308b684b99ebcb12e653c983d7be6e4486d6ea8c177096d01243d2eb5f275044d308ef9f602bf56c760be2ffcb6022
|
7
|
+
data.tar.gz: 633ca399c16169d4f9d0a48b12fb4781a1c68fa4e49e121454db26d14bea1bef0770ef1d82e1cb700ffe1124d353ed7070e8830290a9e4796b3458d74a62492c
|
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.3.0-preview3
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
## master (unreleased)
|
2
|
+
|
3
|
+
## [0.1.1] - 2023-11-19
|
4
|
+
|
5
|
+
* Rename gem from selenium-tor, yanked previous versions
|
6
|
+
|
7
|
+
## [0.0.1] - 2023-11-19
|
8
|
+
|
9
|
+
### Bug fixes
|
10
|
+
|
11
|
+
* Fix inability to add options to Tor::Options
|
12
|
+
* [#1](https://gitlab.com/matzfan/selenium_tor/-/issues/1): Fix fonts leak at browserleaks
|
13
|
+
|
14
|
+
### New features
|
15
|
+
|
16
|
+
* Set constants in Selenium::WebDriver::Tor namespace
|
17
|
+
* Set env vars to reflect those set in TBB's start-tor-browser script
|
18
|
+
|
19
|
+
## [0.0.0] - 2023-11-17
|
20
|
+
|
21
|
+
- Initial release
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at matzfan@mailinator.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Guardfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
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
|
+
guard :minitest do
|
21
|
+
watch(%r{^test/(.*)/?test_(.*)\.rb$})
|
22
|
+
watch(%r{^features/(.*)/?test_(.*)\.rb$})
|
23
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
24
|
+
watch(%r{^test/test_helper\.rb$}) { 'test' }
|
25
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 MatzFan
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/selenium_tor.svg)](https://badge.fury.io/rb/selenium_tor)
|
2
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
|
3
|
+
|
4
|
+
# Selenium Tor
|
5
|
+
|
6
|
+
A Selenium extension for Tor Browser.
|
7
|
+
```ruby
|
8
|
+
driver = Selenium::WebDriver.for :tor
|
9
|
+
```
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Install the gem and add to the application's Gemfile by executing:
|
14
|
+
|
15
|
+
$ bundle add selenium_tor
|
16
|
+
|
17
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
18
|
+
|
19
|
+
$ gem install selenium_tor
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Tor Browser is based on Firefox, so for usage please read the Selenium [docs](https://www.selenium.dev/documentation/webdriver/browsers/firefox/) for Firefox browser.
|
24
|
+
|
25
|
+
A driver is instantiated like this:
|
26
|
+
```ruby
|
27
|
+
options = Selenium::WebDriver::Tor::Options.new
|
28
|
+
options.add_argument '--headless' # whatever you need
|
29
|
+
driver = Selenium::WebDriver.for :tor, options: options
|
30
|
+
|
31
|
+
driver.get 'https://check.torproject.org'
|
32
|
+
puts driver.title
|
33
|
+
# => Congratulations. This browser is configured to use Tor.
|
34
|
+
```
|
35
|
+
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
|
+
|
37
|
+
The `Selenium::WebDriver::Tor` namespace is used by `Driver` and `Options`. Otherwise Selenium's `Selenium::WebDriver::Firefox` namespace is used.
|
38
|
+
|
39
|
+
Remote functionality is not tested, but will be if Selenium provide a Tor Browser Docker container for Selenium Grid.
|
40
|
+
|
41
|
+
A number of constants are set during driver initialization based upon values found in the Tor Browser Bundle (TBB) root directory (see below). These include:
|
42
|
+
```ruby
|
43
|
+
Tor::TBB_DIR # path to the TBB root directory
|
44
|
+
Tor::TBB_BROWSER_DIR # path to the 'Browser' directory in the above
|
45
|
+
Tor::TOR_BROWSER_BINARY_PATH # path to the binary
|
46
|
+
Tor::TOR_BROWSER_VERSION # the version installed, e.g. "13.0.1", note: driver.capabilities.browser_version returns the Firefox version Tor Browser is based on
|
47
|
+
```
|
48
|
+
|
49
|
+
## Dependencies and configuration
|
50
|
+
|
51
|
+
As with Firefox browser, Geckodriver needs to be installed and in your PATH.
|
52
|
+
|
53
|
+
The gem needs to know the location of the Tor Browser Bundle (TBB). This can be installed from the Tor Project [downloads page](https://www.torproject.org/download/). The download package archive must be extracted and the root TBB directory (called `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:
|
54
|
+
```ruby
|
55
|
+
options.binary = '/some/path/to/tor_firefox_binary' # UNNECESSARY
|
56
|
+
```
|
57
|
+
Tor Selenium is tested on **Linux only** right now.
|
58
|
+
|
59
|
+
## Testing
|
60
|
+
|
61
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
62
|
+
|
63
|
+
Tests are run in headless mode by default. If you want to see what the browser is doing you can do this:
|
64
|
+
|
65
|
+
$ export RUN_HEADED_TESTS=1 && rake
|
66
|
+
|
67
|
+
If you find tests are failing with `TorNetworkError` and a timeout message, check you have no other Tor Browser processes running. The process to look for is called `firefox.real`. You may also want to check the Tor network is actually up, it isn't always..
|
68
|
+
|
69
|
+
## Development
|
70
|
+
|
71
|
+
You can run `bin/console` for an interactive prompt that will allow you to experiment.
|
72
|
+
|
73
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
74
|
+
|
75
|
+
## Contributing
|
76
|
+
|
77
|
+
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.
|
78
|
+
|
79
|
+
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).
|
80
|
+
|
81
|
+
## License
|
82
|
+
|
83
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
84
|
+
|
85
|
+
## Code of Conduct
|
86
|
+
|
87
|
+
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
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << 'test'
|
8
|
+
t.libs << 'lib'
|
9
|
+
t.test_files = FileList['test/**/test_*.rb']
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'rubocop/rake_task'
|
13
|
+
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
task default: %i[test rubocop]
|
data/lib/driver.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal:true
|
2
|
+
|
3
|
+
require_relative 'tor/driver'
|
4
|
+
|
5
|
+
# extend class
|
6
|
+
module Selenium
|
7
|
+
module WebDriver
|
8
|
+
# patched class
|
9
|
+
class Driver
|
10
|
+
class << self
|
11
|
+
alias old_for for
|
12
|
+
|
13
|
+
def for(browser, opts = {})
|
14
|
+
browser == :tor ? Tor::Driver.new(**opts) : old_for(browser, opts)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/mixin.rb
ADDED
data/lib/options.rb
ADDED
data/lib/selenium_tor.rb
ADDED
data/lib/service.rb
ADDED
data/lib/tor/driver.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'open-uri'
|
4
|
+
require_relative 'driver_not_yet_connected_to_tor_network'
|
5
|
+
require_relative '../mixin'
|
6
|
+
|
7
|
+
module Selenium
|
8
|
+
module WebDriver
|
9
|
+
module Tor
|
10
|
+
# tor driver
|
11
|
+
class Driver < DelegateClass(Tor::DriverNotYetConnectedToTorNetwork)
|
12
|
+
include Mixin
|
13
|
+
|
14
|
+
class TorNetworkError < StandardError; end
|
15
|
+
|
16
|
+
CONNECTION_STATUS_ID = 'torPreferences-status-tor-connect'
|
17
|
+
CONNECTED = "Tor Network:\nConnected"
|
18
|
+
NO_SCRIPT_XPI_URL = 'https://addons.mozilla.org/firefox/downloads/file/4178438/noscript-11.4.28.xpi'
|
19
|
+
|
20
|
+
def initialize(...)
|
21
|
+
@instance = DriverNotYetConnectedToTorNetwork.new(...)
|
22
|
+
super @instance
|
23
|
+
wait_for_tor_connection
|
24
|
+
install_addons
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def wait_for_tor_connection
|
30
|
+
@instance.get 'about:preferences#connection'
|
31
|
+
wait(10).until { @instance.find_element(:id, CONNECTION_STATUS_ID).text == CONNECTED }
|
32
|
+
rescue Selenium::WebDriver::Error::TimeoutError => e
|
33
|
+
@instance.quit # abort initialization
|
34
|
+
raise TorNetworkError, "Cannot connect to Tor network: #{e.message}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def install_addons
|
38
|
+
@instance.install_addon URI.parse(NO_SCRIPT_XPI_URL).open
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../service'
|
4
|
+
require_relative '../options'
|
5
|
+
|
6
|
+
module Selenium
|
7
|
+
module WebDriver
|
8
|
+
module Tor
|
9
|
+
# subclass - doesn't wait to be connected to tor network
|
10
|
+
class DriverNotYetConnectedToTorNetwork < Firefox::Driver
|
11
|
+
def browser
|
12
|
+
:tor # overides :firefox
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/tor/options.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'prefs'
|
4
|
+
require 'selenium-webdriver'
|
5
|
+
|
6
|
+
module Selenium
|
7
|
+
module WebDriver
|
8
|
+
module Tor
|
9
|
+
# tor options
|
10
|
+
class Options < Firefox::Options
|
11
|
+
DEFAULT_TBB_DIR = File.join Dir.home, 'tor-browser'
|
12
|
+
Tor::TBB_DIR = ENV.fetch('TOR_BROWSER_ROOT_DIR', nil) || DEFAULT_TBB_DIR
|
13
|
+
Tor::TBB_BROWSER_DIR = File.join Tor::TBB_DIR, 'Browser'
|
14
|
+
Tor::TOR_BROWSER_BINARY_PATH = File.join Tor::TBB_BROWSER_DIR, 'firefox'
|
15
|
+
Tor::TOR_BROWSER_VERSION = JSON.parse(File.read(File.join(Tor::TBB_BROWSER_DIR, 'tbb_version.json')))['version']
|
16
|
+
|
17
|
+
def initialize(log_level: nil, **opts)
|
18
|
+
super(log_level: log_level, **tor_options.merge(opts))
|
19
|
+
do_start_tor_browser_script_stuff # stuff the start-tor-browser script in TBB does
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def tor_options
|
25
|
+
{ binary: TOR_BROWSER_BINARY_PATH, prefs: PREFS }
|
26
|
+
end
|
27
|
+
|
28
|
+
def do_start_tor_browser_script_stuff
|
29
|
+
ENV['XAUTHORITY'] = File.join(Dir.home, '.Xauthority') unless ENV.fetch('XAUTHORITY', nil)
|
30
|
+
ENV['HOME'] = TBB_BROWSER_DIR # do we really want to do this?
|
31
|
+
ENV['FONTCONFIG_PATH'] = "#{TBB_BROWSER_DIR}/fontconfig" # these two stop font leaks [#1]
|
32
|
+
ENV['FONTCONFIG_FILE'] = 'fonts.conf'
|
33
|
+
ENV['GSETTINGS_BACKEND'] = 'memory'
|
34
|
+
FileUtils.rm_rf File.join TBB_DIR, *%w[TorBrowser Data fontconfig]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/tor/prefs.rb
ADDED
@@ -0,0 +1,17 @@
|
|
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
|
data/lib/tor/version.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/tor/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'selenium_tor'
|
7
|
+
spec.version = Selenium::WebDriver::Tor::VERSION
|
8
|
+
spec.authors = ['MatzFan']
|
9
|
+
spec.email = ['matzfan@mailinator.com']
|
10
|
+
|
11
|
+
spec.summary = 'Selenium extension for Tor Browser'
|
12
|
+
spec.description = 'Selenium extension for Tor Browser'
|
13
|
+
spec.homepage = 'https://gitlab.com/matzfan/selenium_tor'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = '>= 2.7.0'
|
16
|
+
|
17
|
+
# spec.metadata['allowed_push_host'] =
|
18
|
+
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = 'https://gitlab.com/matzfan/selenium_tor'
|
21
|
+
spec.metadata['changelog_uri'] = 'https://gitlab.com/matzfan/selenium_tor/CHANGELOG.md'
|
22
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
23
|
+
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
+
spec.files = Dir.chdir(__dir__) do
|
27
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
28
|
+
(File.expand_path(f) == __FILE__) ||
|
29
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
spec.bindir = 'exe'
|
33
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
34
|
+
spec.require_paths = ['lib']
|
35
|
+
end
|
data/sig/tor.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: selenium_tor
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- MatzFan
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-11-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Selenium extension for Tor Browser
|
14
|
+
email:
|
15
|
+
- matzfan@mailinator.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".rubocop.yml"
|
21
|
+
- ".ruby-version"
|
22
|
+
- CHANGELOG.md
|
23
|
+
- CODE_OF_CONDUCT.md
|
24
|
+
- Guardfile
|
25
|
+
- LICENSE.txt
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- lib/driver.rb
|
29
|
+
- lib/mixin.rb
|
30
|
+
- lib/options.rb
|
31
|
+
- lib/selenium_tor.rb
|
32
|
+
- lib/service.rb
|
33
|
+
- lib/tor/driver.rb
|
34
|
+
- lib/tor/driver_not_yet_connected_to_tor_network.rb
|
35
|
+
- lib/tor/options.rb
|
36
|
+
- lib/tor/prefs.rb
|
37
|
+
- lib/tor/version.rb
|
38
|
+
- selenium_tor.gemspec
|
39
|
+
- sig/tor.rbs
|
40
|
+
homepage: https://gitlab.com/matzfan/selenium_tor
|
41
|
+
licenses:
|
42
|
+
- MIT
|
43
|
+
metadata:
|
44
|
+
homepage_uri: https://gitlab.com/matzfan/selenium_tor
|
45
|
+
source_code_uri: https://gitlab.com/matzfan/selenium_tor
|
46
|
+
changelog_uri: https://gitlab.com/matzfan/selenium_tor/CHANGELOG.md
|
47
|
+
rubygems_mfa_required: 'true'
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.7.0
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
requirements: []
|
63
|
+
rubygems_version: 3.5.0.dev
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: Selenium extension for Tor Browser
|
67
|
+
test_files: []
|