mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-04-29 15:26:05 +02:00
refactor: only perform geoip lookup if the required flag is passed
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user