Module: Arachni::Element::DOM::Capabilities::Submittable
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
#action, #action=, #dup, #http, #http_request, #id, #initialize, #method, #method=, #platforms, #to_h
Class Method Details
.prepare_browser(browser, options) ⇒ Object
50
51
52
53
54
|
# File 'lib/arachni/element/dom/capabilities/submittable.rb', line 50
def self.prepare_browser( browser, options )
browser.javascript.custom_code = options[:custom_code]
browser.javascript.taint = options[:taint]
browser.load options[:page]
end
|
.prepare_callback(&block) ⇒ Object
.submit_with_browser(browser, options, &cb) ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/arachni/element/dom/capabilities/submittable.rb', line 56
def self.submit_with_browser( browser, options, &cb )
element = options[:element]
element.browser = browser
element.auditor = options[:auditor]
element.page = options[:page]
if (transitions = element.trigger.compact).any?
page = browser.to_page
page.dom.transitions += transitions
page.request.performer = element
cb.call( page ) if block_given?
return page
end
nil
end
|
Instance Method Details
#submit(options = {}, method = nil, &block) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/arachni/element/dom/capabilities/submittable.rb', line 17
def submit( options = {}, method = nil, &block )
auditor = @auditor
@auditor = nil
options = options.merge(
element: self,
auditor: auditor.class,
page: page
)
if method
auditor.with_browser( options, method )
else
auditor.with_browser( options, &Submittable.prepare_callback( &block ) )
end
nil
end
|