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

Drop the --disable-gpu flag #141

Merged
merged 1 commit into from
Jan 30, 2024
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: 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
Loading