diff --git a/nodecar/src/camoufox-worker.ts b/nodecar/src/camoufox-worker.ts index d7de5ea..eb723cf 100644 --- a/nodecar/src/camoufox-worker.ts +++ b/nodecar/src/camoufox-worker.ts @@ -158,6 +158,15 @@ export async function runCamoufoxWorker(id: string): Promise { env: finalEnv, }; + // If a custom executable path was provided, ensure Playwright uses it + if ( + (camoufoxOptions as any).executable_path && + typeof (camoufoxOptions as any).executable_path === "string" + ) { + finalOptions.executablePath = (camoufoxOptions as any) + .executable_path as string; + } + // Only add proxy if it exists and is valid if (camoufoxOptions.proxy) { try { diff --git a/nodecar/src/index.ts b/nodecar/src/index.ts index 0facc98..9f56422 100644 --- a/nodecar/src/index.ts +++ b/nodecar/src/index.ts @@ -243,6 +243,16 @@ program ",", ) as "UBO"[]; + // Executable path: forward through to camoufox-js and ultimately Playwright + if ( + options.executablePath && + typeof options.executablePath === "string" + ) { + // camoufox-js uses snake_case for this option + (camoufoxOptions as any).executable_path = + options.executablePath as string; + } + // Screen and window const screen: { minWidth?: number;