Module: WebkitRemote
- Defined in:
- lib/webkit_remote/top_level.rb,
lib/webkit_remote.rb,
lib/webkit_remote/rpc.rb,
lib/webkit_remote/event.rb,
lib/webkit_remote/client.rb,
lib/webkit_remote/browser.rb,
lib/webkit_remote/process.rb,
lib/webkit_remote/client/dom.rb,
lib/webkit_remote/client/page.rb,
lib/webkit_remote/client/input.rb,
lib/webkit_remote/client/console.rb,
lib/webkit_remote/client/network.rb,
lib/webkit_remote/client/runtime.rb,
lib/webkit_remote/client/dom_events.rb,
lib/webkit_remote/client/dom_runtime.rb,
lib/webkit_remote/client/page_events.rb,
lib/webkit_remote/client/console_events.rb,
lib/webkit_remote/client/network_events.rb
Overview
Top-level namespace.
Defined Under Namespace
Classes: Browser, Client, Event, Process, Rpc
Class Method Summary collapse
-
.local(opts = {}) ⇒ WebkitRemote::Client
Launches a WebKit process locally, and sets up a debugger client for it.
-
.remote(opts = {}) ⇒ WebkitRemote::Client
Connects to a Webkit process, and sets up a debugger client for it.
Class Method Details
.local(opts = {}) ⇒ WebkitRemote::Client
Launches a WebKit process locally, and sets up a debugger client for it.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/webkit_remote/top_level.rb', line 10 def self.local(opts = {}) # Use headless if no desktop is available. if !opts.has_key?(:headless) && (!ENV['DISPLAY'] || ENV['DISPLAY'].empty?) opts = { headless: true }.merge! opts end process = WebkitRemote::Process.new opts browser = process.start browser.stop_process = true client = WebkitRemote::Client.new tab: browser.tabs.first, close_browser: true client end |
.remote(opts = {}) ⇒ WebkitRemote::Client
Connects to a Webkit process, and sets up a debugger client for it.
30 31 32 33 34 35 36 |
# File 'lib/webkit_remote/top_level.rb', line 30 def self.remote(opts = {}) browser = WebkitRemote::Browser.new opts # NOTE: connecting to the last tab to avoid internal tabs and whatnot client = WebkitRemote::Client.new tab: browser.tabs.last, close_browser: true client end |