chromedriver 97.0.2 → 97.0.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/README.md +22 -0
- package/install.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -267,6 +267,28 @@ DETECT_CHROMEDRIVER_VERSION=true npm install chromedriver
|
|
|
267
267
|
**Note:** When the property `detect_chromedriver_version` is provided,
|
|
268
268
|
`chromedriver_version` and `chromedriver_filepath` properties are ignored.
|
|
269
269
|
|
|
270
|
+
## Include Chromium
|
|
271
|
+
|
|
272
|
+
If you don't have Chrome installed, you can check for Chromium version instead by setting the argument `include_chromium` to `true`.
|
|
273
|
+
|
|
274
|
+
```shell
|
|
275
|
+
npm install chromedriver --include_chromium
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
include_chromium=true
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Another option is to use environment variable `INCLUDE_CHROMIUM`.
|
|
285
|
+
|
|
286
|
+
```shell
|
|
287
|
+
INCLUDE_CHROMIUM=true npm install chromedriver
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Note:** The property `INCLUDE_CHROMIUM` is ignored if the property `DETECT_CHROMEDRIVER_VERSION` is not used.
|
|
291
|
+
|
|
270
292
|
## A Note on chromedriver
|
|
271
293
|
|
|
272
294
|
Chromedriver is not a library for NodeJS.
|
package/install.js
CHANGED
|
@@ -33,6 +33,7 @@ const configuredfilePath = process.env.npm_config_chromedriver_filepath || proce
|
|
|
33
33
|
cdnUrl = cdnUrl.replace(/\/+$/, '');
|
|
34
34
|
const platform = validatePlatform();
|
|
35
35
|
const detect_chromedriver_version = process.env.npm_config_detect_chromedriver_version || process.env.DETECT_CHROMEDRIVER_VERSION;
|
|
36
|
+
const include_chromium = (process.env.npm_config_include_chromium || process.env.INCLUDE_CHROMIUM) === 'true';
|
|
36
37
|
let chromedriver_version = process.env.npm_config_chromedriver_version || process.env.CHROMEDRIVER_VERSION || helper.version;
|
|
37
38
|
let chromedriverBinaryFilePath;
|
|
38
39
|
let downloadedFile = '';
|
|
@@ -41,7 +42,7 @@ let downloadedFile = '';
|
|
|
41
42
|
try {
|
|
42
43
|
if (detect_chromedriver_version === 'true') {
|
|
43
44
|
// Refer http://chromedriver.chromium.org/downloads/version-selection
|
|
44
|
-
const chromeVersion = await getChromeVersion();
|
|
45
|
+
const chromeVersion = await getChromeVersion(include_chromium);
|
|
45
46
|
console.log("Your Chrome version is " + chromeVersion);
|
|
46
47
|
const chromeVersionWithoutPatch = /^(.*?)\.\d+$/.exec(chromeVersion)[1];
|
|
47
48
|
await getChromeDriverVersion(getRequestOptions(cdnUrl + '/LATEST_RELEASE_' + chromeVersionWithoutPatch));
|