Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Chrome no longer supports old headless mode #189

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: chromote
Title: Headless Chrome Web Browser Interface
Version: 0.3.1
Version: 0.3.1.9000
Authors@R: c(
person("Winston", "Chang", , "[email protected]", role = c("aut", "cre")),
person("Barret", "Schloerke", , "[email protected]", role = "aut",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# chromote (development version)

* Chrome v132 and later no longer support [old headless mode](https://developer.chrome.com/blog/removing-headless-old-from-chrome). As such, `chromote` no longer defaults to using `--headless=old` and now uses `--headless` when running Chrome. You can still use the `chromote.headless` option or `CHROMOTE_HEADLESS` environment variable to configure the `--headless` flag if you're using an older version of Chrome. (#187)

# chromote 0.3.1

* Fixed a typo that caused `launch_chrome()` to throw an error. (#175)
Expand Down
18 changes: 7 additions & 11 deletions R/chrome.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,16 @@ chrome_headless_mode <- function() {
# and while more performant did not share the same browser implementation as
# headful Chrome. New headless mode will likely be useful to some, but in most
# chromote use cases -- printing to PDF and testing -- we are not ready to
# move to the new mode. We'll use `--headless=old` as the default for now
# until the new mode is more stable, or until we add support for downloading
# specific versions of Chrome. (See rstudio/chromote#171)
default_mode <- "old"
mode <- tolower(opt %||% env %||% default_mode)
# move to the new mode. Even once removed, the option may be useful if we
# add support downloading specific versions of Chrome. (See rstudio/chromote#171)
# 2025-01-16: Chrome v132 removed headless mode (rstudio/chromote#187)
mode <- opt %||% env

if (!mode %in% c("old", "new")) {
used <- if (!is.null(opt)) "chromote.headless" else "CHROMOTE_HEADLESS"
rlang::inform(
sprintf('Invalid value for `%s`. Using `"%s"`.', used, default_mode)
)
mode <- default_mode
if (is.null(mode)) {
return("--headless")
}

# Just pass headless along directly, Chrome will error if needed
sprintf("--headless=%s", mode)
}

Expand Down
Loading