refactor: only perform geoip lookup if the required flag is passed

This commit is contained in:
zhom
2025-08-06 06:33:21 +04:00
parent 0baecbdb0c
commit 6d77c872f2
2 changed files with 4 additions and 7 deletions
+3 -4
View File
@@ -465,9 +465,7 @@ export async function generateCamoufoxConfig(
options: GenerateConfigOptions,
): Promise<string> {
try {
// Build launch options
const launchOpts: LaunchOptions = {
// Always set these defaults
headless: false,
i_know_what_im_doing: true,
config: {
@@ -476,8 +474,9 @@ export async function generateCamoufoxConfig(
},
};
// Always set geoip and blocking options
launchOpts.geoip = options.geoip !== undefined ? options.geoip : true;
if (options.geoip !== undefined) {
launchOpts.geoip = options.geoip;
}
if (options.blockImages) {
launchOpts.block_images = true;
+1 -3
View File
@@ -200,10 +200,8 @@ program
// Security options
if (options.disableCoop) camoufoxOptions.disable_coop = true;
// Geolocation - always enable geoip for proper spoofing
if (options.geoip) {
camoufoxOptions.geoip =
options.geoip === "auto" ? true : (options.geoip as string);
camoufoxOptions.geoip = true;
}
if (options.latitude && options.longitude) {