$new()
opens a new headless Chromium/Chrome. You can deactivate verbose
from chrome process launching byt setting option crrri.verbose
to FALSE.
$connect(callback = NULL)
connects the R session to the remote instance of
headless Chromium/Chrome. The returned value depends on the value of the
callback
argument. When callback
is a function, the returned value is a
connection object. When callback
is NULL
the returned value is a promise
which fulfills once R is connected to the remote instance of Chromium/Chrome.
Once fulfilled, the value of this promise is the connection object.
$listConnections()
returns a list of the connection objects succesfully
created using the $connect()
method.
$closeConnections(callback = NULL)
closes all the connections created using the
$connect()
method. If callback
is NULL
, it returns a promise which
fulfills when all the connections are closed: once fulfilled, its value is the
remote object.
If callback
is not NULL
, it returns the remote object. In this case,
callback
is called when all the connections are closed and the remote object is
passed to this function as the argument.
$version()
executes the DevTools Version
method. It returns a list of
informations available at http://localhost:<debug_port>/json/version
.
$user_agent
returns a character scalar with the User Agent of the
headless Chromium/Chrome.
$close(async = FALSE)
closes the remote instance of headless
Chromium/Chrome. If async
is FALSE
this method returns the remote
object invisibly. Is async
is TRUE
, a promise is returned. This promise
fulfills when Chromium/Chrome is closed. Once fulfilled, its value is the
remote
object.
$view()
opens a visible Chromium/Chrome browser at
http://localhost:<debug_port>
. This is useful to 'see' the headless
Chromium/Chrome instance. Returns the process of the visible browser.
$is_alive()
checks if the remote instance is alive. Returns a logical
scalar.
$listTargets()
returns a list with information about tabs.