Class: Arachni::OptionGroups::BrowserCluster

Inherits:
Arachni::OptionGroup show all
Defined in:
lib/arachni/option_groups/browser_cluster.rb

Overview

Options for the BrowserCluster and its BrowserCluster::Workers.

Author:

Instance Attribute Summary collapse

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_imagesBool

Returns Should the browser’s avoid loading images?.

Returns:

  • (Bool)

    Should the browser’s avoid loading images?



35
36
37
# File 'lib/arachni/option_groups/browser_cluster.rb', line 35

def ignore_images
  @ignore_images
end

#job_timeoutInteger

Returns Maximum allowed time for jobs in seconds.

Returns:

  • (Integer)

    Maximum allowed time for jobs in seconds.



27
28
29
# File 'lib/arachni/option_groups/browser_cluster.rb', line 27

def job_timeout
  @job_timeout
end

#pool_sizeInteger

Returns Amount of BrowserCluster::Worker to keep in the pool and put to work.

Returns:



23
24
25
# File 'lib/arachni/option_groups/browser_cluster.rb', line 23

def pool_size
  @pool_size
end

#screen_heightBool

Returns Screen height.

Returns:

  • (Bool)

    Screen height.



43
44
45
# File 'lib/arachni/option_groups/browser_cluster.rb', line 43

def screen_height
  @screen_height
end

#screen_widthBool

Returns Screen width.

Returns:

  • (Bool)

    Screen width.



39
40
41
# File 'lib/arachni/option_groups/browser_cluster.rb', line 39

def screen_width
  @screen_width
end

#wait_for_elementsHash<Regexp,String>

Returns When the page URL matched the key ‘Regexp`, wait until the `String` CSS selector in the value matches an element.

Returns:

  • (Hash<Regexp,String>)

    When the page URL matched the key ‘Regexp`, wait until the `String` CSS selector in the value matches an element.



19
20
21
# File 'lib/arachni/option_groups/browser_cluster.rb', line 19

def wait_for_elements
  @wait_for_elements
end

#worker_time_to_liveInteger

Returns Re-spawn the browser every #worker_time_to_live jobs.

Returns:



31
32
33
# File 'lib/arachni/option_groups/browser_cluster.rb', line 31

def worker_time_to_live
  @worker_time_to_live
end

Instance Method Details

#css_to_wait_for(url) ⇒ Object



55
56
57
58
59
60
# File 'lib/arachni/option_groups/browser_cluster.rb', line 55

def css_to_wait_for( url )
    wait_for_elements.map do |pattern, css|
        next if !(url =~ pattern)
        css
    end.compact
end

#to_rpc_dataObject



72
73
74
75
76
77
78
79
80
# File 'lib/arachni/option_groups/browser_cluster.rb', line 72

def to_rpc_data
    d = super

    %w(wait_for_elements).each do |k|
        d[k] = d[k].my_stringify
    end

    d
end