Class: Kreuzcrawl::PageActionExecuteJs

Inherits:
Data
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scriptObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



537
538
539
# File 'lib/kreuzcrawl/native.rb', line 537

def script
  @script
end

Class Method Details

.from_hash(hash) ⇒ Object



572
573
574
# File 'lib/kreuzcrawl/native.rb', line 572

def self.from_hash(hash)
  new(script: hash[:script] || hash["script"])
end

Instance Method Details

#click?Boolean

Returns:

  • (Boolean)


546
# File 'lib/kreuzcrawl/native.rb', line 546

def click? = false

#execute_js?Boolean

Returns:

  • (Boolean)


564
# File 'lib/kreuzcrawl/native.rb', line 564

def execute_js? = true

#press?Boolean

Returns:

  • (Boolean)


552
# File 'lib/kreuzcrawl/native.rb', line 552

def press? = false

#scrape?Boolean

Returns:

  • (Boolean)


567
# File 'lib/kreuzcrawl/native.rb', line 567

def scrape? = false

#screenshot?Boolean

Returns:

  • (Boolean)


561
# File 'lib/kreuzcrawl/native.rb', line 561

def screenshot? = false

#scroll?Boolean

Returns:

  • (Boolean)


555
# File 'lib/kreuzcrawl/native.rb', line 555

def scroll? = false

#type_text?Boolean

Returns:

  • (Boolean)


549
# File 'lib/kreuzcrawl/native.rb', line 549

def type_text? = false

#wait?Boolean

Returns:

  • (Boolean)


558
# File 'lib/kreuzcrawl/native.rb', line 558

def wait? = false