Class: Arachni::OptionGroups::BrowserCluster
- Inherits:
-
Arachni::OptionGroup
- Object
- Arachni::OptionGroup
- Arachni::OptionGroups::BrowserCluster
- Defined in:
- lib/arachni/option_groups/browser_cluster.rb
Overview
Options for the BrowserCluster and its BrowserCluster::Workers.
Instance Attribute Summary collapse
-
#ignore_images ⇒ Bool
Should the browser's avoid loading images?.
-
#job_timeout ⇒ Integer
Maximum allowed time for jobs in seconds.
-
#local_storage ⇒ Hash
Data to be set in the browser's `localStorage`.
-
#pool_size ⇒ Integer
Amount of BrowserCluster::Worker to keep in the pool and put to work.
-
#screen_height ⇒ Bool
Screen height.
-
#screen_width ⇒ Bool
Screen width.
-
#session_storage ⇒ Hash
Data to be set in the browser's `sessionStorage`.
-
#wait_for_elements ⇒ Hash<Regexp,String>
When the page URL matched the key `Regexp`, wait until the `String` CSS selector in the value matches an element.
-
#wait_for_timers ⇒ Bool
Shall we wait for the max timer to fire on the page?.
-
#worker_time_to_live ⇒ Integer
Re-spawn the browser every #worker_time_to_live jobs.
Instance Method Summary collapse
Methods inherited from Arachni::OptionGroup
#==, attr_accessor, attributes, #attributes, defaults, #defaults, #hash, inherited, #initialize, #merge, set_defaults, #to_h, #to_hash, #update, #validate
Constructor Details
This class inherits a constructor from Arachni::OptionGroup
Instance Attribute Details
#ignore_images ⇒ Bool
Returns Should the browser's avoid loading images?.
43 44 45 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 43 def ignore_images @ignore_images end |
#job_timeout ⇒ Integer
Returns Maximum allowed time for jobs in seconds.
35 36 37 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 35 def job_timeout @job_timeout end |
#local_storage ⇒ Hash
Returns Data to be set in the browser's `localStorage`.
18 19 20 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 18 def local_storage @local_storage end |
#pool_size ⇒ Integer
Returns Amount of BrowserCluster::Worker to keep in the pool and put to work.
31 32 33 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 31 def pool_size @pool_size end |
#screen_height ⇒ Bool
Returns Screen height.
51 52 53 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 51 def screen_height @screen_height end |
#screen_width ⇒ Bool
Returns Screen width.
47 48 49 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 47 def screen_width @screen_width end |
#session_storage ⇒ Hash
Returns Data to be set in the browser's `sessionStorage`.
22 23 24 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 22 def session_storage @session_storage end |
#wait_for_elements ⇒ Hash<Regexp,String>
Returns When the page URL matched the key `Regexp`, wait until the `String` CSS selector in the value matches an element.
27 28 29 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 27 def wait_for_elements @wait_for_elements end |
#wait_for_timers ⇒ Bool
Returns Shall we wait for the max timer to fire on the page?.
55 56 57 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 55 def wait_for_timers @wait_for_timers end |
#worker_time_to_live ⇒ Integer
Returns Re-spawn the browser every #worker_time_to_live jobs.
39 40 41 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 39 def worker_time_to_live @worker_time_to_live end |
Instance Method Details
#css_to_wait_for(url) ⇒ Object
98 99 100 101 102 103 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 98 def css_to_wait_for( url ) wait_for_elements.map do |pattern, css| next if !(url =~ pattern) css end.compact end |
#to_rpc_data ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 117 def to_rpc_data d = super d['wait_for_elements'] = d['wait_for_elements'].dup d['wait_for_elements'].dup.each do |k, v| d['wait_for_elements'][k.source] = d['wait_for_elements'].delete(k) end d end |
#wait_for_timers? ⇒ Boolean
74 75 76 |
# File 'lib/arachni/option_groups/browser_cluster.rb', line 74 def wait_for_timers? !!@wait_for_timers end |