Skip to content

Commit

Permalink
Revert "Drop the --disable-gpu flag (#141)"
Browse files Browse the repository at this point in the history
This reverts commit e0e7cf9.
  • Loading branch information
hadley committed Feb 2, 2024
1 parent bbc13af commit 32c0592
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 0 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

* Breaking change: `Chromote$is_active()` method now reports if there is an active connection to the underlying chrome instance, rather than whether or not that instance is alive (#94).

* `--disable-gpu` is no longer included in the default Chrome arguments.

* `ChromoteSession` now records the `targetId`. This eliminates one round-trip to the browser when viewing or closing a session. You can now call the `$respawn()` method if a session terminates and you want to reconnect to the same target (#94).

* `ChromoteSession$screenshot()` gains an `options` argument that accepts a list of additional options to be passed to the Chrome Devtools Protocol's [`Page.captureScreenshot` method](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot). (#129)
Expand Down
7 changes: 6 additions & 1 deletion R/chromote.R
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ is_missing_linux_user <- cache_value(function() {
#' Default chromote arguments are composed of the following values (when
#' appropriate):
#'
#' * [`"--disable-gpu"`](https://peter.sh/experiments/chromium-command-line-switches/#disable-gpu)
#' * \verb{Disables GPU hardware acceleration. If software renderer is not in place, then the GPU process won't launch.}
#' * [`"--no-sandbox"`](https://peter.sh/experiments/chromium-command-line-switches/#no-sandbox)
#' * Only added when `CI` system environment variable is set, when the
#' user on a Linux system is not set, or when executing inside a Docker container.
Expand All @@ -625,6 +627,9 @@ is_missing_linux_user <- cache_value(function() {
#' @export
default_chrome_args <- function() {
c(
# Better cross platform support
"--disable-gpu",

# > Note: --no-sandbox is not needed if you properly setup a user in the container.
# https://developers.google.com/web/updates/2017/04/headless-chrome
if (is_inside_ci() || is_missing_linux_user() || is_inside_docker()) {
Expand Down Expand Up @@ -676,7 +681,7 @@ reset_chrome_args <- function() {
#' @examples
#' old_chrome_args <- get_chrome_args()
#'
#' # Disable the gpu and use `/dev/shm`
#' # Only disable the gpu and using `/dev/shm`
#' set_chrome_args(c("--disable-gpu", "--disable-dev-shm-usage"))
#'
#' #... Make new `Chrome` or `ChromoteSession` instance
Expand Down
6 changes: 5 additions & 1 deletion man/default_chrome_args.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-default_chromote_args.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

min_chrome_arg_length <- if (is_inside_ci()) 4 else 3
min_chrome_arg_length <- if (is_inside_ci()) 5 else 4

test_that("default args are retrieved", {
expect_gte(length(default_chrome_args()), min_chrome_arg_length)
Expand Down

0 comments on commit 32c0592

Please sign in to comment.