browsertime 17.19.0 → 18.0.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
- ## 17.19.0 - 2022-11-03
3
+ ## 18.0.0 - 2023-11-07
4
+
5
+ ### Breaking
6
+ * Dropping support for NodeJS 16.
7
+
8
+ ### Fixed
9
+ * Updated all dev-dependencies to latest versions [#2013](https://github.com/sitespeedio/browsertime/pull/2013).
10
+ * Updated GitHub Actions to use latest versions of actions and Ubuntu 22.04 [#2012](https://github.com/sitespeedio/browsertime/pull/2012), [#2014](https://github.com/sitespeedio/browsertime/pull/2014) and [#2016](https://github.com/sitespeedio/browsertime/pull/2016)
11
+ * Updated all dependencies to latest versions: ADB kit 3.2.5 [#2017](https://github.com/sitespeedio/browsertime/pull/2017), execa, dayjs, get-port and Chromedriver [#2015](https://github.com/sitespeedio/browsertime/pull/2015).
12
+
13
+ ## 17.19.0 - 2023-11-03
4
14
  ### Added
5
15
  * Updated to Chrome, Firefox and Edge 119 in the Docker container [#2010](https://github.com/sitespeedio/browsertime/pull/2010).
6
16
  * Updated to Edgedriver 119.
@@ -8,12 +18,12 @@
8
18
  ### Fixed
9
19
  * Updated to Selenium 4.15.0 [#2011](https://github.com/sitespeedio/browsertime/pull/2011).
10
20
 
11
- ## 17.18.1 - 2022-10-31
21
+ ## 17.18.1 - 2023-10-31
12
22
  ### Fixed
13
23
  * WebDriver 4.14.0
14
24
  * Chromedriver 119.0.6045-59
15
25
 
16
- ## 17.18.0 - 2022-10-23
26
+ ## 17.18.0 - 2023-10-23
17
27
  ### Added
18
28
  * Updated to Chromedriver 119 [#2003](https://github.com/sitespeedio/browsertime/pull/2003). 119 works with both Chrome 118 and 119 so it fixes [#1197](https://github.com/sitespeedio/browsertime/issues/1997).
19
29
  * Add support for network idle method to know when to end a test that uses network logs. Uses Bidi for Firefox and CDP for Chrome to listen on network events to know when to end a test. By default 5 seconds idle network time ends a tests (you could have network responses that hasn't arrived yet) [#1960](https://github.com/sitespeedio/browsertime/pull/1960). Potentially this can help SPA users or users where the page uses iframes. You can try it out by adding `--pageCompleteCheckNetworkIdle` yo your command line. This is still some work in progress but feel free to try ut out.
@@ -23,7 +33,7 @@
23
33
  * Make sure timer always is cleared. There was case of where we do a rase beteween a promise and a timeout where the timeout timer wasn't cleared/removed [#2005](https://github.com/sitespeedio/browsertime/pull/2005).
24
34
  * Better way to get the url when you use GeckoProfiler.stop for Firefox, thank you [Nazım Can Altınova](https://github.com/canova) for PR [#1999](https://github.com/sitespeedio/browsertime/pull/1999)
25
35
 
26
- ## 17.17.0 - 2022-10-11
36
+ ## 17.17.0 - 2023-10-11
27
37
  ### Added
28
38
  * Firefox 118, Edge 117 and Chrome/Chromedriver 118 in the Docker container [#1996](https://github.com/sitespeedio/browsertime/pull/1996).
29
39
  * Expose trace start/stop for Chrome in scripting (the same way as for Firefox). Thank you [KS](https://github.com/92kns) for [#1988](https://github.com/sitespeedio/browsertime/pull/1988). Documentation is coming when the functionality is rolled out in sitespeed.io.
@@ -31,46 +41,46 @@
31
41
  ### Updated
32
42
  * Updated to Selenium 4.12
33
43
 
34
- ## 17.16.0 - 2022-09-04
44
+ ## 17.16.0 - 2023-09-04
35
45
  ### Added
36
46
  * Firefox 117 and Edge 116 in the Docker container.
37
47
 
38
48
  ### Fixed
39
49
  * Updated the BiDi HAR exporter for Firefox to version 0.0.12. This version will not work with Firefox 116 so if you use the BiDi HAR exporter you need to upgrade to Firefox 117.
40
50
 
41
- ## 17.15.0 - 2022-08-16
51
+ ## 17.15.0 - 2023-08-16
42
52
  ### Added
43
53
  * Updated Chrome and Chromedriver to 116.
44
54
 
45
- ## 17.14.3 - 2022-08-16
55
+ ## 17.14.3 - 2023-08-16
46
56
 
47
57
  ### Fixed
48
58
  * Updated to Selenium 4.11.1 [#1978](https://github.com/sitespeedio/browsertime/pull/1978).
49
59
  * Updated Chrome and Chromedriver to minor versions.
50
60
 
51
- ## 17.14.2 - 2022-07-31
61
+ ## 17.14.2 - 2023-07-31
52
62
  ### Fixed
53
63
  * The auto build of release Docker container was broken so no tagged containers was pushed.
54
64
 
55
- ## 17.14.1 - 2022-07-31
65
+ ## 17.14.1 - 2023-07-31
56
66
 
57
67
  ### Fixed
58
68
  * Default jimp resize didn't handle large values (2000) when running in Docker AMD on a ARM machine so changing to another algorithm (HERMITE) [#1977](https://github.com/sitespeedio/browsertime/pull/1977).
59
69
 
60
70
  * Update: chrome-har, dayjs, execa, chrome-remote-interface and jimp [#1976](https://github.com/sitespeedio/browsertime/pull/1976).
61
71
 
62
- ## 17.14.0 - 2022-07-24
72
+ ## 17.14.0 - 2023-07-24
63
73
 
64
74
  ### Added
65
75
  * Edge and Edgedriver 115 [#1973](https://github.com/sitespeedio/browsertime/pull/1973).
66
76
 
67
- ## 17.13.1 - 2022-07-22
77
+ ## 17.13.1 - 2023-07-22
68
78
 
69
79
  ### Tech
70
80
  * Internal fix how the render blocking result is added [#1972](https://github.com/sitespeedio/browsertime/pull/1972).
71
81
 
72
82
 
73
- ## 17.13.0 - 2022-07-21
83
+ ## 17.13.0 - 2023-07-21
74
84
  ### Fixed
75
85
  * Fix for Chromedriver 115 so that it works on Mac again [#1971](https://github.com/sitespeedio/browsertime/pull/1971).
76
86
 
@@ -80,7 +90,7 @@
80
90
  ### Tech
81
91
  * Run tests on Chrome/Firefox/Edge on Mac OS on our GitHub Actions to catch the next time Chromedriver is broken on Mac [#1970](https://github.com/sitespeedio/browsertime/pull/1970)
82
92
 
83
- ## 17.12.1 - 2022-07-19
93
+ ## 17.12.1 - 2023-07-19
84
94
  ### Fixed
85
95
  * Hmm, Chromedriver 115 doesn't seems to work on Mac so reverted to 114.
86
96
 
@@ -90,31 +100,31 @@
90
100
 
91
101
  * If you collect the Chrome devtools trace using `--cpu` we will now also collect the number of elements that needs recalculate styles before FCP/LCP.[#1964](https://github.com/sitespeedio/browsertime/pull/1964).
92
102
 
93
- ## 17.11.2 - 2022-06-19
103
+ ## 17.11.2 - 2023-06-19
94
104
  ### Fixed
95
105
  * Fix --debug mode. Thank you [Gregory Mierzwinski](https://github.com/gmierz) for PR [#1959](https://github.com/sitespeedio/browsertime/pull/1959).
96
106
  * Update ff-test-bidi-har-export to 0.0.11 that fixes some error logs [#1961](https://github.com/sitespeedio/browsertime/pull/1961).
97
107
 
98
- ## 17.11.1 - 2022-06-12
108
+ ## 17.11.1 - 2023-06-12
99
109
  ### Fixed
100
110
  * If Chrome do not collect largest contentful paint, log that instead of just log null [#1957](https://github.com/sitespeedio/browsertime/pull/1957).
101
111
 
102
- ## 17.11.0 - 2022-06-01
112
+ ## 17.11.0 - 2023-06-01
103
113
  ### Fixed
104
114
  * Fixed broken Docker auto build that skipped adding Docker manifest file.
105
115
 
106
116
  ### Added
107
117
  * Use Chrome ane Chromedriver 114.
108
118
 
109
- ## 17.10.2 - 2022-05-26
119
+ ## 17.10.2 - 2023-05-26
110
120
  ### Fixed
111
121
  * Fix for --host-resolver-rules, thank you [Mikhail](https://github.com/atuchin-m) for PR [#1953](https://github.com/sitespeedio/browsertime/pull/1953).
112
122
 
113
- ## 17.10.1 - 2022-05-19
123
+ ## 17.10.1 - 2023-05-19
114
124
  ### Fixed
115
125
  * Updated code to collect Interaction To Next Paint [#1952](https://github.com/sitespeedio/browsertime/pull/1952). This new version follow updated version(s) of Google Web Vitals.
116
126
 
117
- ## 17.10.0 - 2022-05-19
127
+ ## 17.10.0 - 2023-05-19
118
128
 
119
129
  ### Added
120
130
  * Chrome, Edge and Firefox 113 [#1946](https://github.com/sitespeedio/browsertime/pull/1946), Chromedriver 113 [#1947](https://github.com/sitespeedio/browsertime/pull/1947) and Edgedriver 113 [#1949](https://github.com/sitespeedio/browsertime/pull/1949).
@@ -123,7 +133,7 @@
123
133
  * Bugfix for running iPhone Siumlator (and run tests on latest Mac OS) [#1945](https://github.com/sitespeedio/browsertime/pull/1945).
124
134
  * Bumped dependencies for Selenium, yargs and jimp [#1950](https://github.com/sitespeedio/browsertime/pull/1950).
125
135
 
126
- ## 17.9.0 - 2022-04-19
136
+ ## 17.9.0 - 2023-04-19
127
137
  ### Added
128
138
  * New command to start geckoprofiling when scripting using Firefox. Thank you [KS](https://github.com/92kns) for PR [#1934](https://github.com/sitespeedio/browsertime/pull/1934). This is probably only something you need if you work at Mozilla. There's also a follow PR [#1940](https://github.com/sitespeedio/browsertime/pull/1940) that fixes some of the issues I've been wanted to fix with the Geckoprofiler code.
129
139
 
@@ -132,20 +142,20 @@
132
142
  ### Fixed
133
143
  * Bump Chrome remote interface and execa [#1941](https://github.com/sitespeedio/browsertime/pull/1941).
134
144
 
135
- ## 17.8.1 - 2022-04-12
145
+ ## 17.8.1 - 2023-04-12
136
146
  ### Fixed
137
147
  * Upgraded to Firefox HAR 0.0.10 [#1939](https://github.com/sitespeedio/browsertime/pull/1939).
138
- ## 17.8.0 - 2022-04-11
148
+ ## 17.8.0 - 2023-04-11
139
149
  ### Fixed
140
150
  * Upgraded to Firefox HAR 0.0.8 [#1937](https://github.com/sitespeedio/browsertime/pull/1937).
141
151
 
142
152
  ### Added
143
153
  * Upgraded to Firefox 112 in the Docker container.
144
- ## 17.7.0 - 2022-04-07
154
+ ## 17.7.0 - 2023-04-07
145
155
  ### Added
146
156
  * Added Edge/Edgedriver 112.
147
157
 
148
- ## 17.6.0 - 2022-04-05
158
+ ## 17.6.0 - 2023-04-05
149
159
  ### Fixed
150
160
  * Increased the default wait time from 2 to 5 seconds when a element a clicked and the page complete check runs [#1931](https://github.com/sitespeedio/browsertime/pull/1931)
151
161
 
@@ -153,7 +163,7 @@
153
163
  * Upgraded to Chrome/Chromedriver 112 in the Docker container [#1932](https://github.com/sitespeedio/browsertime/pull/1932).
154
164
  * If you use `--headless` Chrome will use the new headless switch [#1933](https://github.com/sitespeedio/browsertime/pull/1933).
155
165
 
156
- ## 17.5.0 - 2022-04-04
166
+ ## 17.5.0 - 2023-04-04
157
167
 
158
168
  ### Added
159
169
  * There's a new better way to get the HAR from [Firefox using WebDriver BiDi network events](https://github.com/firefox-devtools/bidi-har-export). Thank you [Julian Descottes](https://github.com/juliandescottes) and others at Mozilla that made this happen! With the new version we hope to see less overhead getting the HAR + it works on Firefox on Android [#1918](https://github.com/sitespeedio/browsertime/pull/1918). You can turn it on with `--firefox.bidihar`.
@@ -163,12 +173,12 @@
163
173
  * Fixed the interaction to next paint error message that started to appear in latest Chrome [#1924](https://github.com/sitespeedio/browsertime/pull/1924).
164
174
  * Safer check for getting last meaningful paint [#1927](https://github.com/sitespeedio/browsertime/pull/1927)
165
175
 
166
- ## 17.4.0 - 2022-03-29
176
+ ## 17.4.0 - 2023-03-29
167
177
  ### Added
168
178
  * Log the CPU benchmark metric to the console. This is useful (at least for me) when debugging instances with a lot of instability. [#1920](https://github.com/sitespeedio/browsertime/pull/1920).
169
179
  * In Chrome 111 some metrics become more instable when running on host with limited CPU. This change also exists in 112 beta. However we where missing out on a couple of command line magic to disable features in Chrome, this fixes that [#1921](https://github.com/sitespeedio/browsertime/pull/1921).
170
180
 
171
- ## 17.3.0 - 2022-03-26
181
+ ## 17.3.0 - 2023-03-26
172
182
 
173
183
  ### Fixed
174
184
  * Bumped Selenium-webdriver to 4.8.2 [#1916](https://github.com/sitespeedio/browsertime/pull/1916).
@@ -177,20 +187,20 @@
177
187
  * On Linux you can use taskset to assing FFMPEG to specific CPUs using `--videoParams.taskset "0,5,7,9-11" `. It will start FFMPEG with `taskset -c <CPUS>` to pin FFMPG to specific CPU(s). Specify a numerical list of processors. The list may contain multiple items, separated by comma, and ranges. For example, "0,5,7,9-11". Use it together with isolcpus. Added in [#1917](https://github.com/sitespeedio/browsertime/pull/1917).
178
188
 
179
189
  * If you use a rooted Samsung A51 you can now choose the CPU speed (min/middle/max) using `--android.pinCPUSpeed min|middle|max` [#1915](https://github.com/sitespeedio/browsertime/pull/1915).
180
- ## 17.2.1 - 2022-03-16
190
+ ## 17.2.1 - 2023-03-16
181
191
  ### Fixed
182
192
  * Bumped Geckodriver to 0.32.2 and Edgedriver to 111.
183
193
 
184
- ## 17.2.0 - 2022-03-14
194
+ ## 17.2.0 - 2023-03-14
185
195
  ### Added
186
196
  * Updated Chrome, Chromedriver, Edge and Firefox to 111.
187
197
 
188
- ## 17.1.1 - 2022-03-04
198
+ ## 17.1.1 - 2023-03-04
189
199
  ### Fixed
190
200
  * Updated jimp, yargs, webdriver, execa and chrome-remote-interface dependencies [#1909](https://github.com/sitespeedio/browsertime/pull/1909).
191
201
  * Added extra log message when using the package.json hack.
192
202
 
193
- ## 17.1.0 - 2022-02-24
203
+ ## 17.1.0 - 2023-02-24
194
204
 
195
205
  ### Added
196
206
  * Expose chrome-remote-interface client to scripting. This makes it so much easier to run whatever CDP command. Get the raw version `commands.cdp.getRawClient();`. See PR [#1905](https://github.com/sitespeedio/browsertime/pull/1905) for a concrete example until we update the documentation.
@@ -198,7 +208,7 @@
198
208
  * Fix visual-complete progress calculations to not use fuzz/slop, thank you [Gregory Mierzwinski](https://github.com/gmierz) for PR [#1902](https://github.com/sitespeedio/browsertime/pull/1902).
199
209
  * Update to new Chrome HAR [#1906](https://github.com/sitespeedio/browsertime/pull/1906).
200
210
  * Fix flushing DNS on Ubuntu 22.04 [#1907](https://github.com/sitespeedio/browsertime/pull/1907).
201
- ## 17.0.0 - 2022-02-10
211
+ ## 17.0.0 - 2023-02-10
202
212
 
203
213
  ### Breaking changes
204
214
  The project was transitioned to a [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) [#1859](https://github.com/sitespeedio/browsertime/pull/1859), allowing us to stay current with dependencies that have made the same transition and ensuring the ability to always utilize the latest versions of our dependencies. This is important for us and will make the project easier to maintain.
@@ -4,8 +4,8 @@ import { join } from 'node:path';
4
4
  import { EOL as endOfLine } from 'node:os';
5
5
  import { execa } from 'execa';
6
6
  import intel from 'intel';
7
- import adbKit from '@devicefarmer/adbkit';
8
- const { createClient, util } = adbKit;
7
+ import pkg from '@devicefarmer/adbkit';
8
+ const { Adb } = pkg;
9
9
  import get from 'lodash.get';
10
10
  const log = intel.getLogger('browsertime.android');
11
11
  const mkdir = promisify(_mkdir);
@@ -21,7 +21,8 @@ export class Android {
21
21
  }
22
22
 
23
23
  Android.instance = this;
24
- this.client = createClient();
24
+ this.client = Adb.createClient();
25
+
25
26
  this.id = get(
26
27
  options,
27
28
  'chrome.android.deviceSerial',
@@ -48,36 +49,34 @@ export class Android {
48
49
  }
49
50
  }
50
51
 
52
+ this.device = this.client.getDevice(this.id);
53
+
51
54
  if (!this.sdcard) {
52
55
  this.sdcard = await this._runCommandAndGet('echo $EXTERNAL_STORAGE');
53
56
  }
54
57
  }
55
58
 
56
59
  async _runCommand(command) {
57
- return this.client.shell(this.id, command);
60
+ return this.device.shell(command);
58
61
  }
59
62
 
60
63
  async _runCommandAndGet(command) {
61
- const data = await this.client.shell(this.id, command);
62
- const output = await util.readAll(data);
64
+ const data = await this.device.shell(command);
65
+ const output = await Adb.util.readAll(data);
63
66
  return output.toString().trim();
64
67
  }
65
68
 
66
69
  async _runAsRootAndGet(command) {
67
- const data = await this.client.shell(
68
- this.id,
69
- 'su - root -c "' + command + '"'
70
- );
71
- const output = await util.readAll(data);
70
+ const data = await this.device.shell('su - root -c "' + command + '"');
71
+ const output = await Adb.util.readAll(data);
72
72
  return output.toString().trim();
73
73
  }
74
74
 
75
75
  async _runAsRoot(command) {
76
- const data = await this.client.shell(
77
- this.id,
76
+ const data = await this.device.shell(
78
77
  'su - root -c "' + command + ' && echo SUCCESS || echo FAIL"'
79
78
  );
80
- const output = await util.readAll(data);
79
+ const output = await Adb.util.readAll(data);
81
80
  const result = output.toString().trim();
82
81
  if (result === 'FAIL') {
83
82
  log.error('Failing running as root:' + command);
@@ -88,7 +87,7 @@ export class Android {
88
87
  async _downloadFile(sourcePath, destinationPath) {
89
88
  log.trace(`Pulling to ${destinationPath} from ${sourcePath}`);
90
89
 
91
- const transfer = await this.client.pull(this.id, sourcePath);
90
+ const transfer = await this.device.pull(sourcePath);
92
91
 
93
92
  return new Promise((resolve, reject) => {
94
93
  transfer.on('end', function () {
@@ -100,7 +99,7 @@ export class Android {
100
99
  }
101
100
 
102
101
  async _downloadDir(sourcePath, destinationPath) {
103
- const files = await this.client.readdir(this.id, sourcePath);
102
+ const files = await this.device.readdir(sourcePath);
104
103
 
105
104
  for (const file of files) {
106
105
  const fullSourcePath = `${sourcePath}/${file.name}`;
@@ -141,7 +140,7 @@ export class Android {
141
140
  }
142
141
 
143
142
  async reboot() {
144
- await this.client.reboot(this.id);
143
+ await this.device.reboot(this.id);
145
144
  return delay(60_000);
146
145
  }
147
146
 
@@ -155,24 +154,24 @@ export class Android {
155
154
  }
156
155
 
157
156
  async getMeta() {
158
- const rawModel = await util.readAll(
157
+ const rawModel = await Adb.util.readAll(
159
158
  await this._runCommand(`getprop ro.product.model`)
160
159
  );
161
160
  const model = rawModel.toString().trim();
162
- const rawName = await util.readAll(
161
+ const rawName = await Adb.util.readAll(
163
162
  await this._runCommand(`getprop ro.product.name`)
164
163
  );
165
164
  const name = rawName.toString().trim();
166
- const rawDevice = await util.readAll(
165
+ const rawDevice = await Adb.util.readAll(
167
166
  await this._runCommand(`getprop ro.product.device`)
168
167
  );
169
168
  const device = rawDevice.toString().trim();
170
- const rawId = await util.readAll(
169
+ const rawId = await Adb.util.readAll(
171
170
  await this._runCommand(`getprop ro.serialno`)
172
171
  );
173
172
  const id = rawId.toString().trim();
174
173
  const wifi = await this.getWifi();
175
- const rawRelease = await util.readAll(
174
+ const rawRelease = await Adb.util.readAll(
176
175
  await this._runCommand(`getprop ro.build.version.release `)
177
176
  );
178
177
  const androidVersion = rawRelease.toString().trim();
@@ -187,8 +186,7 @@ export class Android {
187
186
  }
188
187
 
189
188
  async addDevtoolsFw() {
190
- return this.client.forward(
191
- this.id,
189
+ return this.device.forward(
192
190
  'tcp:' + this.port,
193
191
  'localabstract:chrome_devtools_remote'
194
192
  );
@@ -236,13 +234,13 @@ export class Android {
236
234
  }
237
235
 
238
236
  async getWifi() {
239
- const rawWifiInfo = await util.readAll(
237
+ const rawWifiInfo = await Adb.util.readAll(
240
238
  await this._runCommand(
241
239
  `dumpsys netstats | grep -E 'iface=wlan.*networkId'`
242
240
  )
243
241
  );
244
242
  const wifiInfo = rawWifiInfo.toString().trim();
245
- const wifi = wifiInfo.match(/"[^"]*"|^[^"]*$/)[0].replace(/"/g, '');
243
+ const wifi = wifiInfo.match(/"[^"]*"|^[^"]*$/)[0].replaceAll('"', '');
246
244
  return wifi;
247
245
  }
248
246
 
@@ -299,7 +297,7 @@ export class Android {
299
297
  const cmd1 = `pidof ${packageName}`;
300
298
  log.debug(`pidof ${cmd1}`);
301
299
  const proc1 = await this._runCommand(cmd1);
302
- const ps1 = await util.readAll(proc1);
300
+ const ps1 = await Adb.util.readAll(proc1);
303
301
  const ps = ps1.toString();
304
302
  log.debug(`pidof ${ps}`);
305
303
 
@@ -328,7 +326,7 @@ export class Android {
328
326
  const cmd = `ps`;
329
327
  log.debug(`pidof ${cmd}`);
330
328
  const proc = await this._runCommand(cmd);
331
- const psTemporary = await util.readAll(proc);
329
+ const psTemporary = await Adb.util.readAll(proc);
332
330
  const ps = psTemporary.toString();
333
331
  log.debug(`pidof ${ps}`);
334
332
 
@@ -382,7 +380,9 @@ export class Android {
382
380
  // `cut` and `awk`, to make this more robust.
383
381
  const cut = `echo $EPOCHREALTIME && cut -d ' ' -f 1 /proc/uptime && cut -d ' ' -f 22 /proc/self/stat /proc/${pid}/stat`;
384
382
  // const awk = `date +%s%3N && awk '{print $1}' /proc/uptime && awk '{print $22}' /proc/self/stat /proc/${pid}/stat`;
385
- const statAndTimestamp = await util.readAll(await this._runCommand(cut));
383
+ const statAndTimestamp = await Adb.util.readAll(
384
+ await this._runCommand(cut)
385
+ );
386
386
  const output = statAndTimestamp.toString();
387
387
 
388
388
  const [
@@ -129,7 +129,7 @@ export class Click {
129
129
  async byXpath(xpath) {
130
130
  try {
131
131
  // This is how Selenium do internally
132
- const replaced = xpath.replace(/"/g, "'");
132
+ const replaced = xpath.replaceAll('"', "'");
133
133
  const script = `document.evaluate("${replaced}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`;
134
134
  return this.browser.runScript(script, 'CUSTOM');
135
135
  } catch (error) {
@@ -148,7 +148,7 @@ export class Click {
148
148
  async byXpathAndWait(xpath) {
149
149
  try {
150
150
  // This is how Selenium do internally
151
- const replaced = xpath.replace(/"/g, "'");
151
+ const replaced = xpath.replaceAll('"', "'");
152
152
  const script = `document.evaluate("${replaced}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`;
153
153
  await this.browser.runScript(script, 'CUSTOM');
154
154
  return this.browser.extraWait(this.pageCompleteCheck);
@@ -114,10 +114,10 @@ export class Measure {
114
114
  // If we have tested pages before, but not in the making of
115
115
  // measuring a page, associate the error with that latest page.
116
116
  if (this.result.length > 0) {
117
- if (this.result[this.result.length - 1].error === undefined) {
118
- this.result[this.result.length - 1].error = [message];
117
+ if (this.result.at(-1).error === undefined) {
118
+ this.result.at(-1).error = [message];
119
119
  } else {
120
- this.result[this.result.length - 1].error.push(message);
120
+ this.result.at(-1).error.push(message);
121
121
  }
122
122
  } else {
123
123
  // error not associated to a start/run so far
@@ -6,7 +6,7 @@ const log = intel.getLogger('browsertime');
6
6
 
7
7
  function toSafeKey(key) {
8
8
  // U+2013 : EN DASH – as used on https://en.wikipedia.org/wiki/2019–20_coronavirus_pandemic
9
- return key.replace(/[ %&()+,./:?|~–]|%7C/g, '-');
9
+ return key.replaceAll(/[ %&()+,./:?|~–]|%7C/g, '-');
10
10
  }
11
11
 
12
12
  export function pathToFolder(url, options) {
@@ -59,7 +59,7 @@ export function pathToFolder(url, options) {
59
59
 
60
60
  for (const [index, segment] of pathSegments.entries()) {
61
61
  if (segment) {
62
- pathSegments[index] = segment.replace(/[^\w.\u0621-\u064A-]/gi, '-');
62
+ pathSegments[index] = segment.replaceAll(/[^\w.\u0621-\u064A-]/gi, '-');
63
63
  }
64
64
  }
65
65
 
@@ -23,7 +23,7 @@ const mkdir = promisify(_mkdir);
23
23
  const log = intel.getLogger('browsertime');
24
24
 
25
25
  const defaultDir = 'browsertime-results';
26
- let timestamp = dayjs().format().replace(/:/g, '');
26
+ let timestamp = dayjs().format().replaceAll(':', '');
27
27
 
28
28
  function pathNameFromUrl(url) {
29
29
  const parsedUrl = parse(url),
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "browsertime",
3
3
  "description": "Get performance metrics from your web page using Browsertime.",
4
- "version": "17.19.0",
4
+ "version": "18.0.0",
5
5
  "bin": "./bin/browsertime.js",
6
6
  "type": "module",
7
7
  "dependencies": {
8
8
  "@cypress/xvfb": "1.2.4",
9
- "@devicefarmer/adbkit": "2.11.3",
10
- "@sitespeed.io/chromedriver": "119.0.6045-59",
9
+ "@devicefarmer/adbkit": "3.2.5",
10
+ "@sitespeed.io/chromedriver": "119.0.6045-105",
11
11
  "@sitespeed.io/edgedriver": "119.0.2151-42",
12
12
  "@sitespeed.io/geckodriver": "0.33.0",
13
13
  "@sitespeed.io/throttle": "5.0.0",
@@ -16,11 +16,11 @@
16
16
  "btoa": "1.2.1",
17
17
  "chrome-har": "0.13.2",
18
18
  "chrome-remote-interface": "0.33.0",
19
- "dayjs": "1.11.9",
20
- "execa": "7.2.0",
19
+ "dayjs": "1.11.10",
20
+ "execa": "8.0.1",
21
21
  "fast-stats": "0.0.6",
22
22
  "find-up": "6.3.0",
23
- "get-port": "6.1.2",
23
+ "get-port": "7.0.0",
24
24
  "hasbin": "1.2.3",
25
25
  "intel": "1.2.0",
26
26
  "lodash.get": "4.4.2",
@@ -36,14 +36,14 @@
36
36
  "jimp": "0.22.10"
37
37
  },
38
38
  "devDependencies": {
39
- "ava": "5.1.0",
40
- "eslint": "8.31.0",
41
- "eslint-config-prettier": "8.6.0",
42
- "eslint-plugin-prettier": "4.2.1",
43
- "eslint-plugin-unicorn": "45.0.2",
44
- "prettier": "2.8.2",
39
+ "ava": "5.3.1",
40
+ "eslint": "8.53.0",
41
+ "eslint-config-prettier": "9.0.0",
42
+ "eslint-plugin-prettier": "5.0.1",
43
+ "eslint-plugin-unicorn": "49.0.0",
44
+ "prettier": "3.0.3",
45
45
  "serve-handler": "6.1.5",
46
- "serve": "14.1.2"
46
+ "serve": "14.2.1"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=14.19.1"