Class: Crawlberg::PageActionExecuteJs
- Inherits:
-
Data
- Object
- Data
- Crawlberg::PageActionExecuteJs
- Extended by:
- T::Sig
- Includes:
- PageAction
- Defined in:
- lib/crawlberg/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
504 505 506 |
# File 'lib/crawlberg/native.rb', line 504 def script @script end |
Class Method Details
.from_hash(hash) ⇒ Object
531 532 533 |
# File 'lib/crawlberg/native.rb', line 531 def self.from_hash(hash) new(script: hash[:script] || hash["script"]) end |
Instance Method Details
#click? ⇒ Boolean
513 |
# File 'lib/crawlberg/native.rb', line 513 def click? = false |
#execute_js? ⇒ Boolean
525 |
# File 'lib/crawlberg/native.rb', line 525 def execute_js? = true |
#press? ⇒ Boolean
517 |
# File 'lib/crawlberg/native.rb', line 517 def press? = false |
#scrape? ⇒ Boolean
527 528 529 |
# File 'lib/crawlberg/native.rb', line 527 def scrape? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#screenshot? ⇒ Boolean
523 |
# File 'lib/crawlberg/native.rb', line 523 def screenshot? = false |
#scroll? ⇒ Boolean
519 |
# File 'lib/crawlberg/native.rb', line 519 def scroll? = false |
#type_text? ⇒ Boolean
515 |
# File 'lib/crawlberg/native.rb', line 515 def type_text? = false |
#wait? ⇒ Boolean
521 |
# File 'lib/crawlberg/native.rb', line 521 def wait? = false |