Skip to content

Commit

Permalink
Drop the --disable-gpu flag (#141)
Browse files Browse the repository at this point in the history
It is no longer needed as the underlying bugs have been fixed in chromium (for multiple years). This flag was dropped in puppeteer in puppeteer/puppeteer#2908 and puppeteer/puppeteer#4523.
  • Loading branch information
hadley committed Jan 30, 2024
1 parent 2592a5b commit e0e7cf9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# chromote (development version)

* `--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, and will make it possible to re-start a closed session (#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: 1 addition & 6 deletions R/chromote.R
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,6 @@ 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 @@ -584,9 +582,6 @@ 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 @@ -638,7 +633,7 @@ reset_chrome_args <- function() {
#' @examples
#' old_chrome_args <- get_chrome_args()
#'
#' # Only disable the gpu and using `/dev/shm`
#' # Disable the gpu and use `/dev/shm`
#' set_chrome_args(c("--disable-gpu", "--disable-dev-shm-usage"))
#'
#' #... Make new `Chrome` or `ChromoteSession` instance
Expand Down
6 changes: 1 addition & 5 deletions 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()) 5 else 4
min_chrome_arg_length <- if (is_inside_ci()) 4 else 3

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

0 comments on commit e0e7cf9

Please sign in to comment.