browsertime 15.3.0 → 15.4.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/lib/support/cli.js
CHANGED
|
@@ -640,6 +640,11 @@ module.exports.parseCommandLine = function parseCommandLine() {
|
|
|
640
640
|
type: 'boolean',
|
|
641
641
|
describe: 'Collect Contentful Speed Index when you run --visualMetrics.'
|
|
642
642
|
})
|
|
643
|
+
.option('visualMetricsPortable', {
|
|
644
|
+
type: 'boolean',
|
|
645
|
+
describe:
|
|
646
|
+
'Use the portable visual-metrics processing script (no ImageMagick dependencies).'
|
|
647
|
+
})
|
|
643
648
|
.option('scriptInput.visualElements', {
|
|
644
649
|
describe:
|
|
645
650
|
'Include specific elements in visual elements. Give the element a name and select it with document.body.querySelector. Use like this: --scriptInput.visualElements name:domSelector see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors. Add multiple instances to measure multiple elements. Visual Metrics will use these elements and calculate when they are visible and fully rendered.'
|
|
@@ -970,7 +975,7 @@ module.exports.parseCommandLine = function parseCommandLine() {
|
|
|
970
975
|
})
|
|
971
976
|
.option('block', {
|
|
972
977
|
describe:
|
|
973
|
-
'Domain to block
|
|
978
|
+
'Domain to block or URL or URL pattern to block. If you use Chrome you can also use --blockDomainsExcept (that is more performant). Works in Chrome/Edge. For Firefox you can only block domains.'
|
|
974
979
|
})
|
|
975
980
|
.option('percentiles', {
|
|
976
981
|
type: 'array',
|
|
@@ -16,9 +16,29 @@ const SCRIPT_PATH = path.join(
|
|
|
16
16
|
'visualmetrics.py'
|
|
17
17
|
);
|
|
18
18
|
|
|
19
|
+
const PORTABLE_SCRIPT_PATH = path.join(
|
|
20
|
+
__dirname,
|
|
21
|
+
'..',
|
|
22
|
+
'..',
|
|
23
|
+
'..',
|
|
24
|
+
'..',
|
|
25
|
+
'browsertime',
|
|
26
|
+
'visualmetrics-portable.py'
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
function getScript(options) {
|
|
30
|
+
if (options.visualMetricsPortable) {
|
|
31
|
+
return PORTABLE_SCRIPT_PATH;
|
|
32
|
+
}
|
|
33
|
+
return SCRIPT_PATH;
|
|
34
|
+
}
|
|
35
|
+
|
|
19
36
|
module.exports = {
|
|
20
|
-
async checkDependencies() {
|
|
21
|
-
return execa(process.env.PYTHON || 'python', [
|
|
37
|
+
async checkDependencies(options) {
|
|
38
|
+
return execa(process.env.PYTHON || 'python', [
|
|
39
|
+
getScript(options),
|
|
40
|
+
'--check'
|
|
41
|
+
]);
|
|
22
42
|
},
|
|
23
43
|
async run(
|
|
24
44
|
videoPath,
|
|
@@ -46,7 +66,13 @@ module.exports = {
|
|
|
46
66
|
'--renderignore',
|
|
47
67
|
5,
|
|
48
68
|
'--json',
|
|
49
|
-
'--viewport'
|
|
69
|
+
'--viewport',
|
|
70
|
+
'--viewportretries',
|
|
71
|
+
60,
|
|
72
|
+
'--viewportminheight',
|
|
73
|
+
100,
|
|
74
|
+
'--viewportminwidth',
|
|
75
|
+
100
|
|
50
76
|
];
|
|
51
77
|
|
|
52
78
|
if (options.visualMetricsPerceptual) {
|
|
@@ -103,7 +129,7 @@ module.exports = {
|
|
|
103
129
|
scriptArgs.push('-vvv');
|
|
104
130
|
}
|
|
105
131
|
|
|
106
|
-
scriptArgs.unshift(
|
|
132
|
+
scriptArgs.unshift(getScript(options));
|
|
107
133
|
|
|
108
134
|
log.debug('Running visualmetrics.py ' + scriptArgs.join(' '));
|
|
109
135
|
log.info('Get visual metrics from the video');
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Browsertime",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.4.0",
|
|
4
4
|
"bin": "./bin/browsertime.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@cypress/xvfb": "1.2.4",
|
|
7
7
|
"@devicefarmer/adbkit": "2.11.3",
|
|
8
|
-
"@sitespeed.io/chromedriver": "
|
|
8
|
+
"@sitespeed.io/chromedriver": "100.0.4896-20",
|
|
9
9
|
"@sitespeed.io/edgedriver": "99.0.1150-25",
|
|
10
10
|
"@sitespeed.io/geckodriver": "0.30.0",
|
|
11
11
|
"@sitespeed.io/throttle": "3.0.0",
|