refactor: ensure that camoufox profile always launch with persistent state

This commit is contained in:
zhom
2025-08-07 02:25:06 +04:00
parent aabae8d3d4
commit a507a3daed
5 changed files with 39 additions and 16 deletions
+4 -2
View File
@@ -10,12 +10,14 @@ const OS_NAME: "mac" | "win" | "lin" = OS_MAP[process.platform];
export function getEnvVars(configMap: Record<string, string>) {
const envVars: {
[key: string]: string | number | boolean;
[key: string]: string | undefined;
} = {};
let updatedConfigData: Uint8Array;
try {
updatedConfigData = new TextEncoder().encode(JSON.stringify(configMap));
// Ensure we're working with a fresh copy of the config
const configCopy = JSON.parse(JSON.stringify(configMap));
updatedConfigData = new TextEncoder().encode(JSON.stringify(configCopy));
} catch (e) {
console.error(`Error updating config: ${e}`);
process.exit(1);