camoufox-js 0.8.2 → 0.8.4
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 +0 -0
- package/dist/fingerprints.js +1 -1
- package/dist/virtdisplay.d.ts +4 -0
- package/dist/virtdisplay.js +16 -6
- package/package.json +4 -3
package/dist/__main__.js
CHANGED
|
File without changes
|
package/dist/fingerprints.js
CHANGED
|
@@ -23,7 +23,7 @@ function _castToProperties(camoufoxData, castEnum, bfDict, ffVersion) {
|
|
|
23
23
|
data = 0;
|
|
24
24
|
}
|
|
25
25
|
if (ffVersion && typeof data === "string") {
|
|
26
|
-
data = data.
|
|
26
|
+
data = data.replaceAll(/(?<!\d)(1[0-9]{2})(\.0)(?!\d)/gi, `${ffVersion}$2`);
|
|
27
27
|
}
|
|
28
28
|
camoufoxData[typeKey] = data;
|
|
29
29
|
}
|
package/dist/virtdisplay.d.ts
CHANGED
|
@@ -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();
|
package/dist/virtdisplay.js
CHANGED
|
@@ -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
|
|
93
|
+
const tmpd = process.env.TMPDIR || tmpdir();
|
|
90
94
|
try {
|
|
91
|
-
return
|
|
92
|
-
|
|
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.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -28,12 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "MPL-2.0",
|
|
30
30
|
"description": "Experimental JS port of Camoufox for Python.",
|
|
31
|
-
"packageManager": "yarn@4.
|
|
31
|
+
"packageManager": "yarn@4.12.0",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"adm-zip": "^0.5.16",
|
|
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.
|
|
46
|
+
"@biomejs/biome": "2.3.8",
|
|
46
47
|
"@types/adm-zip": "^0.5.7",
|
|
47
48
|
"@types/better-sqlite3": "^7.6.13",
|
|
48
49
|
"@types/language-tags": "^1.0.4",
|