Class: Unmagic::Browser::Driver::Remote
- Defined in:
- lib/unmagic/browser/driver/remote.rb
Overview
A browser you already run somewhere else — browserless, a pool of your
own, a Chrome started with --remote-debugging-port.
Constant Summary
Constants inherited from Base
Base::DEFAULT_TIMEOUT, Base::WAIT_UNTIL
Instance Attribute Summary collapse
-
#ws ⇒ String
readonly
The websocket endpoint this driver connects to.
Instance Method Summary collapse
-
#initialize(ws: nil) ⇒ Remote
constructor
A new instance of Remote.
Methods inherited from Base
#close, #html, #markdown, #name, #open_connection, #pdf, #screenshot
Constructor Details
#initialize(ws: nil) ⇒ Remote
Returns a new instance of Remote.
18 19 20 21 22 23 24 25 |
# File 'lib/unmagic/browser/driver/remote.rb', line 18 def initialize(ws: nil) super() @ws = ws || ENV["BROWSER_WS_ENDPOINT"] return if @ws raise Error::Misconfigured, "The remote driver needs a websocket endpoint: Remote.new(ws: \"ws://...\") or $BROWSER_WS_ENDPOINT." end |
Instance Attribute Details
#ws ⇒ String (readonly)
Returns the websocket endpoint this driver connects to.
15 16 17 |
# File 'lib/unmagic/browser/driver/remote.rb', line 15 def ws @ws end |