class Arachni::BrowserCluster::Jobs::DOMExploration

Loads a {#resource} and {Browser#trigger_events explores} its DOM.

@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Attributes

resource[RW]

@return [Page::DOM, Page, String, HTTP::Response]

Resource to explore, if given a `String` it will be treated it as a URL
and will be loaded.

Public Class Methods

new( options ) click to toggle source
Calls superclass method Arachni::BrowserCluster::Job::new
# File lib/arachni/browser_cluster/jobs/dom_exploration.rb, line 26
def initialize( options )
    self.resource = options.delete(:resource)
    super options
end

Public Instance Methods

clean_copy() click to toggle source
Calls superclass method Arachni::BrowserCluster::Job#clean_copy
# File lib/arachni/browser_cluster/jobs/dom_exploration.rb, line 55
def clean_copy
    super.tap { |j| j.resource = nil }
end
dup() click to toggle source
Calls superclass method Arachni::BrowserCluster::Job#dup
# File lib/arachni/browser_cluster/jobs/dom_exploration.rb, line 51
def dup
    super.tap { |j| j.resource = resource }
end
inspect()
Alias for: to_s
resource=( r ) click to toggle source
# File lib/arachni/browser_cluster/jobs/dom_exploration.rb, line 39
def resource=( r )
    # Pages are heavy objects, better just keep the DOM since the browsers
    # will only load them by it anyways.
    if r.is_a? Page
        @resource = r.dom
        @resource.page = nil
        return r
    end

    @resource = r
end
run() click to toggle source

Loads a {#resource} and {Browser#trigger_events explores} its DOM.

# File lib/arachni/browser_cluster/jobs/dom_exploration.rb, line 32
def run
    browser.on_new_page { |page| save_result( page: page ) }

    browser.load resource
    browser.trigger_events
end
to_s() click to toggle source
# File lib/arachni/browser_cluster/jobs/dom_exploration.rb, line 59
def to_s
    "#<#{self.class}:#{object_id} @resource=#{@resource} " <<
        "time=#{@time} timed_out=#{timed_out?}>"
end
Also aliased as: inspect