arn-browser 0.1.43 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -34,10 +34,20 @@ export interface HumanizeOptions extends CreateCursorOptions {
|
|
|
34
34
|
* These are passed directly to camoufox-js.
|
|
35
35
|
*/
|
|
36
36
|
export interface CamoufoxOptions {
|
|
37
|
-
/** Firefox version to use. Defaults to
|
|
38
|
-
*
|
|
37
|
+
/** Firefox version to use. Defaults to a random version between minFirefoxVersion and maxFirefoxVersion.
|
|
38
|
+
* If set, overrides minFirefoxVersion/maxFirefoxVersion (no randomness).
|
|
39
39
|
*/
|
|
40
40
|
ff_version?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Minimum Firefox version for random ff_version generation.
|
|
43
|
+
* Default: DEFAULT_MIN_FIREFOX_VERSION (146)
|
|
44
|
+
*/
|
|
45
|
+
minVersion?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Maximum Firefox version for random ff_version generation.
|
|
48
|
+
* Default: DEFAULT_MAX_FIREFOX_VERSION (150)
|
|
49
|
+
*/
|
|
50
|
+
maxVersion?: number;
|
|
41
51
|
/** Whether to run the browser in headless mode. Defaults to `false`.
|
|
42
52
|
*/
|
|
43
53
|
headless?: boolean;
|
|
@@ -239,7 +249,7 @@ export interface PwLaunchOptions {
|
|
|
239
249
|
os_type?: ("windows" | "macos" | "linux" | "android" | "ios") | ("windows" | "macos" | "linux" | "android" | "ios")[];
|
|
240
250
|
/**
|
|
241
251
|
* Minimum browser version for fingerprint generation.
|
|
242
|
-
* Default:
|
|
252
|
+
* Default: 146
|
|
243
253
|
*/
|
|
244
254
|
minBrowserVersion?: number;
|
|
245
255
|
/** Minimum screen width constraint */
|
|
@@ -38,9 +38,11 @@ const osMap = {
|
|
|
38
38
|
};
|
|
39
39
|
const detectedOs = osMap[process.platform] || "windows";
|
|
40
40
|
|
|
41
|
-
// Default minimum browser
|
|
41
|
+
// Default minimum browser version for fingerprint generation (max is handled by fingerprint-generator)
|
|
42
42
|
const DEFAULT_MIN_CHROME_VERSION = 146;
|
|
43
|
-
|
|
43
|
+
// Default Firefox version range for Camoufox ff_version
|
|
44
|
+
const DEFAULT_MIN_FIREFOX_VERSION = 146;
|
|
45
|
+
const DEFAULT_MAX_FIREFOX_VERSION = 150;
|
|
44
46
|
|
|
45
47
|
const MULTILOGIN_LAUNCHER_URL = "https://launcher.mlx.yt:45001";
|
|
46
48
|
const MULTILOGIN_FOLDER_ID = "bad9e7e1-cfab-4c8d-bd19-91aa82929711";
|
|
@@ -909,10 +911,10 @@ async function camoufoxLauncher({ profilePath, proxy, timezoneId, camoufox_optio
|
|
|
909
911
|
}
|
|
910
912
|
} else {
|
|
911
913
|
function getRandomValidMajorVersion() {
|
|
912
|
-
//
|
|
913
|
-
const
|
|
914
|
-
const
|
|
915
|
-
return
|
|
914
|
+
// Random Firefox version — use camoufox_options overrides if provided, otherwise defaults
|
|
915
|
+
const min = camoufox_options.minVersion || DEFAULT_MIN_FIREFOX_VERSION;
|
|
916
|
+
const max = camoufox_options.maxVersion || DEFAULT_MAX_FIREFOX_VERSION;
|
|
917
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
916
918
|
}
|
|
917
919
|
|
|
918
920
|
// Prepare the base options
|
|
@@ -173,7 +173,7 @@ export interface PpLaunchOptions {
|
|
|
173
173
|
os_type?: ("windows" | "macos" | "linux" | "android" | "ios") | ("windows" | "macos" | "linux" | "android" | "ios")[];
|
|
174
174
|
/**
|
|
175
175
|
* Minimum Chrome version for fingerprint generation.
|
|
176
|
-
* Default:
|
|
176
|
+
* Default: 146
|
|
177
177
|
*/
|
|
178
178
|
minBrowserVersion?: number;
|
|
179
179
|
/** Minimum screen width constraint */
|
|
@@ -645,6 +645,16 @@ async function spawnAndConnect({ binaryPath, profilePath, isPersistent, proxy, t
|
|
|
645
645
|
if (tz) {
|
|
646
646
|
await page.emulateTimezone(tz);
|
|
647
647
|
if (_launchLogs) console.log(`░░░░░ Timezone set to ${tz} for ${browserLabel}`);
|
|
648
|
+
|
|
649
|
+
// Ensure any newly created pages also get the timezone override
|
|
650
|
+
browser.on('targetcreated', async target => {
|
|
651
|
+
if (target.type() === 'page') {
|
|
652
|
+
try {
|
|
653
|
+
const newPage = await target.page();
|
|
654
|
+
if (newPage) await newPage.emulateTimezone(tz);
|
|
655
|
+
} catch (e) { }
|
|
656
|
+
}
|
|
657
|
+
});
|
|
648
658
|
}
|
|
649
659
|
|
|
650
660
|
// Fingerprint injection logic:
|
|
@@ -797,6 +807,16 @@ async function launchExistingMultiloginProfile(profileId, timezoneId = null) {
|
|
|
797
807
|
if (timezoneId) {
|
|
798
808
|
await page.emulateTimezone(timezoneId);
|
|
799
809
|
if (_launchLogs) console.log(`░░░░░ Timezone set to ${timezoneId} for Multilogin profile ${profileId}`);
|
|
810
|
+
|
|
811
|
+
// Ensure any newly created pages also get the timezone override
|
|
812
|
+
browser.on('targetcreated', async target => {
|
|
813
|
+
if (target.type() === 'page') {
|
|
814
|
+
try {
|
|
815
|
+
const newPage = await target.page();
|
|
816
|
+
if (newPage) await newPage.emulateTimezone(timezoneId);
|
|
817
|
+
} catch (e) { }
|
|
818
|
+
}
|
|
819
|
+
});
|
|
800
820
|
}
|
|
801
821
|
|
|
802
822
|
let closing = false;
|
|
@@ -908,6 +928,16 @@ async function launchQuickMultiloginProfile({ os_type, proxy, timezoneId = null,
|
|
|
908
928
|
if (timezoneId) {
|
|
909
929
|
await page.emulateTimezone(timezoneId);
|
|
910
930
|
if (_launchLogs) console.log(`░░░░░ Timezone set to ${timezoneId} for Multilogin quick profile`);
|
|
931
|
+
|
|
932
|
+
// Ensure any newly created pages also get the timezone override
|
|
933
|
+
browser.on('targetcreated', async target => {
|
|
934
|
+
if (target.type() === 'page') {
|
|
935
|
+
try {
|
|
936
|
+
const newPage = await target.page();
|
|
937
|
+
if (newPage) await newPage.emulateTimezone(timezoneId);
|
|
938
|
+
} catch (e) { }
|
|
939
|
+
}
|
|
940
|
+
});
|
|
911
941
|
}
|
|
912
942
|
|
|
913
943
|
let closing = false;
|