Class: Arachni::Page::Scope

Inherits:
HTTP::Response::Scope show all
Defined in:
lib/arachni/page/scope.rb

Overview

Determines the scope status of Arachni::Pages.

Author:

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

Methods inherited from HTTP::Response::Scope

#exclude_as_binary?, #exclude_content?

Methods inherited from URI::Scope

#auto_redundant?, #exclude?, #follow_protocol?, #in?, #in_domain?, #include?, #redundant?, #too_deep?

Methods inherited from Scope

#options

Constructor Details

#initialize(page) ⇒ Scope

Returns a new instance of Scope.



21
22
23
24
25
26
27
28
# File 'lib/arachni/page/scope.rb', line 21

def initialize( page )
    # We're passing the page itself instead of the Page#response because we
    # want it to use the (possibly browser-evaluated) Page#body for content
    # scope checks.
    super page

    @page = page
end

Instance Method Details

#dom_depth_limit_reached?Bool

Returns ‘true` if the DOM#depth is greater than OptionGroups::Scope#dom_depth_limit `false` otherwise.

Returns:

See Also:



46
47
48
# File 'lib/arachni/page/scope.rb', line 46

def dom_depth_limit_reached?
    options.dom_depth_limit && @page.dom.depth > options.dom_depth_limit
end

#out?Bool

Note:

Also takes into account the HTTP::Response::Scope of the Arachni::Page#response.

Returns ‘true` if the Arachni::Page is out of scope, `false`otherwise.

Returns:

See Also:



37
38
39
# File 'lib/arachni/page/scope.rb', line 37

def out?
    dom_depth_limit_reached? || super
end