arn-browser 0.1.37 → 0.1.39

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arn-browser",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "A lightweight, browser autmation helper.",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -87,9 +87,15 @@ export interface MultiloginOptions {
87
87
 
88
88
  /**
89
89
  * OS Type for Multilogin profile creation.
90
+ * - Single string: uses that OS
91
+ * - Array: random pick per launch (e.g. ["windows", "android"])
92
+ * - Omitted/null: auto-detects from process.platform
93
+ *
94
+ * Note: When "android" is selected, screen_masking is forced to true.
95
+ *
90
96
  * Default: detected OS
91
97
  */
92
- os_type?: "windows" | "macos" | "linux" | "android";
98
+ os_type?: ("windows" | "macos" | "linux" | "android") | ("windows" | "macos" | "linux" | "android")[];
93
99
 
94
100
  /**
95
101
  * Multilogin flag: Canvas noise masking.
@@ -113,6 +119,7 @@ export interface MultiloginOptions {
113
119
  * Multilogin flag: Screen resolution masking.
114
120
  * true = randomize screen resolution ("mask")
115
121
  * false = use real screen resolution ("natural")
122
+ * Note: Forced to true when os_type is "android".
116
123
  * Default: true
117
124
  */
118
125
  screen_masking?: boolean;
@@ -979,7 +979,7 @@ async function multiloginLauncher({ proxy, multilogin_options = {}, humanize_opt
979
979
  // Destructure defaults from multilogin_options
980
980
  const {
981
981
  profileId = null,
982
- os_type = detectedOs,
982
+ os_type: rawOsType = null,
983
983
  canvas_noise = true,
984
984
  media_masking = true,
985
985
  audio_masking = true,
@@ -988,17 +988,33 @@ async function multiloginLauncher({ proxy, multilogin_options = {}, humanize_opt
988
988
 
989
989
  if (profileId) {
990
990
  return await launchExistingMultiloginProfile(profileId, humanize_options);
991
+ }
992
+
993
+ // Resolve os_type: array → random pick, null → detect from process.platform
994
+ let selectedOs;
995
+
996
+ if (Array.isArray(rawOsType) && rawOsType.length > 0) {
997
+ selectedOs = rawOsType[Math.floor(Math.random() * rawOsType.length)];
998
+ } else if (typeof rawOsType === "string" && rawOsType) {
999
+ selectedOs = rawOsType;
991
1000
  } else {
992
- return await launchQuickMultiloginProfile({
993
- os_type,
994
- proxy,
995
- canvas_noise,
996
- media_masking,
997
- audio_masking,
998
- screen_masking,
999
- humanize_options,
1000
- });
1001
+ selectedOs = detectedOs;
1001
1002
  }
1003
+
1004
+ // Android always forces screen_masking to true
1005
+ const effectiveScreenMasking = selectedOs === "android" ? true : screen_masking;
1006
+
1007
+ if (_launchLogs) console.log(`░░░░░ Multilogin OS: ${selectedOs} (screen_masking: ${effectiveScreenMasking})`);
1008
+
1009
+ return await launchQuickMultiloginProfile({
1010
+ os_type: selectedOs,
1011
+ proxy,
1012
+ canvas_noise,
1013
+ media_masking,
1014
+ audio_masking,
1015
+ screen_masking: effectiveScreenMasking,
1016
+ humanize_options,
1017
+ });
1002
1018
  }
1003
1019
 
1004
1020
  async function launchExistingMultiloginProfile(profileId, humanize_options = null) {
@@ -1088,11 +1104,28 @@ async function launchQuickMultiloginProfile({ os_type, proxy, canvas_noise, medi
1088
1104
  is_headless: false,
1089
1105
  parameters: {
1090
1106
  flags: {
1107
+ navigator_masking: "mask",
1091
1108
  audio_masking: audio_masking ? "mask" : "natural",
1109
+ localization_masking: "mask",
1110
+ geolocation_popup: "prompt",
1111
+ geolocation_masking: "mask",
1112
+ timezone_masking: "mask",
1113
+ graphics_noise: "mask",
1114
+ graphics_masking: "mask",
1115
+ webrtc_masking: "mask",
1116
+ fonts_masking: "mask",
1092
1117
  media_devices_masking: media_masking ? "mask" : "natural",
1093
1118
  screen_masking: screen_masking ? "mask" : "natural",
1094
- canvas_noise: canvas_noise ? "mask" : "natural",
1095
1119
  proxy_masking: proxy ? "custom" : "disabled",
1120
+ ports_masking: "mask",
1121
+ canvas_noise: canvas_noise ? "mask" : "natural",
1122
+ startup_behavior: "custom",
1123
+ },
1124
+ fingerprint: {
1125
+ ports: [],
1126
+ cmd_params: {
1127
+ params: [{ flag: "warn-on-window-close" }],
1128
+ },
1096
1129
  },
1097
1130
  },
1098
1131
  quickProfilesCount: 1,
@@ -12,9 +12,15 @@ export interface PpMultiloginOptions {
12
12
 
13
13
  /**
14
14
  * OS Type for Multilogin profile creation.
15
+ * - Single string: uses that OS
16
+ * - Array: random pick per launch (e.g. ["windows", "android"])
17
+ * - Omitted/null: auto-detects from process.platform
18
+ *
19
+ * Note: When "android" is selected, screen_masking is forced to true.
20
+ *
15
21
  * Default: detected OS
16
22
  */
17
- os_type?: "windows" | "macos" | "linux" | "android";
23
+ os_type?: ("windows" | "macos" | "linux" | "android") | ("windows" | "macos" | "linux" | "android")[];
18
24
 
19
25
  /**
20
26
  * Multilogin flag: Canvas noise masking.
@@ -38,6 +44,7 @@ export interface PpMultiloginOptions {
38
44
  * Multilogin flag: Screen resolution masking.
39
45
  * true = randomize screen resolution ("mask")
40
46
  * false = use real screen resolution ("natural")
47
+ * Note: Forced to true when os_type is "android".
41
48
  * Default: true
42
49
  */
43
50
  screen_masking?: boolean;
@@ -709,7 +709,7 @@ async function spawnAndConnect({ binaryPath, profilePath, isPersistent, proxy, t
709
709
  async function multiloginLauncher({ proxy, multilogin_options = {} }) {
710
710
  const {
711
711
  profileId = null,
712
- os_type = (process.platform === "win32" ? "windows" : process.platform === "darwin" ? "macos" : "linux"),
712
+ os_type: rawOsType = null,
713
713
  canvas_noise = true,
714
714
  media_masking = true,
715
715
  audio_masking = true,
@@ -718,16 +718,33 @@ async function multiloginLauncher({ proxy, multilogin_options = {} }) {
718
718
 
719
719
  if (profileId) {
720
720
  return await launchExistingMultiloginProfile(profileId);
721
+ }
722
+
723
+ // Resolve os_type: array → random pick, null → detect from process.platform
724
+ const defaultOs = process.platform === "win32" ? "windows" : process.platform === "darwin" ? "macos" : "linux";
725
+ let selectedOs;
726
+
727
+ if (Array.isArray(rawOsType) && rawOsType.length > 0) {
728
+ selectedOs = rawOsType[Math.floor(Math.random() * rawOsType.length)];
729
+ } else if (typeof rawOsType === "string" && rawOsType) {
730
+ selectedOs = rawOsType;
721
731
  } else {
722
- return await launchQuickMultiloginProfile({
723
- os_type,
724
- proxy,
725
- canvas_noise,
726
- media_masking,
727
- audio_masking,
728
- screen_masking,
729
- });
732
+ selectedOs = defaultOs;
730
733
  }
734
+
735
+ // Android always forces screen_masking to true
736
+ const effectiveScreenMasking = selectedOs === "android" ? true : screen_masking;
737
+
738
+ if (_launchLogs) console.log(`░░░░░ Multilogin OS: ${selectedOs} (screen_masking: ${effectiveScreenMasking})`);
739
+
740
+ return await launchQuickMultiloginProfile({
741
+ os_type: selectedOs,
742
+ proxy,
743
+ canvas_noise,
744
+ media_masking,
745
+ audio_masking,
746
+ screen_masking: effectiveScreenMasking,
747
+ });
731
748
  }
732
749
 
733
750
  async function launchExistingMultiloginProfile(profileId) {
@@ -816,11 +833,28 @@ async function launchQuickMultiloginProfile({ os_type, proxy, canvas_noise, medi
816
833
  is_headless: false,
817
834
  parameters: {
818
835
  flags: {
836
+ navigator_masking: "mask",
819
837
  audio_masking: audio_masking ? "mask" : "natural",
838
+ localization_masking: "mask",
839
+ geolocation_popup: "prompt",
840
+ geolocation_masking: "mask",
841
+ timezone_masking: "mask",
842
+ graphics_noise: "mask",
843
+ graphics_masking: "mask",
844
+ webrtc_masking: "mask",
845
+ fonts_masking: "mask",
820
846
  media_devices_masking: media_masking ? "mask" : "natural",
821
847
  screen_masking: screen_masking ? "mask" : "natural",
822
- canvas_noise: canvas_noise ? "mask" : "natural",
823
848
  proxy_masking: proxy ? "custom" : "disabled",
849
+ ports_masking: "mask",
850
+ canvas_noise: canvas_noise ? "mask" : "natural",
851
+ startup_behavior: "custom",
852
+ },
853
+ fingerprint: {
854
+ ports: [],
855
+ cmd_params: {
856
+ params: [{ flag: "warn-on-window-close" }],
857
+ },
824
858
  },
825
859
  },
826
860
  quickProfilesCount: 1,