@hieutran094/camoufox-js 0.6.6 → 0.6.7

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.
@@ -25,7 +25,8 @@ function _castToProperties(camoufoxData, castEnum, bfDict, ffVersion) {
25
25
  data = 0;
26
26
  }
27
27
  if (ffVersion && typeof data === 'string') {
28
- data = data.replace(/(?<!\d)(1[0-9]{2})(\.0)(?!\d)/, `${ffVersion}$2`);
28
+ const regex = new RegExp("(?<!\\d)(1[0-9]{2})(\\.0)(?!\\d)", "g");
29
+ data = data.replace(regex, `${ffVersion}$2`);
29
30
  }
30
31
  camoufoxData[typeKey] = data;
31
32
  }
package/dist/utils.d.ts CHANGED
@@ -82,8 +82,9 @@ export interface LaunchOptions {
82
82
  /** Use a specific WebGL vendor/renderer pair. Passed as a tuple of `[vendor, renderer]`. */
83
83
  webgl_config?: [string, string];
84
84
  allow_addon_new_tab?: boolean;
85
+ webgl_fingerprint?: Record<string, any>;
85
86
  /** Additional Firefox launch options. */
86
87
  [key: string]: any;
87
88
  }
88
- export declare function launchOptions({ config, os, block_images, block_webrtc, block_webgl, disable_coop, webgl_config, geoip, humanize, locale, addons, fonts, custom_fonts_only, exclude_addons, screen, window, fingerprint, ff_version, headless, main_world_eval, executable_path, firefox_user_prefs, proxy, enable_cache, args, env, i_know_what_im_doing, debug, virtual_display, allow_addon_new_tab, ...launch_options }: LaunchOptions): Promise<Record<string, any>>;
89
+ export declare function launchOptions({ config, os, block_images, block_webrtc, block_webgl, disable_coop, webgl_config, geoip, humanize, locale, addons, fonts, custom_fonts_only, exclude_addons, screen, window, fingerprint, ff_version, headless, main_world_eval, executable_path, firefox_user_prefs, proxy, enable_cache, args, env, i_know_what_im_doing, debug, virtual_display, allow_addon_new_tab, webgl_fingerprint, ...launch_options }: LaunchOptions): Promise<Record<string, any>>;
89
90
  export {};
package/dist/utils.js CHANGED
@@ -277,7 +277,7 @@ function getProxyUrl(proxy) {
277
277
  url.password = password;
278
278
  return url;
279
279
  }
280
- export async function launchOptions({ config, os, block_images, block_webrtc, block_webgl, disable_coop, webgl_config, geoip, humanize, locale, addons, fonts, custom_fonts_only, exclude_addons, screen, window, fingerprint, ff_version, headless, main_world_eval, executable_path, firefox_user_prefs, proxy, enable_cache, args, env, i_know_what_im_doing, debug, virtual_display, allow_addon_new_tab, ...launch_options }) {
280
+ export async function launchOptions({ config, os, block_images, block_webrtc, block_webgl, disable_coop, webgl_config, geoip, humanize, locale, addons, fonts, custom_fonts_only, exclude_addons, screen, window, fingerprint, ff_version, headless, main_world_eval, executable_path, firefox_user_prefs, proxy, enable_cache, args, env, i_know_what_im_doing, debug, virtual_display, allow_addon_new_tab, webgl_fingerprint, ...launch_options }) {
281
281
  // Build the config
282
282
  if (!config) {
283
283
  config = {};
@@ -439,12 +439,14 @@ export async function launchOptions({ config, os, block_images, block_webrtc, bl
439
439
  }
440
440
  else {
441
441
  // If the user has provided a specific WebGL vendor/renderer pair, use it
442
- let webgl_fp;
443
- if (webgl_config) {
444
- webgl_fp = await sampleWebGL(targetOS, ...webgl_config);
445
- }
446
- else {
447
- webgl_fp = await sampleWebGL(targetOS);
442
+ let webgl_fp = webgl_fingerprint;
443
+ if (!webgl_fp) {
444
+ if (webgl_config) {
445
+ webgl_fp = await sampleWebGL(targetOS, ...webgl_config);
446
+ }
447
+ else {
448
+ webgl_fp = await sampleWebGL(targetOS);
449
+ }
448
450
  }
449
451
  const { webGl2Enabled, ...webGlConfig } = webgl_fp;
450
452
  // Merge the WebGL fingerprint into the config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hieutran094/camoufox-js",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {