Module: Arachni::Framework::Parts::Browser
- Included in:
- Arachni::Framework
- Defined in:
- lib/arachni/framework/parts/browser.rb
Overview
Provides access to the BrowserCluster and relevant helpers.
Instance Method Summary collapse
-
#browser_cluster ⇒ BrowserCluster?
A lazy-loaded browser cluster or ‘nil` if OptionGroups::BrowserCluster#pool_size or OptionGroups::Scope#dom_depth_limit are 0 or not #host_has_browser?.
- #browser_job_skip_states ⇒ Object
-
#host_has_browser? ⇒ Bool
‘true` if the environment has a browser, `false` otherwise.
- #wait_for_browser? ⇒ Boolean
Instance Method Details
#browser_cluster ⇒ BrowserCluster?
Returns A lazy-loaded browser cluster or ‘nil` if OptionGroups::BrowserCluster#pool_size or OptionGroups::Scope#dom_depth_limit are 0 or not #host_has_browser?.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/arachni/framework/parts/browser.rb', line 23 def browser_cluster return if .browser_cluster.pool_size == 0 || Options.scope.dom_depth_limit == 0 || !host_has_browser? # Initialization may take a while so since we lazy load this make sure # that only one thread gets to this code at a time. synchronize do if !@browser_cluster state. :browser_cluster_startup end @browser_cluster ||= BrowserCluster.new state. @browser_cluster end end |
#browser_job_skip_states ⇒ Object
50 51 52 53 |
# File 'lib/arachni/framework/parts/browser.rb', line 50 def browser_job_skip_states return if !@browser_cluster browser_cluster.skip_states( browser_job.id ) end |
#host_has_browser? ⇒ Bool
Returns ‘true` if the environment has a browser, `false` otherwise.
42 43 44 |
# File 'lib/arachni/framework/parts/browser.rb', line 42 def host_has_browser? Arachni::Browser.has_executable? end |
#wait_for_browser? ⇒ Boolean
46 47 48 |
# File 'lib/arachni/framework/parts/browser.rb', line 46 def wait_for_browser? @browser_cluster && !browser_cluster.done? end |