browsertime 25.2.0 → 25.3.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/CHANGELOG.md CHANGED
@@ -1,9 +1,24 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
- ## 25.1.0 - 2025-10-12
3
+ ## 25.3.1 - 2025-10-24
4
+ ### Fixed
5
+ * Better handling of closing XVFB [#2332](https://github.com/sitespeedio/browsertime/pull/2332).
6
+ * Firefox: Disable quicksuggest [#2333](https://github.com/sitespeedio/browsertime/pull/2333).
7
+
8
+ ## 25.3.0 - 2025-10-17
9
+ ### Added
10
+ * Make it possible to strip cookie and auth headers in the HAR file for Firefox [#2329](https://github.com/sitespeedio/browsertime/pull/2329) and Chrome [#2330](https://github.com/sitespeedio/browsertime/pull/2330). Use `--cleanSensitiveHeaders` to remove a [couple of headers](https://github.com/sitespeedio/browsertime/blob/main/lib/support/har/index.js#L11-L24).
11
+ * Firefox 144 [#2331](https://github.com/sitespeedio/browsertime/pull/2331).
12
+
13
+ ### Fixed
14
+ * Updated developer dependencies [#2326](https://github.com/sitespeedio/browsertime/pull/2326) and [#2327](https://github.com/sitespeedio/browsertime/pull/2327).
15
+ * Updated log dependency [#2328](https://github.com/sitespeedio/b23272327rowsertime/pull/2328)
16
+
17
+ ## 25.2.0 - 2025-10-12
4
18
  ### Added
5
19
  * Updated to Chrome/Chromedriver/Edge/Edgedriver 141, Firefox 143 [#2325](https://github.com/sitespeedio/browsertime/pull/2325) and [#2323](https://github.com/sitespeedio/browsertime/pull/2323).
6
20
  * Updated webdriver and bidi-har [#2322](https://github.com/sitespeedio/browsertime/pull/2322).
21
+ * Added simpleperf and perfetto support for Android, thank you [Abhishek Nimalan](https://github.com/animalan) for PR [#2315](https://github.com/sitespeedio/browsertime/pull/2315).
7
22
 
8
23
  ## 25.1.0 - 2025-09-05
9
24
  ### Added
package/lib/chrome/har.js CHANGED
@@ -2,7 +2,7 @@ import { getLogger } from '@sitespeed.io/log';
2
2
  import { harFromMessages } from 'chrome-har';
3
3
  import { logging } from 'selenium-webdriver';
4
4
  const log = getLogger('browsertime.chrome');
5
- import { addBrowser } from '../support/har/index.js';
5
+ import { addBrowser, cleanSensitiveHeaders } from '../support/har/index.js';
6
6
  const { Type } = logging;
7
7
 
8
8
  export async function getHar(
@@ -15,7 +15,8 @@ export async function getHar(
15
15
  mobileEmulation,
16
16
  androidClient,
17
17
  chrome,
18
- aliasAndUrl
18
+ aliasAndUrl,
19
+ cleanHeaders
19
20
  ) {
20
21
  log.debug('Getting performance logs from Chrome');
21
22
 
@@ -34,6 +35,17 @@ export async function getHar(
34
35
 
35
36
  const har = harFromMessages(messages);
36
37
 
38
+ if (cleanHeaders === true) {
39
+ for (const entry of har.log.entries ?? []) {
40
+ for (const header of entry.request?.headers ?? []) {
41
+ header.value = cleanSensitiveHeaders(header.name, header.value);
42
+ }
43
+ for (const header of entry.response?.headers ?? []) {
44
+ header.value = cleanSensitiveHeaders(header.name, header.value);
45
+ }
46
+ }
47
+ }
48
+
37
49
  if (includeResponseBodies === 'html' || includeResponseBodies === 'all') {
38
50
  await cdpClient.setResponseBodies(har);
39
51
  }
@@ -227,7 +227,7 @@ export class Chromium {
227
227
  const minLength = ${this.options.minLongTaskLength || 50};
228
228
  const observer = new PerformanceObserver(list => {});
229
229
  observer.observe({type: 'longtask', buffered: true});
230
- const entries = observer.takeRecords();
230
+ const entries = observer.takeRecords();
231
231
  const cleaned = [];
232
232
  for (let event of entries) {
233
233
  if (event.duration >= minLength) {
@@ -319,7 +319,8 @@ export class Chromium {
319
319
  this.chrome.mobileEmulation,
320
320
  this.android,
321
321
  this.chrome,
322
- this.aliasAndUrl
322
+ this.aliasAndUrl,
323
+ this.options.cleanSensitiveHeaders
323
324
  )
324
325
  );
325
326
  }
@@ -204,5 +204,10 @@ export const defaultFirefoxPreferences = {
204
204
  // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/preferences.html
205
205
  'telemetry.fog.test.localhost_port': -1,
206
206
  'telemetry.fog.test.activity_limit': -1,
207
- 'telemetry.fog.test.inactivity_limit': -1
207
+ 'telemetry.fog.test.inactivity_limit': -1,
208
+
209
+ 'browser.urlbar.suggest.quicksuggest': false,
210
+ 'browser.urlbar.groupLabels.enabled': false,
211
+ 'browser.urlbar.suggest.quicksuggest.nonsponsored': false,
212
+ 'browser.urlbar.suggest.quicksuggest.sponsored': false
208
213
  };
@@ -3,7 +3,11 @@ import { promisify } from 'node:util';
3
3
  import path from 'node:path';
4
4
  import { getLogger } from '@sitespeed.io/log';
5
5
  import { adapters } from 'ff-test-bidi-har-export';
6
- import { getEmptyHAR, mergeHars } from '../../support/har/index.js';
6
+ import {
7
+ getEmptyHAR,
8
+ mergeHars,
9
+ cleanSensitiveHeaders
10
+ } from '../../support/har/index.js';
7
11
  import { loadUsbPowerProfiler } from '../../support/usbPower.js';
8
12
  import { pathToFolder } from '../../support/pathToFolder.js';
9
13
  import { isAndroidConfigured, Android } from '../../android/index.js';
@@ -63,7 +67,12 @@ export class Firefox {
63
67
  browsingContextIds: [this.windowId],
64
68
  debugLogs:
65
69
  this.options.verbose >= 2 || this.firefoxConfig.enableBidiHarLog,
66
- driver: runner.getDriver()
70
+ driver: runner.getDriver(),
71
+ headerValueFormatter: this.options.cleanSensitiveHeaders
72
+ ? cleanSensitiveHeaders
73
+ : function (name, value) {
74
+ return value;
75
+ }
67
76
  });
68
77
  }
69
78
 
@@ -1217,6 +1217,11 @@ export function parseCommandLine() {
1217
1217
  type: 'boolean',
1218
1218
  describe: 'Pass --gzipHar to gzip the HAR file'
1219
1219
  })
1220
+ .option('cleanSensitiveHeaders', {
1221
+ type: 'boolean',
1222
+ describe:
1223
+ 'Pass --cleanSensitiveHeaders to remove sensitive headers in the HAR file'
1224
+ })
1220
1225
  .option('config', {
1221
1226
  describe:
1222
1227
  'Path to JSON config file. You can also use a .browsertime.json file that will automatically be found by Browsertime using find-up.',
@@ -8,6 +8,21 @@ const require = createRequire(import.meta.url);
8
8
  const version = require('../../../package.json').version;
9
9
  import { pick, isEmpty, getProperty } from '../../support/util.js';
10
10
 
11
+ const sensitiveHeaders = new Set([
12
+ 'authorization',
13
+ 'proxy-authorization',
14
+ 'cookie',
15
+ 'set-cookie',
16
+ 'x-api-key',
17
+ 'x-auth-token',
18
+ 'x-access-token',
19
+ 'x-client-secret',
20
+ 'x-csrf-token',
21
+ 'x-xsrf-token',
22
+ 'x-amz-security-token',
23
+ 'x-amz-signature'
24
+ ]);
25
+
11
26
  function generateUniquePageId(baseId, existingIdMap) {
12
27
  let newId = baseId;
13
28
  while (existingIdMap.has(newId)) {
@@ -385,3 +400,10 @@ export function addExtraFieldsToHar(totalResults, har, options) {
385
400
  }
386
401
  }
387
402
  }
403
+
404
+ export function cleanSensitiveHeaders(name, value) {
405
+ if (sensitiveHeaders.has(name.toLowerCase())) {
406
+ return '[REMOVED]';
407
+ }
408
+ return value;
409
+ }
@@ -42,8 +42,7 @@ export async function startXvfb({ size, options }) {
42
42
  });
43
43
 
44
44
  const xvfbProcess = execa(command, args, {
45
- stdio: silent ? 'ignore' : 'inherit',
46
- detached: true
45
+ stdio: silent ? 'ignore' : 'inherit'
47
46
  });
48
47
 
49
48
  xvfbProcess.catch(error => {
@@ -70,10 +69,20 @@ export async function stopXvfb(xvfbSession) {
70
69
 
71
70
  try {
72
71
  xvfbSession.process.kill('SIGTERM');
73
- await xvfbSession.process;
74
72
  } catch {
75
73
  // Just swallow
76
74
  }
75
+
76
+ const timeout = 1000;
77
+ const start = Date.now();
78
+ while (Date.now() - start < timeout) {
79
+ try {
80
+ process.kill(xvfbSession.process.pid, 0);
81
+ await new Promise(resolve => setTimeout(resolve, 100));
82
+ } catch {
83
+ return;
84
+ }
85
+ }
77
86
  }
78
87
 
79
88
  export class XVFB {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "browsertime",
3
3
  "description": "Get performance metrics from your web page using Browsertime.",
4
- "version": "25.2.0",
4
+ "version": "25.3.1",
5
5
  "bin": "./bin/browsertime.js",
6
6
  "type": "module",
7
7
  "types": "./types/scripting.d.ts",
@@ -10,10 +10,10 @@
10
10
  "@sitespeed.io/chromedriver": "141.0.7390-76",
11
11
  "@sitespeed.io/edgedriver": "141.0.3537-71",
12
12
  "@sitespeed.io/geckodriver": "0.36.0",
13
- "@sitespeed.io/log": "0.2.6",
13
+ "@sitespeed.io/log": "1.0.0",
14
14
  "@sitespeed.io/throttle": "5.0.1",
15
15
  "@sitespeed.io/tracium": "0.3.3",
16
- "chrome-har": "1.0.1",
16
+ "chrome-har": "1.1.1",
17
17
  "chrome-remote-interface": "0.33.3",
18
18
  "execa": "9.6.0",
19
19
  "fast-stats": "0.0.7",
@@ -31,18 +31,18 @@
31
31
  "usb-power-profiling": "1.6.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/selenium-webdriver": "4.1.25",
35
- "ava": "6.4.0",
34
+ "@types/selenium-webdriver": "4.35.1",
35
+ "ava": "6.4.1",
36
36
  "clean-jsdoc-theme": "4.3.0",
37
- "eslint": "9.30.1",
38
- "eslint-config-prettier": "10.1.5",
39
- "eslint-plugin-prettier": "5.5.1",
40
- "eslint-plugin-unicorn": "59.0.1",
41
- "jsdoc": "4.0.4",
37
+ "eslint": "9.37.0",
38
+ "eslint-config-prettier": "10.1.8",
39
+ "eslint-plugin-prettier": "5.5.4",
40
+ "eslint-plugin-unicorn": "61.0.2",
41
+ "jsdoc": "4.0.5",
42
42
  "prettier": "3.6.2",
43
- "serve": "14.2.4",
43
+ "serve": "14.2.5",
44
44
  "serve-handler": "6.1.6",
45
- "typescript": "5.7.2"
45
+ "typescript": "5.9.3"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=20.0.0"