browsertime 25.2.0 → 25.3.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 +11 -1
- package/lib/chrome/har.js +14 -2
- package/lib/chrome/webdriver/chromium.js +3 -2
- package/lib/firefox/webdriver/firefox.js +11 -2
- package/lib/support/cli.js +5 -0
- package/lib/support/har/index.js +22 -0
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
-
## 25.
|
|
3
|
+
## 25.3.0 - 2025-10-17
|
|
4
|
+
### Added
|
|
5
|
+
* 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).
|
|
6
|
+
* Firefox 144 [#2331](https://github.com/sitespeedio/browsertime/pull/2331).
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
* Updated developer dependencies [#2326](https://github.com/sitespeedio/browsertime/pull/2326) and [#2327](https://github.com/sitespeedio/browsertime/pull/2327).
|
|
10
|
+
* Updated log dependency [#2328](https://github.com/sitespeedio/b23272327rowsertime/pull/2328)
|
|
11
|
+
|
|
12
|
+
## 25.2.0 - 2025-10-12
|
|
4
13
|
### Added
|
|
5
14
|
* 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
15
|
* Updated webdriver and bidi-har [#2322](https://github.com/sitespeedio/browsertime/pull/2322).
|
|
16
|
+
* 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
17
|
|
|
8
18
|
## 25.1.0 - 2025-09-05
|
|
9
19
|
### 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
|
}
|
|
@@ -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 {
|
|
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
|
|
package/lib/support/cli.js
CHANGED
|
@@ -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.',
|
package/lib/support/har/index.js
CHANGED
|
@@ -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
|
+
}
|
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.
|
|
4
|
+
"version": "25.3.0",
|
|
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.
|
|
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.
|
|
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
|
|
35
|
-
"ava": "6.4.
|
|
34
|
+
"@types/selenium-webdriver": "4.35.1",
|
|
35
|
+
"ava": "6.4.1",
|
|
36
36
|
"clean-jsdoc-theme": "4.3.0",
|
|
37
|
-
"eslint": "9.
|
|
38
|
-
"eslint-config-prettier": "10.1.
|
|
39
|
-
"eslint-plugin-prettier": "5.5.
|
|
40
|
-
"eslint-plugin-unicorn": "
|
|
41
|
-
"jsdoc": "4.0.
|
|
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.
|
|
43
|
+
"serve": "14.2.5",
|
|
44
44
|
"serve-handler": "6.1.6",
|
|
45
|
-
"typescript": "5.
|
|
45
|
+
"typescript": "5.9.3"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=20.0.0"
|