Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Oct 24, 2024

New headless mode in chrome

Chrome has new headless mode (https://developer.chrome.com/docs/chromium/headless) activated as default since v128. This PR set back to --headless=old to revert back to old mode we know is working ok. There is a new QUARTO_CHROMIUM_HEADLESS_MODE env var to configure this. This is to fix #11135.

Tested with

---
title: "Test"
format: typst
---


```{mermaid}
flowchart LR
  A[Hard edge] --> B(Round edge)
  B --> C{Decision}
  C --> D[Result one]
  C --> E[Result two]
```

This now renders ok under this PR.

If QUARTO_CHROMIUM_HEADLESS_MODE=new is set and a chrome browser is already opened. Then #11135 will reproduce. close any browser open and keep QUARTO_CHROMIUM_HEADLESS_MODE=new, and issue disappear. So definitely some adaptations to make for new headless mode. As long as we can use, old then we can wait.

Avoid blocking problem by allowing selecting the chromium binary to use

This PR introduce also a new QUARTO_CHROMIUM to specify which binary to use and not let Quarto detection applies. closes #10170 (which closes #2980 and closes #4648)

Currently I am testing our bundled quarto install chromium version to see if this still work and if it is ok with this change. This is quite an old pinned version.

Also, I noticed on windows that chrome opened for screenshot does not close... So investigating that too.

cderv added 6 commits October 23, 2024 17:21
Chrome v128 changed the default from --headless=old to --headless=new
in 2024-08. Old headless mode was effectively a separate browser render,
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 Quarto use cases
like printing to PDF or screenshoting, we need more work 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 really pin a version as default to be used.
This is also impacting in chromote and pagedown R packages and we could keep syncing with them.
[skip ci]
@cderv cderv marked this pull request as ready for review October 24, 2024 15:42
@cderv cderv merged commit eb72841 into main Oct 24, 2024
47 checks passed
@cderv cderv deleted the fix/chrome branch October 24, 2024 18:32
@mcanouil
Copy link
Collaborator

It appears the new QUARTO_CHROMIUM does not work inside _environment file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment