refactor: pass custom executable path

This commit is contained in:
zhom
2025-08-11 12:02:52 +04:00
parent 140621dcbe
commit ac878aed48
2 changed files with 19 additions and 0 deletions
+9
View File
@@ -158,6 +158,15 @@ export async function runCamoufoxWorker(id: string): Promise<void> {
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 {
+10
View File
@@ -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;