Class: Arachni::BrowserCluster::Jobs::ResourceExploration::EventTrigger

Inherits:
Arachni::BrowserCluster::Jobs::ResourceExploration show all
Defined in:
lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb,
lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger/result.rb

Overview

Loads a #resource and triggers the specified #event on the given element.

Direct Known Subclasses

TaintTrace::EventTrigger

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Attributes inherited from Arachni::BrowserCluster::Jobs::ResourceExploration

#resource

Attributes inherited from Arachni::BrowserCluster::Job

#browser, #forwarder

Instance Method Summary collapse

Methods inherited from Arachni::BrowserCluster::Jobs::ResourceExploration

#clean_copy, #dup, #initialize

Methods inherited from Arachni::BrowserCluster::Job

#==, #clean_copy, #configure_and_run, #dup, #forward, #forward_as, #hash, #id, #initialize, #never_ending=, #never_ending?, #save_result

Constructor Details

This class inherits a constructor from Arachni::BrowserCluster::Jobs::ResourceExploration

Instance Attribute Details

#elementBrowser::ElementLocator



27
28
29
# File 'lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb', line 27

def element
  @element
end

#eventSymbol

Returns Event to trigger on the given element.

Returns:

  • (Symbol)

    Event to trigger on the given element.



24
25
26
# File 'lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb', line 24

def event
  @event
end

Instance Method Details

#runObject



31
32
33
34
35
36
# File 'lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb', line 31

def run
    browser.on_new_page { |page| save_result( page: page ) }

    browser.load resource
    browser.trigger_event( resource, element, event )
end

#to_sObject



38
39
40
41
# File 'lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb', line 38

def to_s
    "#<#{self.class}:#{object_id} @resource=#{@resource} " +
        "@event=#{@event.inspect} @element=#{@element.inspect}>"
end