Class: Puppeteer::WorkerWorld

Inherits:
Object
  • Object
show all
Defined in:
lib/puppeteer/web_worker.rb

Overview

rbs_inline: enabled

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ WorkerWorld

Returns a new instance of WorkerWorld.



8
9
10
11
# File 'lib/puppeteer/web_worker.rb', line 8

def initialize(client)
  @client = client
  @context_promise = Async::Promise.new
end

Instance Method Details

#disposeObject



48
49
50
# File 'lib/puppeteer/web_worker.rb', line 48

def dispose
  @context_promise = Async::Promise.new
end

#evaluate(page_function, *args) ⇒ Object



27
28
29
# File 'lib/puppeteer/web_worker.rb', line 27

def evaluate(page_function, *args)
  execution_context.evaluate(page_function, *args)
end

#evaluate_handle(page_function, *args) ⇒ Object



36
37
38
# File 'lib/puppeteer/web_worker.rb', line 36

def evaluate_handle(page_function, *args)
  execution_context.evaluate_handle(page_function, *args)
end

#execution_contextObject



20
21
22
# File 'lib/puppeteer/web_worker.rb', line 20

def execution_context
  @context_promise.wait
end

#frameObject



43
44
45
# File 'lib/puppeteer/web_worker.rb', line 43

def frame
  nil
end

#set_context(context) ⇒ Object



15
16
17
# File 'lib/puppeteer/web_worker.rb', line 15

def set_context(context)
  @context_promise.resolve(context) unless @context_promise.resolved?
end