chromedriver 97.0.1 → 97.0.2

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.
Files changed (2) hide show
  1. package/install.js +9 -4
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -10,11 +10,15 @@ const child_process = require('child_process');
10
10
  const os = require('os');
11
11
  const url = require('url');
12
12
  const https = require('https');
13
+ const { promisify } = require('util');
14
+ const { finished } = require('stream');
13
15
  const extractZip = require('extract-zip');
14
16
  const { getChromeVersion } = require('@testim/chrome-version');
15
17
  const HttpsProxyAgent = require('https-proxy-agent');
16
18
  const getProxyForUrl = require("proxy-from-env").getProxyForUrl;
17
19
 
20
+ const finishedAsync = promisify(finished);
21
+
18
22
  const skipDownload = process.env.npm_config_chromedriver_skip_download || process.env.CHROMEDRIVER_SKIP_DOWNLOAD;
19
23
  if (skipDownload === 'true') {
20
24
  console.log('Found CHROMEDRIVER_SKIP_DOWNLOAD variable, skipping installation.');
@@ -256,10 +260,11 @@ async function requestBinary(requestOptions, filePath) {
256
260
  console.error('Error status code:', error.response.status);
257
261
  if (error.response.data) {
258
262
  error.response.data.on('data', data => console.error(data.toString('utf8')));
259
- await new Promise((resolve) => {
260
- error.response.data.on('finish', resolve);
261
- error.response.data.on('error', resolve);
262
- });
263
+ try {
264
+ await finishedAsync(error.response.data)
265
+ } catch (error) {
266
+ console.error('Error downloading entire response:', error);
267
+ }
263
268
  }
264
269
  }
265
270
  throw new Error('Error with http(s) request: ' + error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chromedriver",
3
- "version": "97.0.1",
3
+ "version": "97.0.2",
4
4
  "keywords": [
5
5
  "chromedriver",
6
6
  "selenium"