browsertime 17.0.0-beta.4 → 17.1.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 +30 -13
- package/bin/browsertime.js +4 -4
- package/bin/browsertimeWebPageReplay.js +2 -2
- package/browsertime/visualmetrics-portable.py +54 -50
- package/index.js +2 -2
- package/lib/android/gnirehtet.js +1 -2
- package/lib/android/root.js +57 -16
- package/lib/chrome/chromeDevtoolsProtocol.js +6 -3
- package/lib/chrome/har.js +1 -1
- package/lib/chrome/longTaskMetrics.js +1 -1
- package/lib/chrome/parseCpuTrace.js +2 -2
- package/lib/chrome/settings/chromeAndroidOptions.js +1 -1
- package/lib/chrome/settings/chromeDesktopOptions.js +1 -1
- package/lib/chrome/settings/traceCategories.js +1 -1
- package/lib/chrome/traceCategoriesParser.js +3 -3
- package/lib/chrome/webdriver/builder.js +1 -1
- package/lib/chrome/webdriver/chromium.js +13 -17
- package/lib/chrome/webdriver/setupChromiumOptions.js +18 -13
- package/lib/connectivity/humble.js +10 -12
- package/lib/connectivity/index.js +1 -1
- package/lib/core/engine/collector.js +2 -4
- package/lib/core/engine/command/addText.js +1 -2
- package/lib/core/engine/command/android.js +1 -1
- package/lib/core/engine/command/cache.js +1 -2
- package/lib/core/engine/command/chromeDevToolsProtocol.js +9 -2
- package/lib/core/engine/command/click.js +1 -2
- package/lib/core/engine/command/debug.js +1 -3
- package/lib/core/engine/command/javaScript.js +1 -2
- package/lib/core/engine/command/measure.js +13 -15
- package/lib/core/engine/command/meta.js +1 -1
- package/lib/core/engine/command/navigation.js +1 -1
- package/lib/core/engine/command/screenshot.js +1 -1
- package/lib/core/engine/command/scroll.js +1 -1
- package/lib/core/engine/command/select.js +1 -1
- package/lib/core/engine/command/set.js +1 -1
- package/lib/core/engine/command/stopWatch.js +1 -1
- package/lib/core/engine/command/switch.js +44 -1
- package/lib/core/engine/command/util/lcpHighlightScript.js +1 -1
- package/lib/core/engine/command/util/lsHighlightScript.js +1 -1
- package/lib/core/engine/command/wait.js +1 -1
- package/lib/core/engine/index.js +12 -12
- package/lib/core/engine/iteration.js +27 -27
- package/lib/core/engine/run.js +1 -1
- package/lib/core/pageCompleteChecks/defaultPageCompleteCheck.js +1 -1
- package/lib/core/pageCompleteChecks/pageCompleteCheckByInactivity.js +1 -1
- package/lib/core/pageCompleteChecks/spaInactivity.js +1 -1
- package/lib/core/seleniumRunner.js +9 -11
- package/lib/edge/webdriver/builder.js +1 -1
- package/lib/extensionserver/index.js +2 -4
- package/lib/extensionserver/setup.js +1 -1
- package/lib/firefox/geckoProfiler.js +46 -16
- package/lib/firefox/getHAR.js +1 -1
- package/lib/firefox/memoryReport.js +1 -1
- package/lib/firefox/settings/disableSafeBrowsingPreferences.js +1 -1
- package/lib/firefox/settings/disableTrackingProtectionPreferences.js +1 -1
- package/lib/firefox/settings/firefoxPreferences.js +1 -1
- package/lib/firefox/webdriver/builder.js +9 -9
- package/lib/firefox/webdriver/firefox.js +24 -6
- package/lib/safari/webdriver/safari.js +1 -1
- package/lib/screenshot/defaults.js +1 -1
- package/lib/screenshot/index.js +3 -5
- package/lib/support/cli.js +5 -5
- package/lib/support/dns.js +6 -1
- package/lib/support/engineUtils.js +5 -13
- package/lib/support/getViewPort.js +1 -1
- package/lib/support/har/index.js +6 -8
- package/lib/support/images/index.js +1 -1
- package/lib/support/logging.js +1 -1
- package/lib/support/pathToFolder.js +4 -4
- package/lib/support/preURL.js +1 -1
- package/lib/support/processes.js +1 -1
- package/lib/support/setResourceTimingBufferSize.js +1 -1
- package/lib/support/stop.js +1 -1
- package/lib/support/storageManager.js +1 -3
- package/lib/support/tcpdump.js +2 -2
- package/lib/support/xvfb.js +2 -4
- package/lib/video/postprocessing/finetune/addTextToVideo.js +3 -3
- package/lib/video/postprocessing/finetune/convertFps.js +1 -1
- package/lib/video/postprocessing/finetune/getFont.js +1 -1
- package/lib/video/postprocessing/finetune/getTimingMetrics.js +2 -2
- package/lib/video/postprocessing/finetune/index.js +4 -4
- package/lib/video/postprocessing/finetune/removeOrange.js +1 -1
- package/lib/video/postprocessing/visualmetrics/extraMetrics.js +1 -1
- package/lib/video/postprocessing/visualmetrics/getVideoMetrics.js +2 -2
- package/lib/video/screenRecording/android/recorder.js +1 -1
- package/lib/video/screenRecording/desktop/convert.js +1 -1
- package/lib/video/screenRecording/desktop/desktopRecorder.js +3 -3
- package/lib/video/screenRecording/desktop/ffmpegRecorder.js +6 -6
- package/lib/video/screenRecording/desktop/osx/getSPDisplaysDataType.js +1 -1
- package/lib/video/screenRecording/desktop/osx/getScreen.js +1 -1
- package/lib/video/screenRecording/firefox/firefoxWindowRecorder.js +1 -1
- package/lib/video/screenRecording/ios/convertToMp4.js +1 -1
- package/lib/video/screenRecording/ios/iosRecorder.js +2 -2
- package/lib/video/screenRecording/iosSimulator/convertToMp4.js +1 -1
- package/lib/video/screenRecording/iosSimulator/recorder.js +2 -2
- package/lib/video/screenRecording/recorder.js +6 -6
- package/lib/video/screenRecording/setOrangeBackground.js +1 -1
- package/lib/video/video.js +9 -11
- package/package.json +18 -18
package/lib/support/logging.js
CHANGED
|
@@ -9,7 +9,7 @@ function toSafeKey(key) {
|
|
|
9
9
|
return key.replace(/[ %&()+,./:?|~–]|%7C/g, '-');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export function pathToFolder(url, options) {
|
|
13
13
|
if (options.useSameDir) {
|
|
14
14
|
return '';
|
|
15
15
|
} else {
|
|
@@ -40,9 +40,7 @@ export default function (url, options) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// This is used from sitespeed.io to match URLs on Graphite
|
|
43
|
-
if (
|
|
44
|
-
pathSegments.push(...urlSegments);
|
|
45
|
-
} else {
|
|
43
|
+
if (options.storeURLsAsFlatPageOnDisk) {
|
|
46
44
|
const folder = toSafeKey(urlSegments.join('_').concat('_'));
|
|
47
45
|
if (folder.length > 255) {
|
|
48
46
|
log.info(
|
|
@@ -52,6 +50,8 @@ export default function (url, options) {
|
|
|
52
50
|
} else {
|
|
53
51
|
pathSegments.push(folder);
|
|
54
52
|
}
|
|
53
|
+
} else {
|
|
54
|
+
pathSegments.push(...urlSegments);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
package/lib/support/preURL.js
CHANGED
|
@@ -2,7 +2,7 @@ import intel from 'intel';
|
|
|
2
2
|
const log = intel.getLogger('browsertime');
|
|
3
3
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export async function preURL(browser, options) {
|
|
6
6
|
log.info('Accessing preURL %s', options.preURL);
|
|
7
7
|
await browser.loadAndWait(options.preURL);
|
|
8
8
|
if (!options.preURLDisableWhiteBackground) {
|
package/lib/support/processes.js
CHANGED
package/lib/support/stop.js
CHANGED
|
@@ -2,7 +2,7 @@ import { execa } from 'execa';
|
|
|
2
2
|
import intel from 'intel';
|
|
3
3
|
const log = intel.getLogger('browsertime');
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export async function stop(processName) {
|
|
6
6
|
const scriptArguments = ['-9', processName];
|
|
7
7
|
|
|
8
8
|
log.debug('Kill all processes ' + processName);
|
|
@@ -49,7 +49,7 @@ async function streamToString(stream) {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
class StorageManager {
|
|
52
|
+
export class StorageManager {
|
|
53
53
|
constructor(url, { resultDir, prettyPrint = false } = {}) {
|
|
54
54
|
this.baseDir = resultDir
|
|
55
55
|
? _resolve(resultDir)
|
|
@@ -134,5 +134,3 @@ class StorageManager {
|
|
|
134
134
|
return this.baseDir;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
export default StorageManager;
|
package/lib/support/tcpdump.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { execa } from 'execa';
|
|
3
|
-
import pathToFolder from './pathToFolder.js';
|
|
3
|
+
import { pathToFolder } from './pathToFolder.js';
|
|
4
4
|
import { rename } from './fileUtil.js';
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export class TCPDump {
|
|
7
7
|
constructor(directory, options) {
|
|
8
8
|
this.baseDir = directory;
|
|
9
9
|
this.options = options;
|
package/lib/support/xvfb.js
CHANGED
|
@@ -2,7 +2,7 @@ import { promisify } from 'node:util';
|
|
|
2
2
|
import get from 'lodash.get';
|
|
3
3
|
import Xvfb from '@cypress/xvfb';
|
|
4
4
|
import { xvfbDisplay } from '../video/defaults.js';
|
|
5
|
-
import getViewPort from '../support/getViewPort.js';
|
|
5
|
+
import { getViewPort } from '../support/getViewPort.js';
|
|
6
6
|
import { isAndroidConfigured } from '../android/index.js';
|
|
7
7
|
|
|
8
8
|
function buildXvfbArguments({ display, screen = 0, size, silent }) {
|
|
@@ -41,7 +41,7 @@ async function stopXvfb(xvfb) {
|
|
|
41
41
|
* Create a new XVFB instance
|
|
42
42
|
* @class
|
|
43
43
|
*/
|
|
44
|
-
class XVFB {
|
|
44
|
+
export class XVFB {
|
|
45
45
|
constructor(options) {
|
|
46
46
|
this.options = options;
|
|
47
47
|
}
|
|
@@ -67,5 +67,3 @@ class XVFB {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
export default XVFB;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
2
|
import intel from 'intel';
|
|
3
|
-
import getTimingMetrics from './getTimingMetrics.js';
|
|
4
|
-
import getFont from './getFont.js';
|
|
3
|
+
import { getTimingMetrics } from './getTimingMetrics.js';
|
|
4
|
+
import { getFont } from './getFont.js';
|
|
5
5
|
import { isAndroidConfigured } from '../../../android/index.js';
|
|
6
6
|
const log = intel.getLogger('browsertime.video');
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ function isSmallish(options) {
|
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export async function addTextToVideo(
|
|
18
18
|
inputFile,
|
|
19
19
|
outputFile,
|
|
20
20
|
videoMetrics,
|
|
@@ -2,7 +2,7 @@ import { execa } from 'execa';
|
|
|
2
2
|
import intel from 'intel';
|
|
3
3
|
const log = intel.getLogger('browsertime.video');
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export async function convert(source, destination, framerate) {
|
|
6
6
|
const scriptArguments = [
|
|
7
7
|
'-nostdin',
|
|
8
8
|
'-i',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
export
|
|
2
|
+
export function getFont(options) {
|
|
3
3
|
// If the font is not part of the params and we're on macOS
|
|
4
4
|
// we check that SFNSMono.ttf is available
|
|
5
5
|
if (!options.videoParams.fontPath && process.platform === 'darwin') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isAndroidConfigured } from '../../../android/index.js';
|
|
2
|
-
import getFont from './getFont.js';
|
|
2
|
+
import { getFont } from './getFont.js';
|
|
3
3
|
|
|
4
4
|
function isSmallish(options) {
|
|
5
5
|
return (
|
|
@@ -30,7 +30,7 @@ function get(metric, metricName, pos, options) {
|
|
|
30
30
|
},30)':x=(w-tw)/2: y=H-${pos}-h/${x}:fontcolor=white:fontsize=h/${fontSize}:box=1:boxcolor=0x000000AA:boxborderw=2:text='${metricName} ${metric}'`;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export
|
|
33
|
+
export function getTimingMetrics(videoMetrics, timingMetrics, options) {
|
|
34
34
|
let text = '';
|
|
35
35
|
const vm = videoMetrics.visualMetrics;
|
|
36
36
|
const startPosition = 'h/10';
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
import { promisify } from 'node:util';
|
|
8
8
|
import intel from 'intel';
|
|
9
9
|
import get from 'lodash.get';
|
|
10
|
-
import addTextToVideo from './addTextToVideo.js';
|
|
11
|
-
import removeOrange from './removeOrange.js';
|
|
12
|
-
import convert from './convertFps.js';
|
|
10
|
+
import { addTextToVideo } from './addTextToVideo.js';
|
|
11
|
+
import { removeOrange } from './removeOrange.js';
|
|
12
|
+
import { convert } from './convertFps.js';
|
|
13
13
|
import { convert as _convert } from '../../defaults.js';
|
|
14
14
|
import { isAndroidConfigured } from '../../../android/index.js';
|
|
15
15
|
const rename = promisify(_rename);
|
|
@@ -17,7 +17,7 @@ const copyFile = promisify(_copyFile);
|
|
|
17
17
|
const unlink = promisify(_unlink);
|
|
18
18
|
const log = intel.getLogger('browsertime.video');
|
|
19
19
|
|
|
20
|
-
export
|
|
20
|
+
export async function finetuneVideo(
|
|
21
21
|
videoDir,
|
|
22
22
|
videoPath,
|
|
23
23
|
index,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import intel from 'intel';
|
|
3
3
|
import { run } from './visualMetrics.js';
|
|
4
|
-
import extraMetrics from './extraMetrics.js';
|
|
4
|
+
import { extraMetrics } from './extraMetrics.js';
|
|
5
5
|
const log = intel.getLogger('browsertime.video');
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export async function getVideoMetrics(
|
|
8
8
|
videoDir,
|
|
9
9
|
filmstripDir,
|
|
10
10
|
videoPath,
|
|
@@ -8,7 +8,7 @@ const unlink = promisify(_unlink);
|
|
|
8
8
|
const log = intel.getLogger('browsertime.video');
|
|
9
9
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export class AndroidRecorder {
|
|
12
12
|
constructor(options) {
|
|
13
13
|
this.waitTime = get(options, 'videoParams.androidVideoWaitTime', 5000);
|
|
14
14
|
this.framerate = get(options, 'videoParams.framerate', framerate);
|
|
@@ -2,7 +2,7 @@ import { execa } from 'execa';
|
|
|
2
2
|
import intel from 'intel';
|
|
3
3
|
const log = intel.getLogger('browsertime.video');
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export async function convert(source, destination, crf, threads) {
|
|
6
6
|
const scriptArguments = [
|
|
7
7
|
'-nostdin',
|
|
8
8
|
'-i',
|
|
@@ -3,7 +3,7 @@ import { unlink as _unlink, rename as _rename } from 'node:fs';
|
|
|
3
3
|
import intel from 'intel';
|
|
4
4
|
import get from 'lodash.get';
|
|
5
5
|
import { start as _start, stop as _stop } from './ffmpegRecorder.js';
|
|
6
|
-
import convert from './convert.js';
|
|
6
|
+
import { convert } from './convert.js';
|
|
7
7
|
import {
|
|
8
8
|
xvfbDisplay,
|
|
9
9
|
framerate as _framerate,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
convert as _convert,
|
|
12
12
|
threads as _threads
|
|
13
13
|
} from '../../defaults.js';
|
|
14
|
-
import getViewPort from '../../../support/getViewPort.js';
|
|
14
|
+
import { getViewPort } from '../../../support/getViewPort.js';
|
|
15
15
|
const unlink = promisify(_unlink);
|
|
16
16
|
const rename = promisify(_rename);
|
|
17
17
|
const log = intel.getLogger('browsertime.video');
|
|
18
18
|
|
|
19
|
-
export
|
|
19
|
+
export class DesktopRecorder {
|
|
20
20
|
constructor(options) {
|
|
21
21
|
this.display = get(options, 'xvfbParams.display', xvfbDisplay);
|
|
22
22
|
this.framerate = get(options, 'videoParams.framerate', _framerate);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
2
|
import intel from 'intel';
|
|
3
|
-
import getScreenOnOSX from './osx/getScreen.js';
|
|
4
|
-
import getSPDisplaysDataType from './osx/getSPDisplaysDataType.js';
|
|
3
|
+
import { getScreenOnOSX } from './osx/getScreen.js';
|
|
4
|
+
import { getSPDisplaysDataType } from './osx/getSPDisplaysDataType.js';
|
|
5
5
|
const log = intel.getLogger('browsertime.video');
|
|
6
6
|
|
|
7
7
|
async function buildX11FfmpegArguments({
|
|
@@ -98,15 +98,15 @@ async function startRecording(ffmpegArguments, nice, filePath) {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
let ffmpegProcess;
|
|
101
|
-
if (nice
|
|
101
|
+
if (nice === 0) {
|
|
102
|
+
log.debug('Start FFMPEG with %j', ffmpegArguments);
|
|
103
|
+
ffmpegProcess = execa('ffmpeg', ffmpegArguments);
|
|
104
|
+
} else {
|
|
102
105
|
ffmpegArguments.unshift('ffmpeg');
|
|
103
106
|
ffmpegArguments.unshift(`${nice}`);
|
|
104
107
|
ffmpegArguments.unshift('-n');
|
|
105
108
|
log.debug('Start FFMPEG with %j', ffmpegArguments);
|
|
106
109
|
ffmpegProcess = execa('nice', ffmpegArguments);
|
|
107
|
-
} else {
|
|
108
|
-
log.debug('Start FFMPEG with %j', ffmpegArguments);
|
|
109
|
-
ffmpegProcess = execa('ffmpeg', ffmpegArguments);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
// Race to catch if ffmpeg exists early, or if recording has started
|
|
@@ -147,7 +147,7 @@ async function generateVideo(destination, recordingDirectoryName) {
|
|
|
147
147
|
return removeDirAndFiles(recordingDirectoryName);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
export
|
|
150
|
+
export class FirefoxWindowRecorder {
|
|
151
151
|
constructor(options, browser, baseDir) {
|
|
152
152
|
this.options = options;
|
|
153
153
|
this.browser = browser;
|
|
@@ -2,7 +2,7 @@ import { execa } from 'execa';
|
|
|
2
2
|
import intel from 'intel';
|
|
3
3
|
const log = intel.getLogger('browsertime.video');
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export async function convert(source, destination) {
|
|
6
6
|
const scriptArguments = [
|
|
7
7
|
'-framerate',
|
|
8
8
|
60,
|
|
@@ -4,7 +4,7 @@ import { resolve, join } from 'node:path';
|
|
|
4
4
|
import { execaCommand as command } from 'execa';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import { unlink as _unlink } from 'node:fs';
|
|
7
|
-
import convert from './convertToMp4.js';
|
|
7
|
+
import { convert } from './convertToMp4.js';
|
|
8
8
|
import intel from 'intel';
|
|
9
9
|
const log = intel.getLogger('browsertime.video');
|
|
10
10
|
const unlink = promisify(_unlink);
|
|
@@ -13,7 +13,7 @@ const moduleRootPath = resolve(__dirname, '..', '..', '..', '..');
|
|
|
13
13
|
const QVH = resolve(moduleRootPath, 'vendor', 'mac', 'x86', 'qvh');
|
|
14
14
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
15
15
|
|
|
16
|
-
export
|
|
16
|
+
export class IOSRecorder {
|
|
17
17
|
constructor(options, baseDir) {
|
|
18
18
|
this.options = options;
|
|
19
19
|
this.uuid = options.safari.deviceUDID;
|
|
@@ -2,7 +2,7 @@ import { execa } from 'execa';
|
|
|
2
2
|
import intel from 'intel';
|
|
3
3
|
const log = intel.getLogger('browsertime.video');
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export async function convert(source, destination) {
|
|
6
6
|
const scriptArguments = [
|
|
7
7
|
// '-framerate',
|
|
8
8
|
// 60,
|
|
@@ -3,12 +3,12 @@ import util from 'node:util';
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import { execa } from 'execa';
|
|
5
5
|
import intel from 'intel';
|
|
6
|
-
import {
|
|
6
|
+
import { convert } from './convertToMp4.js';
|
|
7
7
|
const unlink = util.promisify(fs.unlink);
|
|
8
8
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
9
9
|
const log = intel.getLogger('browsertime.video');
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export class IOSSimulatorRecorder {
|
|
12
12
|
constructor(options, baseDir) {
|
|
13
13
|
this.options = options;
|
|
14
14
|
this.tmpVideo = path.join(baseDir, 'tmp.mov');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isAndroidConfigured } from '../../android/index.js';
|
|
2
|
-
import AndroidRecorder from './android/recorder.js';
|
|
3
|
-
import DesktopRecorder from './desktop/desktopRecorder.js';
|
|
4
|
-
import FirefoxWindowRecorder from './firefox/firefoxWindowRecorder.js';
|
|
5
|
-
import IOSSimulatorRecorder from './iosSimulator/recorder.js';
|
|
6
|
-
import IOSRecorder from './ios/iosRecorder.js';
|
|
2
|
+
import { AndroidRecorder } from './android/recorder.js';
|
|
3
|
+
import { DesktopRecorder } from './desktop/desktopRecorder.js';
|
|
4
|
+
import { FirefoxWindowRecorder } from './firefox/firefoxWindowRecorder.js';
|
|
5
|
+
import { IOSSimulatorRecorder } from './iosSimulator/recorder.js';
|
|
6
|
+
import { IOSRecorder } from './ios/iosRecorder.js';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export function getRecorder(options, browser, baseDir) {
|
|
9
9
|
if (
|
|
10
10
|
options.browser === 'firefox' &&
|
|
11
11
|
options.firefox &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import intel from 'intel';
|
|
2
2
|
import { until, By } from 'selenium-webdriver';
|
|
3
3
|
const log = intel.getLogger('browsertime.video');
|
|
4
|
-
export
|
|
4
|
+
export async function setOrangeBackground(driver) {
|
|
5
5
|
log.debug('Add orange color');
|
|
6
6
|
// We tried other ways for Android (access an orange page)
|
|
7
7
|
// That works fine ... but break scripts
|
package/lib/video/video.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import get from 'lodash.get';
|
|
3
|
-
import getRecorder from './screenRecording/recorder.js';
|
|
4
|
-
import getVideoMetrics from './postprocessing/visualmetrics/getVideoMetrics.js';
|
|
5
|
-
import finetuneVideo from './postprocessing/finetune/index.js';
|
|
3
|
+
import { getRecorder } from './screenRecording/recorder.js';
|
|
4
|
+
import { getVideoMetrics } from './postprocessing/visualmetrics/getVideoMetrics.js';
|
|
5
|
+
import { finetuneVideo } from './postprocessing/finetune/index.js';
|
|
6
6
|
import { rename, removeFile, removeDirAndFiles } from '../support/fileUtil.js';
|
|
7
|
-
import
|
|
7
|
+
import { pathToFolder } from '../support/pathToFolder.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Create a new Video that handles everything with the video
|
|
11
11
|
* @class
|
|
12
12
|
*/
|
|
13
|
-
class Video {
|
|
13
|
+
export class Video {
|
|
14
14
|
constructor(storageManager, options, browser) {
|
|
15
15
|
this.options = options;
|
|
16
16
|
this.storageManager = storageManager;
|
|
@@ -24,15 +24,15 @@ class Video {
|
|
|
24
24
|
this.index = index;
|
|
25
25
|
|
|
26
26
|
this.videoDir = await storageManager.createSubDataDir(
|
|
27
|
-
join(
|
|
27
|
+
join(pathToFolder(url, this.options), 'video')
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
await storageManager.createSubDataDir(
|
|
31
|
-
join(
|
|
31
|
+
join(pathToFolder(url, this.options), 'video', 'images', '' + index)
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
this.filmstripDir = await storageManager.createSubDataDir(
|
|
35
|
-
join(
|
|
35
|
+
join(pathToFolder(url, this.options), 'filmstrip', '' + index)
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -60,7 +60,7 @@ class Video {
|
|
|
60
60
|
this.isRecording = false;
|
|
61
61
|
this.videoPath = join(
|
|
62
62
|
this.storageManager.directory,
|
|
63
|
-
|
|
63
|
+
pathToFolder(url, this.options),
|
|
64
64
|
'video',
|
|
65
65
|
this.index + '.mp4'
|
|
66
66
|
);
|
|
@@ -120,5 +120,3 @@ class Video {
|
|
|
120
120
|
return this.recorder.timeToFirstFrame;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
export default Video;
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Browsertime",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"bin": "./bin/browsertime.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@cypress/xvfb": "1.2.4",
|
|
8
8
|
"@devicefarmer/adbkit": "2.11.3",
|
|
9
|
-
"@sitespeed.io/chromedriver": "
|
|
10
|
-
"@sitespeed.io/edgedriver": "
|
|
11
|
-
"@sitespeed.io/geckodriver": "0.
|
|
9
|
+
"@sitespeed.io/chromedriver": "110.0.5481-77",
|
|
10
|
+
"@sitespeed.io/edgedriver": "109.0.1518-70",
|
|
11
|
+
"@sitespeed.io/geckodriver": "0.32.0",
|
|
12
12
|
"@sitespeed.io/throttle": "5.0.0",
|
|
13
13
|
"@sitespeed.io/tracium": "0.3.3",
|
|
14
14
|
"btoa": "1.2.1",
|
|
15
|
-
"chrome-har": "0.13.
|
|
16
|
-
"chrome-remote-interface": "0.
|
|
17
|
-
"dayjs": "1.11.
|
|
15
|
+
"chrome-har": "0.13.1",
|
|
16
|
+
"chrome-remote-interface": "0.32.0",
|
|
17
|
+
"dayjs": "1.11.7",
|
|
18
18
|
"execa": "6.1.0",
|
|
19
19
|
"fast-stats": "0.0.6",
|
|
20
20
|
"find-up": "6.3.0",
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
"lodash.merge": "4.6.2",
|
|
28
28
|
"lodash.pick": "4.4.0",
|
|
29
29
|
"lodash.set": "4.3.2",
|
|
30
|
-
"selenium-webdriver": "4.
|
|
31
|
-
"yargs": "17.6.
|
|
30
|
+
"selenium-webdriver": "4.8.0",
|
|
31
|
+
"yargs": "17.6.2"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"jimp": "0.
|
|
34
|
+
"jimp": "0.22.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"ava": "5.0
|
|
38
|
-
"eslint": "8.
|
|
39
|
-
"eslint-config-prettier": "8.
|
|
37
|
+
"ava": "5.1.0",
|
|
38
|
+
"eslint": "8.31.0",
|
|
39
|
+
"eslint-config-prettier": "8.6.0",
|
|
40
40
|
"eslint-plugin-prettier": "4.2.1",
|
|
41
|
-
"eslint-plugin-unicorn": "
|
|
42
|
-
"prettier": "2.
|
|
43
|
-
"serve-handler": "6.1.
|
|
44
|
-
"serve": "14.
|
|
41
|
+
"eslint-plugin-unicorn": "45.0.2",
|
|
42
|
+
"prettier": "2.8.2",
|
|
43
|
+
"serve-handler": "6.1.5",
|
|
44
|
+
"serve": "14.1.2"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=14.19.1"
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"!test/data"
|
|
94
94
|
],
|
|
95
95
|
"concurrency": 1,
|
|
96
|
-
"failFast":
|
|
96
|
+
"failFast": true,
|
|
97
97
|
"require": [
|
|
98
98
|
"./test/util/setup.js"
|
|
99
99
|
],
|