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
477 478 479 |
# File 'lib/crawlberg/native.rb', line 477 def script @script end |
Class Method Details
.from_hash(hash) ⇒ Object
504 505 506 |
# File 'lib/crawlberg/native.rb', line 504 def self.from_hash(hash) new(script: hash[:script] || hash["script"]) end |
Instance Method Details
#click? ⇒ Boolean
486 |
# File 'lib/crawlberg/native.rb', line 486 def click? = false |
#execute_js? ⇒ Boolean
498 |
# File 'lib/crawlberg/native.rb', line 498 def execute_js? = true |
#press? ⇒ Boolean
490 |
# File 'lib/crawlberg/native.rb', line 490 def press? = false |
#scrape? ⇒ Boolean
500 501 502 |
# File 'lib/crawlberg/native.rb', line 500 def scrape? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#screenshot? ⇒ Boolean
496 |
# File 'lib/crawlberg/native.rb', line 496 def screenshot? = false |
#scroll? ⇒ Boolean
492 |
# File 'lib/crawlberg/native.rb', line 492 def scroll? = false |
#type_text? ⇒ Boolean
488 |
# File 'lib/crawlberg/native.rb', line 488 def type_text? = false |
#wait? ⇒ Boolean
494 |
# File 'lib/crawlberg/native.rb', line 494 def wait? = false |