Class: WebkitRemote::Browser::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/webkit_remote/browser.rb

Overview

References a tab open in a Webkit process with a remote debugging server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser, debug_url, metadata) ⇒ Tab

Creates a tab reference.

Parameters:

  • browser (WebkitRemote::Browser)

    the master debugging connection to the Webkit process

  • debug_url (String)

    URL of the tab’s remote debugging endpoint

  • metadata (Hash)

    non-essential information about the tab

Options Hash (metadata):

  • title (String, nil)

    title of the page open in the browser tab

  • url (String, nil)

    URL of the page open in the browser tab



144
145
146
147
148
149
# File 'lib/webkit_remote/browser.rb', line 144

def initialize(browser, debug_url, )
  @browser = browser
  @debug_url = debug_url
  @title = [:title]
  @url = [:url]
end

Instance Attribute Details

#browserWebkit::Remote (readonly)

Returns connection to the browser that this tab belongs to.

Returns:

  • (Webkit::Remote)

    connection to the browser that this tab belongs to



124
125
126
# File 'lib/webkit_remote/browser.rb', line 124

def browser
  @browser
end

#debug_urlString (readonly)

Returns URL of the tab’s remote debugging endpoint.

Returns:

  • (String)

    URL of the tab’s remote debugging endpoint



127
128
129
# File 'lib/webkit_remote/browser.rb', line 127

def debug_url
  @debug_url
end

#titleString? (readonly)

Returns title of the Web page open in the browser tab.

Returns:

  • (String, nil)

    title of the Web page open in the browser tab



130
131
132
# File 'lib/webkit_remote/browser.rb', line 130

def title
  @title
end

#urlString? (readonly)

Returns URL of the Web page open in the browser tab.

Returns:

  • (String, nil)

    URL of the Web page open in the browser tab



133
134
135
# File 'lib/webkit_remote/browser.rb', line 133

def url
  @url
end