Module: WebkitRemote::Client::Page

Included in:
WebkitRemote::Client
Defined in:
lib/webkit_remote/client/page.rb

Overview

API for the Page domain.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#page_eventsBoolean

Returns true if the debugger generates Page.* events.

Returns:

  • (Boolean)

    true if the debugger generates Page.* events



46
47
48
# File 'lib/webkit_remote/client/page.rb', line 46

def page_events
  @page_events
end

Instance Method Details

#initialize_pageObject



49
50
51
# File 'lib/webkit_remote/client/page.rb', line 49

def initialize_page
  @page_events = false
end

Loads a new URL into the tab under debugging.

Parameters:

  • url (String)

    the URL to be loaded into the tab

Returns:



11
12
13
14
# File 'lib/webkit_remote/client/page.rb', line 11

def navigate_to(url)
  @rpc.call 'Page.navigate', url: url
  self
end

#refresh(opts = {}) ⇒ WebkitRemote::Client

Reloads

Parameters:

  • opts (Hash) (defaults to: {})

    quirky behavior bits

Options Hash (opts):

  • skip_cache (Boolean)

    if true, the cache is not used; this is what happens when the user presses Shift+refresh

  • onload (String)

    a JavaScript that will be injected in all the page’s frames after reloading

Returns:



24
25
26
27
28
29
30
# File 'lib/webkit_remote/client/page.rb', line 24

def refresh(opts = {})
  options = {}
  options[:ignoreCache] = true if opts[:skip_cache]
  options[:scriptToEvaluateOnLoad] = opts[:onload] if opts[:onload]
  @rpc.call 'Page.refresh', options
  self
end