Class: Ronin::Web::CLI::JSShell Private
- Inherits:
-
Core::CLI::Shell
- Object
- Core::CLI::Shell
- Ronin::Web::CLI::JSShell
- Defined in:
- lib/ronin/web/cli/js_shell.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a JavaScript shell for a browser.
Instance Attribute Summary collapse
-
#browser ⇒ Ronin::Web::Browser::Agent
readonly
private
The parent browser.
Instance Method Summary collapse
-
#exec(js) ⇒ Object
private
Evaluates the JavaScript in the current browser page.
-
#initialize(browser, **kwargs) ⇒ JSShell
constructor
private
Initializes the JavaScript shell.
Constructor Details
#initialize(browser, **kwargs) ⇒ JSShell
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the JavaScript shell.
44 45 46 47 48 |
# File 'lib/ronin/web/cli/js_shell.rb', line 44 def initialize(browser,**kwargs) super(**kwargs) @browser = browser end |
Instance Attribute Details
#browser ⇒ Ronin::Web::Browser::Agent (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The parent browser.
36 37 38 |
# File 'lib/ronin/web/cli/js_shell.rb', line 36 def browser @browser end |
Instance Method Details
#exec(js) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Evaluates the JavaScript in the current browser page.
56 57 58 59 60 61 62 63 64 |
# File 'lib/ronin/web/cli/js_shell.rb', line 56 def exec(js) value = @browser.eval_js(js) unless value.nil? p value end rescue Ferrum::JavaScriptError => error puts error. end |