browsertime 23.4.5 → 24.0.0-alpha.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 +32 -1
- package/bin/browsertime.js +3 -2
- package/lib/android/gnirehtet.js +2 -2
- package/lib/android/index.js +2 -2
- package/lib/android/root.js +2 -2
- package/lib/chrome/chromeDevtoolsProtocol.js +4 -4
- package/lib/chrome/har.js +2 -2
- package/lib/chrome/networkManager.js +2 -2
- package/lib/chrome/parseCpuTrace.js +2 -2
- package/lib/chrome/traceCategoriesParser.js +2 -2
- package/lib/chrome/webdriver/builder.js +1 -2
- package/lib/chrome/webdriver/chromium.js +2 -2
- package/lib/chrome/webdriver/setupChromiumOptions.js +2 -2
- package/lib/chrome/webdriver/traceUtilities.js +2 -2
- package/lib/connectivity/humble.js +2 -2
- package/lib/connectivity/index.js +2 -2
- package/lib/core/engine/collector.js +2 -2
- package/lib/core/engine/command/addText.js +2 -2
- package/lib/core/engine/command/android.js +2 -2
- package/lib/core/engine/command/bidi.js +2 -2
- package/lib/core/engine/command/cache.js +2 -2
- package/lib/core/engine/command/chromeDevToolsProtocol.js +2 -2
- package/lib/core/engine/command/chromeTrace.js +2 -2
- package/lib/core/engine/command/click.js +2 -2
- package/lib/core/engine/command/debug.js +2 -2
- package/lib/core/engine/command/geckoProfiler.js +2 -2
- package/lib/core/engine/command/javaScript.js +2 -2
- package/lib/core/engine/command/measure.js +14 -3
- package/lib/core/engine/command/mouse/clickAndHold.js +2 -2
- package/lib/core/engine/command/mouse/contextClick.js +2 -2
- package/lib/core/engine/command/mouse/doubleClick.js +2 -2
- package/lib/core/engine/command/mouse/mouseMove.js +2 -2
- package/lib/core/engine/command/mouse/singleClick.js +2 -2
- package/lib/core/engine/command/navigation.js +2 -2
- package/lib/core/engine/command/screenshot.js +2 -2
- package/lib/core/engine/command/scroll.js +2 -2
- package/lib/core/engine/command/select.js +2 -2
- package/lib/core/engine/command/set.js +2 -2
- package/lib/core/engine/command/stopWatch.js +2 -2
- package/lib/core/engine/command/switch.js +2 -2
- package/lib/core/engine/command/wait.js +2 -2
- package/lib/core/engine/index.js +15 -16
- package/lib/core/engine/iteration.js +2 -2
- package/lib/core/seleniumRunner.js +8 -12
- package/lib/core/webdriver/index.js +1 -1
- package/lib/edge/webdriver/builder.js +3 -4
- package/lib/firefox/firefoxBidi.js +2 -2
- package/lib/firefox/geckoProfiler.js +2 -2
- package/lib/firefox/memoryReport.js +2 -2
- package/lib/firefox/networkManager.js +2 -2
- package/lib/firefox/perfStats.js +2 -2
- package/lib/firefox/webdriver/builder.js +3 -5
- package/lib/firefox/webdriver/firefox.js +2 -2
- package/lib/screenshot/index.js +7 -9
- package/lib/screenshot/loadCustomJimp.js +17 -0
- package/lib/support/browserScript.js +4 -5
- package/lib/support/cli.js +19 -5
- package/lib/support/dns.js +2 -2
- package/lib/support/engineUtils.js +4 -5
- package/lib/support/fileUtil.js +20 -3
- package/lib/support/getPort.js +25 -0
- package/lib/support/getViewPort.js +2 -2
- package/lib/support/har/index.js +5 -6
- package/lib/support/images/index.js +8 -17
- package/lib/support/logging.js +14 -39
- package/lib/support/pathToFolder.js +3 -3
- package/lib/support/preURL.js +2 -2
- package/lib/support/statistics.js +2 -2
- package/lib/support/stop.js +2 -2
- package/lib/support/storageManager.js +5 -5
- package/lib/support/userTiming.js +10 -0
- package/lib/support/util.js +73 -3
- package/lib/support/xvfb.js +55 -26
- package/lib/video/postprocessing/finetune/addTextToVideo.js +2 -2
- package/lib/video/postprocessing/finetune/convertFps.js +2 -2
- package/lib/video/postprocessing/finetune/index.js +2 -2
- package/lib/video/postprocessing/finetune/removeOrange.js +2 -2
- package/lib/video/postprocessing/visualmetrics/getVideoMetrics.js +2 -2
- package/lib/video/postprocessing/visualmetrics/visualMetrics.js +2 -2
- package/lib/video/screenRecording/android/recorder.js +2 -2
- package/lib/video/screenRecording/desktop/convert.js +2 -2
- package/lib/video/screenRecording/desktop/desktopRecorder.js +2 -2
- package/lib/video/screenRecording/desktop/ffmpegRecorder.js +2 -2
- package/lib/video/screenRecording/desktop/osx/getScreen.js +2 -2
- package/lib/video/screenRecording/firefox/firefoxWindowRecorder.js +2 -2
- package/lib/video/screenRecording/ios/convertToMp4.js +2 -2
- package/lib/video/screenRecording/ios/iosRecorder.js +2 -2
- package/lib/video/screenRecording/iosSimulator/convertToMp4.js +2 -2
- package/lib/video/screenRecording/iosSimulator/recorder.js +2 -2
- package/lib/video/screenRecording/setOrangeBackground.js +2 -2
- package/package.json +19 -24
- package/types/core/engine/command/measure.d.ts.map +1 -1
- package/types/support/engineUtils.d.ts.map +1 -1
- package/types/support/fileUtil.d.ts +1 -0
- package/types/support/fileUtil.d.ts.map +1 -1
- package/types/support/storageManager.d.ts +0 -1
- package/types/support/storageManager.d.ts.map +1 -1
- package/types/support/userTiming.d.ts +1 -0
- package/types/support/userTiming.d.ts.map +1 -1
- package/types/support/util.d.ts +3 -0
- package/types/support/util.d.ts.map +1 -1
- package/types/video/defaults.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 24.0.0-alpha.1 - 2025-01-07
|
|
4
|
+
### Fixed
|
|
5
|
+
* Replace dependencies with local implementation:
|
|
6
|
+
* Replace btoa [#2233](https://github.com/sitespeedio/browsertime/pull/2233).
|
|
7
|
+
* Replace hasbin [#2234](https://github.com/sitespeedio/browsertime/pull/2234).
|
|
8
|
+
* Replace DayJS [#2235](https://github.com/sitespeedio/browsertime/pull/2235).
|
|
9
|
+
* Replace lodash.pick [#2237](https://github.com/sitespeedio/browsertime/pull/2237).
|
|
10
|
+
* Replace lodash.groupBy [#2238](https://github.com/sitespeedio/browsertime/pull/2238).
|
|
11
|
+
* Replace find-up [#2240](https://github.com/sitespeedio/browsertime/pull/2240).
|
|
12
|
+
* Replace lodash.isEmpty [#2241](https://github.com/sitespeedio/browsertime/pull/2241).
|
|
13
|
+
* Replace get-port [#2242](https://github.com/sitespeedio/browsertime/pull/2242).
|
|
14
|
+
* Replace jimp with jimp custom [#2243](https://github.com/sitespeedio/browsertime/pull/2243).
|
|
15
|
+
* Replace @cypress/xvfb [#2245](https://github.com/sitespeedio/browsertime/pull/2245).
|
|
16
|
+
* Replace intel (log) with sitespeed.io/log [#2246](https://github.com/sitespeedio/browsertime/pull/2246).
|
|
17
|
+
* Fix Docker file ENV to follow the new standard [#2239](https://github.com/sitespeedio/browsertime/pull/2239).
|
|
18
|
+
* Edgedriver 131 [#2236](https://github.com/sitespeedio/browsertime/pull/2236).
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## 23.5.0 - 2024-12-23
|
|
22
|
+
### Added
|
|
23
|
+
* Added `--userTimingBlockList` [#2227](https://github.com/sitespeedio/browsertime/pull/2227).
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
* Updated to webdriver 4.28 [#2226](https://github.com/sitespeedio/browsertime/pull/2226).
|
|
27
|
+
* Updated dev dependencies [#2228](https://github.com/sitespeedio/browsertime/pull/2228).
|
|
28
|
+
* Fix so the check for gnirehtet always use --android.gnirehtet to fix problens setting it in sitespeed.io [#2229](https://github.com/sitespeedio/browsertime/pull/2229).
|
|
29
|
+
* Update to execa 9.5.2 [#2231](https://github.com/sitespeedio/browsertime/pull/2231).
|
|
30
|
+
* Update to adbkit 3.3.8 [#2232](https://github.com/sitespeedio/browsertime/pull/2232).
|
|
31
|
+
* Fix so you cannot use gnirehtet with webpagereplay [#2230](https://github.com/sitespeedio/browsertime/pull/2230).
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 23.4.5 - 2024-12-20
|
|
4
35
|
### Fixed
|
|
5
36
|
* Change bottom margin from 10 to 14 pixel when recoring a video on mobile, se bug [#2224](https://github.com/sitespeedio/browsertime/issues/2224) and PR [#2225](https://github.com/sitespeedio/browsertime/pull/2225).
|
|
6
37
|
|
package/bin/browsertime.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import merge from 'lodash.merge';
|
|
3
3
|
import get from 'lodash.get';
|
|
4
4
|
import set from 'lodash.set';
|
|
5
|
-
import
|
|
5
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
6
6
|
import { existsSync, mkdirSync } from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { Engine } from '../lib/core/engine/index.js';
|
|
@@ -17,7 +17,7 @@ import { StorageManager } from '../lib/support/storageManager.js';
|
|
|
17
17
|
import { loadScript } from '../lib/support/engineUtils.js';
|
|
18
18
|
import { isAndroidConfigured } from '../lib/android/index.js';
|
|
19
19
|
|
|
20
|
-
const log =
|
|
20
|
+
const log = getLogger('browsertime');
|
|
21
21
|
const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
|
|
22
22
|
const delay = ms => new Promise(response => setTimeout(response, ms));
|
|
23
23
|
|
|
@@ -193,6 +193,7 @@ async function run(urls, options) {
|
|
|
193
193
|
}
|
|
194
194
|
} catch (error) {
|
|
195
195
|
log.error('Error running browsertime', error);
|
|
196
|
+
console.log(error);
|
|
196
197
|
process.exitCode = 1;
|
|
197
198
|
} finally {
|
|
198
199
|
process.exit();
|
package/lib/android/gnirehtet.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
|
-
import
|
|
3
|
-
const log =
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
|
+
const log = getLogger('browsertime.gnirehtet');
|
|
4
4
|
const delay = ms => new Promise(response => setTimeout(response, ms));
|
|
5
5
|
|
|
6
6
|
export class Gnirehtet {
|
package/lib/android/index.js
CHANGED
|
@@ -3,13 +3,13 @@ import { mkdir as _mkdir, createWriteStream } from 'node:fs';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { EOL as endOfLine } from 'node:os';
|
|
5
5
|
import { execa } from 'execa';
|
|
6
|
-
import
|
|
6
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
7
7
|
import pkg from '@devicefarmer/adbkit';
|
|
8
8
|
import usbPowerProfiler from 'usb-power-profiling/usb-power-profiling.js';
|
|
9
9
|
const { Adb } = pkg;
|
|
10
10
|
import get from 'lodash.get';
|
|
11
11
|
import { pathToFolder } from '../support/pathToFolder.js';
|
|
12
|
-
const log =
|
|
12
|
+
const log = getLogger('browsertime.android');
|
|
13
13
|
const mkdir = promisify(_mkdir);
|
|
14
14
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
15
15
|
|
package/lib/android/root.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.android');
|
|
3
3
|
|
|
4
4
|
// Adopted from
|
|
5
5
|
// https://dxr.mozilla.org/mozilla-central/source/testing/raptor/raptor/performance_tuning.py
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import CDP from 'chrome-remote-interface';
|
|
3
|
-
|
|
4
|
-
const log = intel.getLogger('browsertime.chrome.cdp');
|
|
3
|
+
const log = getLogger('browsertime.chrome.cdp');
|
|
5
4
|
import { toArray } from '../support/util.js';
|
|
6
5
|
import { traceCategories as defaultTraceCategories } from './settings/traceCategories.js';
|
|
7
6
|
|
|
@@ -107,7 +106,8 @@ export class ChromeDevtoolsProtocol {
|
|
|
107
106
|
|
|
108
107
|
async setBasicAuth(basicAuth) {
|
|
109
108
|
const parts = basicAuth.split('@');
|
|
110
|
-
const basic =
|
|
109
|
+
const basic =
|
|
110
|
+
'Basic ' + Buffer.from(parts[0] + ':' + parts[1]).toString('base64');
|
|
111
111
|
await this.cdpClient.Network.setExtraHTTPHeaders({
|
|
112
112
|
headers: { Authorization: basic }
|
|
113
113
|
});
|
package/lib/chrome/har.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { harFromMessages } from 'chrome-har';
|
|
3
3
|
import { logging } from 'selenium-webdriver';
|
|
4
|
-
const log =
|
|
4
|
+
const log = getLogger('browsertime.chrome');
|
|
5
5
|
import { addBrowser } from '../support/har/index.js';
|
|
6
6
|
const { Type } = logging;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import get from 'lodash.get';
|
|
3
3
|
|
|
4
|
-
const log =
|
|
4
|
+
const log = getLogger('browsertime.chrome.network');
|
|
5
5
|
|
|
6
6
|
export class NetworkManager {
|
|
7
7
|
constructor(cdpClient, options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { computeMainThreadTasks } from '@sitespeed.io/tracium';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.chrome.cpu');
|
|
4
4
|
|
|
5
5
|
function round(number_, decimals = 3) {
|
|
6
6
|
const pow = Math.pow(10, decimals);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.chrome.trace');
|
|
3
3
|
|
|
4
4
|
// Adopting the Lighthouse way to clean the Trace log
|
|
5
5
|
// https://github.com/GoogleChrome/lighthouse/blob/50a68ab2bf0115427e767e5e40dfe6be671902fe/lighthouse-core/config/config.js#L29-L110
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import pick from 'lodash.pick';
|
|
2
|
-
import isEmpty from 'lodash.isempty';
|
|
3
1
|
import get from 'lodash.get';
|
|
4
2
|
import { logging } from 'selenium-webdriver';
|
|
5
3
|
import { ServiceBuilder, Options } from 'selenium-webdriver/chrome.js';
|
|
6
4
|
import { pac, manual } from 'selenium-webdriver/proxy.js';
|
|
7
5
|
import { setupChromiumOptions } from './setupChromiumOptions.js';
|
|
6
|
+
import { pick, isEmpty } from '../../support/util.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Configure a WebDriver builder based on the specified options.
|
|
@@ -2,9 +2,9 @@ import { promisify } from 'node:util';
|
|
|
2
2
|
import { unlink as _unlink, rm as _rm } from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { logging } from 'selenium-webdriver';
|
|
5
|
-
import
|
|
5
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
6
6
|
import usbPowerProfiler from 'usb-power-profiling/usb-power-profiling.js';
|
|
7
|
-
const log =
|
|
7
|
+
const log = getLogger('browsertime.chrome');
|
|
8
8
|
const { Type } = logging;
|
|
9
9
|
import { longTaskMetrics } from '../longTaskMetrics.js';
|
|
10
10
|
import { parseCPUTrace } from '../parseCpuTrace.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
|
-
import
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
3
|
import { chromeDesktopOptions as defaultChromeOptions } from '../settings/chromeDesktopOptions.js';
|
|
4
4
|
import { chromeAndroidOptions as defaultAndroidChromeOptions } from '../settings/chromeAndroidOptions.js';
|
|
5
5
|
import { getViewPort } from '../../support/getViewPort.js';
|
|
6
6
|
import { toArray } from '../../support/util.js';
|
|
7
7
|
import { isAndroidConfigured } from '../../android/index.js';
|
|
8
|
-
const log =
|
|
8
|
+
const log = getLogger('browsertime.chrome');
|
|
9
9
|
|
|
10
10
|
const CHROME_AMD_EDGE_INTERNAL_PHONE_HOME = [
|
|
11
11
|
'MAP cache.pack.google.com 127.0.0.1',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.chrome');
|
|
3
3
|
|
|
4
4
|
function getLargestContentfulPaintEvent(traceEvents) {
|
|
5
5
|
const lcpCandidates = traceEvents.filter(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
2
|
import https from 'node:https';
|
|
3
3
|
import get from 'lodash.get';
|
|
4
|
-
import
|
|
5
|
-
const log =
|
|
4
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
5
|
+
const log = getLogger('browsertime.connectivity.humble');
|
|
6
6
|
|
|
7
7
|
export class Humble {
|
|
8
8
|
constructor(options) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import get from 'lodash.get';
|
|
2
|
-
import
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
3
|
import {
|
|
4
4
|
start as throttleStart,
|
|
5
5
|
stop as throttleStop
|
|
6
6
|
} from '@sitespeed.io/throttle';
|
|
7
|
-
const log =
|
|
7
|
+
const log = getLogger('browsertime.connectivity');
|
|
8
8
|
import { Humble } from './humble.js';
|
|
9
9
|
import { parseTrafficShapeConfig } from './trafficShapeParser.js';
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import get from 'lodash.get';
|
|
4
|
-
import
|
|
4
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
5
5
|
import { timestamp as _timestamp } from '../../support/engineUtils.js';
|
|
6
6
|
import { Statistics } from '../../support/statistics.js';
|
|
7
7
|
import { pathToFolder } from '../../support/pathToFolder.js';
|
|
@@ -9,7 +9,7 @@ import { getConnectivitySettings } from '../../connectivity/index.js';
|
|
|
9
9
|
import { formatMetric } from '../../support/util.js';
|
|
10
10
|
const require = createRequire(import.meta.url);
|
|
11
11
|
const version = require('../../../package.json').version;
|
|
12
|
-
const log =
|
|
12
|
+
const log = getLogger('browsertime');
|
|
13
13
|
|
|
14
14
|
function getNewResult(url, options) {
|
|
15
15
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { By } from 'selenium-webdriver';
|
|
2
|
-
import
|
|
3
|
-
const log =
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
|
+
const log = getLogger('browsertime.command.addText');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Provides functionality to add text to elements on a web page using various selectors.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { Android, isAndroidConfigured } from '../../../android/index.js';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.command.android');
|
|
4
4
|
/**
|
|
5
5
|
* Provides functionality to interact with an Android device through shell commands.
|
|
6
6
|
* @class
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.bidi');
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Manages interactions using Bidi. At the moment this only works for Firefox
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.cache');
|
|
3
3
|
/**
|
|
4
4
|
* Manage the browser cache.
|
|
5
5
|
* This class provides methods to clear the cache and cookies in different browsers.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.devtoolsprotocol');
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Manages interactions with the Chrome DevTools Protocol for Chrome and Edge browsers.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
|
|
3
3
|
import { getRenderBlocking } from '../../../chrome/webdriver/traceUtilities.js';
|
|
4
4
|
import { parse } from '../../../chrome/traceCategoriesParser.js';
|
|
5
5
|
import { parseCPUTrace } from '../../../chrome/parseCpuTrace.js';
|
|
6
|
-
const log =
|
|
6
|
+
const log = getLogger('browsertime.command.chrometrace');
|
|
7
7
|
/**
|
|
8
8
|
* Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome.
|
|
9
9
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.geckoprofiler');
|
|
3
3
|
/**
|
|
4
4
|
* Manages the Gecko Profiler for profiling Firefox performance.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.javascript');
|
|
3
3
|
/**
|
|
4
4
|
* Provides functionality to execute JavaScript code in the context of the current page.
|
|
5
5
|
*
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
3
|
import get from 'lodash.get';
|
|
4
4
|
import merge from 'lodash.merge';
|
|
5
5
|
import { timestamp as _timestamp } from '../../../support/engineUtils.js';
|
|
6
6
|
import { Video } from '../../../video/video.js';
|
|
7
7
|
import { pathToFolder } from '../../../support/pathToFolder.js';
|
|
8
8
|
import { setOrangeBackground } from '../../../video/screenRecording/setOrangeBackground.js';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
filterAllowlisted,
|
|
11
|
+
filterBlocklisted
|
|
12
|
+
} from '../../../support/userTiming.js';
|
|
10
13
|
import { isAndroidConfigured, Android } from '../../../android/index.js';
|
|
11
14
|
import { TCPDump } from '../../../support/tcpdump.js';
|
|
12
15
|
import { lcpHighlightScript as highlightLargestContentfulPaint } from './util/lcpHighlightScript.js';
|
|
13
16
|
import { clsHighlightScript as highlightLS } from './util/lsHighlightScript.js';
|
|
14
17
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
15
|
-
const log =
|
|
18
|
+
const log = getLogger('browsertime.command.measure');
|
|
16
19
|
|
|
17
20
|
// In some cases we could have one alias mapped to multiple URLs
|
|
18
21
|
// we've seen it for login etc where the user get different query parameter
|
|
@@ -643,6 +646,14 @@ export class Measure {
|
|
|
643
646
|
);
|
|
644
647
|
}
|
|
645
648
|
|
|
649
|
+
if (this.options.userTimingBlockList) {
|
|
650
|
+
filterBlocklisted(
|
|
651
|
+
this.result[this.numberOfMeasuredPages].browserScripts.timings
|
|
652
|
+
.userTimings,
|
|
653
|
+
this.options.userTimingAllowList
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
|
|
646
657
|
if (isAndroidConfigured(this.options) && this.options.processStartTime) {
|
|
647
658
|
const packageName =
|
|
648
659
|
this.options.browser === 'firefox'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { By, Origin } from 'selenium-webdriver';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.command.mouse');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Provides functionality to click and hold elements on a web page using different strategies.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { By } from 'selenium-webdriver';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.command.mouse');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Provides functionality to perform a context click (right-click) on elements in a web page.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { By } from 'selenium-webdriver';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.command.mouse');
|
|
4
4
|
/**
|
|
5
5
|
* Provides functionality to perform a double-click action on elements in a web page.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { By, Origin } from 'selenium-webdriver';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.command.mouse');
|
|
4
4
|
/**
|
|
5
5
|
* Provides functionality to move the mouse cursor to elements or specific positions on a web page.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { By } from 'selenium-webdriver';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.command.mouse');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Provides functionality to perform a single click action on elements or at specific positions in a web page. Uses Seleniums Action API.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.navigation');
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Provides functionality to control browser navigation such as back, forward, and refresh actions.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.screenshot');
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Take a screenshot. The screenshot will be stored to disk,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.select');
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Provides functionality to interact with `<select>` elements on a web page.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const log =
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
|
+
const log = getLogger('browsertime.command.set');
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Provides functionality to set properties like innerHTML, innerText, and value on elements in a web page.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
|
-
import
|
|
3
|
-
const log =
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
|
+
const log = getLogger('browsertime.command.stopwatch');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A stopwatch utility for measuring time intervals.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
2
2
|
import { By } from 'selenium-webdriver';
|
|
3
|
-
const log =
|
|
3
|
+
const log = getLogger('browsertime.command.switch');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Provides functionality to switch between frames, windows, and tabs in the browser.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import webdriver from 'selenium-webdriver';
|
|
2
|
-
import
|
|
3
|
-
const log =
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
|
+
const log = getLogger('browsertime.command.wait');
|
|
4
4
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
5
5
|
|
|
6
6
|
/**
|
package/lib/core/engine/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { arch as _arch } from 'node:os';
|
|
2
|
-
import
|
|
2
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
3
3
|
import merge from 'lodash.merge';
|
|
4
|
-
import getPort, { portNumbers } from 'get-port';
|
|
5
4
|
import { execaCommand as command } from 'execa';
|
|
6
5
|
import get from 'lodash.get';
|
|
7
6
|
import { StorageManager } from '../../support/storageManager.js';
|
|
@@ -31,7 +30,8 @@ import {
|
|
|
31
30
|
loadScript,
|
|
32
31
|
loadPageCompleteScript
|
|
33
32
|
} from '../../support/engineUtils.js';
|
|
34
|
-
|
|
33
|
+
import { getAvailablePort } from '../../support/getPort.js';
|
|
34
|
+
const log = getLogger('browsertime');
|
|
35
35
|
const defaults = {
|
|
36
36
|
scripts: [],
|
|
37
37
|
iterations: 3,
|
|
@@ -52,9 +52,9 @@ function shouldDelay(index, total, delay) {
|
|
|
52
52
|
export class Engine {
|
|
53
53
|
constructor(options) {
|
|
54
54
|
this.options = merge({}, defaults, options);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
|
|
56
|
+
log.debug('Running with options: %:2j', this.options);
|
|
57
|
+
|
|
58
58
|
this.myXVFB = new XVFB(this.options);
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -67,19 +67,13 @@ export class Engine {
|
|
|
67
67
|
async start() {
|
|
68
68
|
const options = this.options;
|
|
69
69
|
|
|
70
|
-
options.devToolsPort = await
|
|
71
|
-
port: portNumbers(9222, 9350),
|
|
72
|
-
host: '127.0.0.1'
|
|
73
|
-
});
|
|
70
|
+
options.devToolsPort = await getAvailablePort([9222, 9350]);
|
|
74
71
|
|
|
75
72
|
log.debug(
|
|
76
73
|
`Preparing port ${options.devToolsPort} for devtools on Chrome/Edge`
|
|
77
74
|
);
|
|
78
75
|
|
|
79
|
-
options.safariDriverPort = await
|
|
80
|
-
port: portNumbers(1234, 2000),
|
|
81
|
-
host: '127.0.0.1'
|
|
82
|
-
});
|
|
76
|
+
options.safariDriverPort = await getAvailablePort([1234, 2000]);
|
|
83
77
|
|
|
84
78
|
if (options.browser === 'safari' && options.safari.ios && options.video) {
|
|
85
79
|
await IOSRecorder.activate();
|
|
@@ -93,7 +87,7 @@ export class Engine {
|
|
|
93
87
|
await android._init();
|
|
94
88
|
this.android = android;
|
|
95
89
|
|
|
96
|
-
if (options.gnirehtet === true) {
|
|
90
|
+
if (options.android.gnirehtet === true && !options.webpagereplay) {
|
|
97
91
|
this.gnirehtet = new Gnirehtet(options);
|
|
98
92
|
await this.gnirehtet.start();
|
|
99
93
|
}
|
|
@@ -520,7 +514,12 @@ export class Engine {
|
|
|
520
514
|
}
|
|
521
515
|
}
|
|
522
516
|
|
|
523
|
-
if (
|
|
517
|
+
if (
|
|
518
|
+
!options.webpagereplay &&
|
|
519
|
+
options.android &&
|
|
520
|
+
options.android.gnirehtet === true &&
|
|
521
|
+
this.gnirehtet
|
|
522
|
+
) {
|
|
524
523
|
await this.gnirehtet.stop();
|
|
525
524
|
}
|
|
526
525
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { platform } from 'node:os';
|
|
2
2
|
import webdriver from 'selenium-webdriver';
|
|
3
|
-
import
|
|
3
|
+
import { getLogger } from '@sitespeed.io/log';
|
|
4
4
|
|
|
5
5
|
import { Context } from './context.js';
|
|
6
6
|
import { Commands } from './commands.js';
|
|
@@ -23,7 +23,7 @@ import { flushDNS } from '../../support/dns.js';
|
|
|
23
23
|
|
|
24
24
|
import { getNumberOfRunningProcesses } from '../../support/processes.js';
|
|
25
25
|
import { isAndroidConfigured, Android } from '../../android/index.js';
|
|
26
|
-
const log =
|
|
26
|
+
const log = getLogger('browsertime');
|
|
27
27
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
28
28
|
|
|
29
29
|
// Make this configurable
|