camoufox-js 0.8.2 → 0.8.3

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/dist/__main__.js CHANGED
File without changes
@@ -9,6 +9,10 @@ export declare class VirtualDisplay {
9
9
  private execute_xvfb;
10
10
  get(): string;
11
11
  kill(): void;
12
+ /**
13
+ * Get list of lock files in /tmp
14
+ * @returns List of lock file paths
15
+ */
12
16
  static _get_lock_files(): string[];
13
17
  private static _free_display;
14
18
  private get display();
@@ -1,11 +1,11 @@
1
1
  import { execFileSync, spawn } from "node:child_process";
2
- // import { globSync } from 'glob';
3
2
  import { randomInt } from "node:crypto";
4
- import { existsSync } from "node:fs";
3
+ import { existsSync, statSync } from "node:fs";
5
4
  import { tmpdir } from "node:os";
5
+ import path from "node:path";
6
+ import { globSync } from "glob";
6
7
  import { CannotExecuteXvfb, CannotFindXvfb, VirtualDisplayNotSupported, } from "./exceptions.js";
7
8
  import { OS_NAME } from "./pkgman.js";
8
- // import { Lock } from 'async-mutex';
9
9
  export class VirtualDisplay {
10
10
  debug;
11
11
  proc = null;
@@ -85,11 +85,21 @@ export class VirtualDisplay {
85
85
  }
86
86
  // });
87
87
  }
88
+ /**
89
+ * Get list of lock files in /tmp
90
+ * @returns List of lock file paths
91
+ */
88
92
  static _get_lock_files() {
89
- const _tmpd = process.env.TMPDIR || tmpdir();
93
+ const tmpd = process.env.TMPDIR || tmpdir();
90
94
  try {
91
- return [];
92
- // return globSync(join(tmpd, ".X*-lock")).filter(p => existsSync(p));
95
+ return globSync(path.join(tmpd, ".X*-lock")).filter((p) => {
96
+ try {
97
+ return statSync(p).isFile();
98
+ }
99
+ catch {
100
+ return false;
101
+ }
102
+ });
93
103
  }
94
104
  catch {
95
105
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camoufox-js",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -34,6 +34,7 @@
34
34
  "better-sqlite3": "^12.2.0",
35
35
  "commander": "^14.0.0",
36
36
  "fingerprint-generator": "^2.1.66",
37
+ "glob": "^13.0.0",
37
38
  "impit": "^0.7.0",
38
39
  "language-tags": "^2.0.1",
39
40
  "maxmind": "^5.0.0",
@@ -42,7 +43,7 @@
42
43
  "xml2js": "^0.6.2"
43
44
  },
44
45
  "devDependencies": {
45
- "@biomejs/biome": "2.3.4",
46
+ "@biomejs/biome": "2.3.7",
46
47
  "@types/adm-zip": "^0.5.7",
47
48
  "@types/better-sqlite3": "^7.6.13",
48
49
  "@types/language-tags": "^1.0.4",