Class: Kreuzcrawl::PageActionExecuteJs
- Inherits:
-
Data
- Object
- Data
- Kreuzcrawl::PageActionExecuteJs
- Extended by:
- T::Sig
- Includes:
- PageAction
- Defined in:
- lib/kreuzcrawl/native.rb
Overview
Execute arbitrary JavaScript in the page context.
# Safety
The script runs with full page privileges in the browser context. Only execute scripts from trusted sources.
Instance Attribute Summary collapse
-
#script ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
Class Method Summary collapse
Instance Method Summary collapse
- #click? ⇒ Boolean
- #execute_js? ⇒ Boolean
- #press? ⇒ Boolean
- #scrape? ⇒ Boolean
- #screenshot? ⇒ Boolean
- #scroll? ⇒ Boolean
- #type_text? ⇒ Boolean
- #wait? ⇒ Boolean
Instance Attribute Details
#script ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
436 437 438 |
# File 'lib/kreuzcrawl/native.rb', line 436 def script @script end |
Class Method Details
.from_hash(hash) ⇒ Object
462 463 464 |
# File 'lib/kreuzcrawl/native.rb', line 462 def self.from_hash(hash) new(script: hash[:script] || hash["script"]) end |
Instance Method Details
#click? ⇒ Boolean
444 |
# File 'lib/kreuzcrawl/native.rb', line 444 def click? = false |
#execute_js? ⇒ Boolean
456 |
# File 'lib/kreuzcrawl/native.rb', line 456 def execute_js? = true |
#press? ⇒ Boolean
448 |
# File 'lib/kreuzcrawl/native.rb', line 448 def press? = false |
#scrape? ⇒ Boolean
458 459 460 |
# File 'lib/kreuzcrawl/native.rb', line 458 def scrape? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#screenshot? ⇒ Boolean
454 |
# File 'lib/kreuzcrawl/native.rb', line 454 def screenshot? = false |
#scroll? ⇒ Boolean
450 |
# File 'lib/kreuzcrawl/native.rb', line 450 def scroll? = false |
#type_text? ⇒ Boolean
446 |
# File 'lib/kreuzcrawl/native.rb', line 446 def type_text? = false |
#wait? ⇒ Boolean
452 |
# File 'lib/kreuzcrawl/native.rb', line 452 def wait? = false |