with_chrome_version {chromote} | R Documentation |
Use a specific version of Chrome or related binaries
Description
This function downloads and sets up a specific version of Chrome, using the
Google Chrome for Testing builds
for chrome
, chrome-headless-shell
or chromedriver
for use with
chromote.
Managed Chrome installations is an experimental feature introduced in chromote v0.5.0 and was inspired by similar features in playwright.
Usage
with_chrome_version(
version = "latest-stable",
code,
...,
binary = c("chrome", "chrome-headless-shell", "chromedriver"),
platform = NULL,
quiet = TRUE
)
local_chrome_version(
version = "latest-stable",
binary = c("chrome", "chrome-headless-shell", "chromedriver"),
platform = NULL,
...,
quiet = FALSE,
.local_envir = parent.frame()
)
local_chromote_chrome(path, ..., .local_envir = parent.frame())
with_chromote_chrome(path, code, ...)
Arguments
version |
A character string specifying the version to use. The default
value is If you specify a partial version, e.g.
Chromote also supports |
code |
|
... |
Ignored, used to require named arguments and for future feature expansion. |
binary |
A character string specifying which binary to
use. Must be one of |
platform |
A character string specifying the platform. If |
quiet |
Whether to print a message indicating which version and binary
of Chrome is being used. By default, this message is suppressed for
|
.local_envir |
|
path |
A direct path to the Chrome (or Chrome-based) binary. See
|
Details
This function downloads the specified binary, if not already
available and configures find_chrome()
to use the specified binary while
evaluating code
or within the local scope. It uses the
"known-good-versions" list from the Google Chrome for Testing versions at
https://googlechromelabs.github.io/chrome-for-testing/.
Value
Temporarily sets the CHROMOTE_CHROME
environment variable and
returns the result of the code
argument.
Functions
-
with_chrome_version()
: Temporarily use a specific version of Chrome during the evaluation ofcode
. -
local_chrome_version()
: Use a specific version of Chrome within the current scope. -
local_chromote_chrome()
: Use a specific Chrome, by path, within the current scope. -
with_chromote_chrome()
: Temporarily use a specific Chrome version, by path, for the evaluation ofcode
.
Examples
# Use the latest version of Chrome
local_chrome_version()
# Use a specific version of chrome-headless-shell
local_chrome_version("114.0.5735.90", binary = "chrome-headless-shell")