Class: Arachni::BrowserCluster::Jobs::DOMExploration::EventTrigger
- Inherits:
-
Arachni::BrowserCluster::Jobs::DOMExploration
- Object
- Arachni::BrowserCluster::Job
- Arachni::BrowserCluster::Jobs::DOMExploration
- Arachni::BrowserCluster::Jobs::DOMExploration::EventTrigger
- Defined in:
- lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.rb,
lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger/result.rb
Overview
Direct Known Subclasses
Defined Under Namespace
Classes: Result
Instance Attribute Summary collapse
- #element ⇒ Browser::ElementLocator
-
#event ⇒ Symbol
Event to trigger on the given element.
Attributes inherited from Arachni::BrowserCluster::Jobs::DOMExploration
Attributes inherited from Arachni::BrowserCluster::Job
#args, #browser, #forwarder, #time
Instance Method Summary collapse
Methods inherited from Arachni::BrowserCluster::Jobs::DOMExploration
#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, #timed_out!, #timed_out?
Constructor Details
This class inherits a constructor from Arachni::BrowserCluster::Jobs::DOMExploration
Instance Attribute Details
#element ⇒ Browser::ElementLocator
27 28 29 |
# File 'lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.rb', line 27 def element @element end |
#event ⇒ Symbol
Returns Event to trigger on the given element.
24 25 26 |
# File 'lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.rb', line 24 def event @event end |
Instance Method Details
#run ⇒ Object
Loads a Arachni::BrowserCluster::Jobs::DOMExploration#resource and triggers the specified #event on the given element.
31 32 33 34 35 36 37 38 39 |
# File 'lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.rb', line 31 def run browser.on_new_page { |page| save_result( page: page ) } browser.load resource # We're disabling page restoration for the trigger as this is an one-time # job situation, the browser's state is going to be discarded at the end. browser.trigger_event( resource, element, event, false ) end |
#to_s ⇒ Object
41 42 43 44 45 |
# File 'lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.rb', line 41 def to_s "#<#{self.class}:#{object_id} @resource=#{@resource} " + "@event=#{@event.inspect} @element=#{@element.inspect} " << "time=#{@time} timed_out=#{timed_out?}>" end |