Sha256: 0afc2d6d7074343ffe715444e888c6e3d83b31988c8f739252ee9531982ca7ae

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

=begin
    Copyright 2010-2017 Sarosys LLC <http://www.sarosys.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

module Arachni::Element
class Link
module Capabilities

# Extends {Arachni::Element::Capabilities::WithDOM} with {Link}-specific
# functionality.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
module WithDOM
    include Arachni::Element::Capabilities::WithDOM

    # @return   [DOM]
    def dom
        return @dom if @dom
        return if !dom_data

        super
    end

    private

    def dom_data
        return if !@source
        return @dom_data if @dom_data
        return if @dom_data == false

        # Don't bother parsing the source if it doesn't have anything interesting.
        if !(@source =~ /href=['"]?.*#.*?>/mi)
            return @dom_data = false
        end

        return if !node

        @dom_data ||= (self.class::DOM.data_from_node( node ) || false)
    end

end

end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arachni-1.5.1 lib/arachni/element/link/capabilities/with_dom.rb
arachni-1.5 lib/arachni/element/link/capabilities/with_dom.rb