chromedriver 118.0.1 → 119.0.1
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/lib/chromedriver.js +25 -15
- package/package.json +7 -7
package/lib/chromedriver.js
CHANGED
|
@@ -3,23 +3,23 @@ const path = require('path');
|
|
|
3
3
|
const tcpPortUsed = require('tcp-port-used');
|
|
4
4
|
function getPortFromArgs(args) {
|
|
5
5
|
let port = 9515;
|
|
6
|
-
if (!args)
|
|
6
|
+
if (!args)
|
|
7
7
|
return port;
|
|
8
|
-
}
|
|
9
8
|
const portRegexp = /--port=(\d*)/;
|
|
10
9
|
const portArg = args.find(function (arg) {
|
|
11
10
|
return portRegexp.test(arg);
|
|
12
11
|
});
|
|
13
|
-
if (portArg)
|
|
12
|
+
if (portArg)
|
|
14
13
|
port = parseInt(portRegexp.exec(portArg)[1]);
|
|
15
|
-
}
|
|
16
14
|
return port;
|
|
17
15
|
}
|
|
18
16
|
process.env.PATH = path.join(__dirname, 'chromedriver') + path.delimiter + process.env.PATH;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const crpath = process.platform === 'win32' ? path.join(__dirname, 'chromedriver', 'chromedriver.exe') : path.join(__dirname, 'chromedriver', 'chromedriver');
|
|
18
|
+
const version = '119.0.6045.105';
|
|
19
|
+
let defaultInstance = null;
|
|
20
|
+
|
|
21
|
+
function start(args, returnPromise) {
|
|
22
|
+
let command = crpath;
|
|
23
23
|
if (!fs.existsSync(command)) {
|
|
24
24
|
console.log('Could not find chromedriver in default path: ', command);
|
|
25
25
|
console.log('Falling back to use global chromedriver bin');
|
|
@@ -28,10 +28,9 @@ exports.start = function (args, returnPromise) {
|
|
|
28
28
|
const cp = require('child_process').spawn(command, args);
|
|
29
29
|
cp.stdout.pipe(process.stdout);
|
|
30
30
|
cp.stderr.pipe(process.stderr);
|
|
31
|
-
|
|
32
|
-
if (!returnPromise)
|
|
31
|
+
defaultInstance = cp;
|
|
32
|
+
if (!returnPromise)
|
|
33
33
|
return cp;
|
|
34
|
-
}
|
|
35
34
|
const port = getPortFromArgs(args);
|
|
36
35
|
const pollInterval = 100;
|
|
37
36
|
const timeout = 10000;
|
|
@@ -39,9 +38,20 @@ exports.start = function (args, returnPromise) {
|
|
|
39
38
|
.then(function () {
|
|
40
39
|
return cp;
|
|
41
40
|
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function stop() {
|
|
44
|
+
if (defaultInstance != null)
|
|
45
|
+
defaultInstance.kill();
|
|
46
|
+
defaultInstance = null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = {
|
|
50
|
+
path: crpath,
|
|
51
|
+
version,
|
|
52
|
+
start,
|
|
53
|
+
stop,
|
|
54
|
+
get defaultInstance() {
|
|
55
|
+
return defaultInstance;
|
|
46
56
|
}
|
|
47
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chromedriver",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "119.0.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"chromedriver",
|
|
6
6
|
"selenium"
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
"lint": "eslint"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@testim/chrome-version": "^1.1.
|
|
32
|
-
"axios": "^1.
|
|
33
|
-
"compare-versions": "^6.
|
|
31
|
+
"@testim/chrome-version": "^1.1.4",
|
|
32
|
+
"axios": "^1.6.0",
|
|
33
|
+
"compare-versions": "^6.1.0",
|
|
34
34
|
"extract-zip": "^2.0.1",
|
|
35
35
|
"https-proxy-agent": "^5.0.1",
|
|
36
36
|
"proxy-from-env": "^1.1.0",
|
|
37
|
-
"tcp-port-used": "^1.0.
|
|
37
|
+
"tcp-port-used": "^1.0.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"eslint": "^8.
|
|
40
|
+
"eslint": "^8.52.0",
|
|
41
41
|
"semver": "^7.5.4",
|
|
42
|
-
"typescript": "^5.
|
|
42
|
+
"typescript": "^5.2.2"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=18"
|