Base class for browsers like Chrome, Chromium, etc. Defines the interface
used by various browser implementations. It can represent a local browser
process or one running remotely.
Details
The initialize()
method of an implementation should set private$host
and private$port
. If the process is local, the initialize()
method
should also set private$process
.
Methods
Method is_local()
Is local browser?
Returns TRUE if the browser is running locally, FALSE if it's remote.
Method get_process()
Browser process
Method is_alive()
Is the process alive?
Method get_host()
Browser Host
Method get_port()
Browser port
Close the browser
Usage
Browser$close(wait = FALSE)
Arguments
wait
If an integer, waits a number of seconds for the process to
exit, killing the process if it takes longer than wait
seconds to
close. Use wait = TRUE
to wait for 10 seconds.
Method clone()
The objects of this class are cloneable with this method.
Usage
Browser$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.