File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { findOpenPort } from "../port.ts";
1414import { getNamedLifetime , ObjectWithLifetime } from "../lifetimes.ts" ;
1515import { sleep } from "../async.ts" ;
1616import { InternalError } from "../lib/error.ts" ;
17+ import { getenv } from "../env.ts" ;
1718import { kRenderFileLifetime } from "../../config/constants.ts" ;
1819
1920async function waitForServer ( port : number , timeout = 3000 ) {
@@ -78,6 +79,9 @@ export async function criClient(appPath?: string, port?: number) {
7879 }
7980 const app : string = appPath || await getBrowserExecutablePath ( ) ;
8081
82+ // Allow to adapt the headless mode depending on the Chrome version
83+ const headlessMode = getenv ( "QUARTO_CHROME_HEADLESS_MODE" , "old" ) ;
84+
8185 const cmd = [
8286 app ,
8387 // TODO: Chrome v128 changed the default from --headless=old to --headless=new
@@ -88,7 +92,7 @@ export async function criClient(appPath?: string, port?: number) {
8892 // move to the new mode. We'll use `--headless=old` as the default for now
8993 // until the new mode is more stable, or until we really pin a version as default to be used.
9094 // This is also impacting in chromote and pagedown R packages and we could keep syncing with them.
91- " --headless=old" ,
95+ ` --headless${ headlessMode ? "=" + headlessMode : "" } ` ,
9296 "--no-sandbox" ,
9397 "--disable-gpu" ,
9498 "--renderer-process-limit=1" ,
You can’t perform that action at this time.
0 commit comments