browsertime 16.0.1 → 16.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
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## 16.1.0 - 2022-04-20
|
|
5
|
+
### Fixed
|
|
6
|
+
* Handle negative x/y offsets when cropping images in the new portable visual metrocs script, thank you [Gregory Mierzwinski](https://github.com/gmierz) for PR [#1770](https://github.com/sitespeedio/browsertime/pull/1770).
|
|
7
|
+
* Bumped Throttle dependency [#1769](https://github.com/sitespeedio/browsertime/pull/1769).
|
|
8
|
+
* Bumped chrome-har, chrome-remote-interface, dayjs and yargs dependencies [#1771](https://github.com/sitespeedio/browsertime/pull/1771).
|
|
9
|
+
### Added
|
|
10
|
+
* Added blocking of Chrome and Edge phone home domains [#1763](https://github.com/sitespeedio/browsertime/pull/1763).
|
|
11
|
+
|
|
4
12
|
## 16.0.1 - 2022-04-06
|
|
5
13
|
### Fixed
|
|
6
14
|
* If visual metrics fails and you also use --visualElements, make sure that file is also stored so we can reporduce the issue [#1757](https://github.com/sitespeedio/browsertime/pull/1757).
|
|
@@ -108,6 +108,11 @@ def crop_im(img, crop_x, crop_y, crop_x_offset, crop_y_offset, gravity=None):
|
|
|
108
108
|
base_x += crop_x_offset
|
|
109
109
|
base_y += crop_y_offset
|
|
110
110
|
|
|
111
|
+
# Take the maximum in case the offset was negative, and
|
|
112
|
+
# smaller than the base position
|
|
113
|
+
base_x = max(base_x, 0)
|
|
114
|
+
base_y = max(base_y, 0)
|
|
115
|
+
|
|
111
116
|
return Image.fromarray(
|
|
112
117
|
img[base_y : base_y + crop_y, base_x : base_x + crop_x, :]
|
|
113
118
|
)
|
|
@@ -2109,9 +2114,10 @@ def calculate_contentful_speed_index(progress, directory):
|
|
|
2109
2114
|
content.append(value)
|
|
2110
2115
|
|
|
2111
2116
|
for i, value in enumerate(content):
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2117
|
+
if maxContent > 0:
|
|
2118
|
+
content[i] = float(content[i]) / float(maxContent)
|
|
2119
|
+
else:
|
|
2120
|
+
content[i] = 0.0
|
|
2115
2121
|
|
|
2116
2122
|
# Assume 0 content for first frame
|
|
2117
2123
|
cont_si = 1 * (progress[1]["time"] - progress[0]["time"])
|
|
@@ -5,6 +5,17 @@ const getViewPort = require('../../support/getViewPort');
|
|
|
5
5
|
const util = require('../../support/util');
|
|
6
6
|
const log = require('intel').getLogger('browsertime.chrome');
|
|
7
7
|
|
|
8
|
+
const CHROME_AMD_EDGE_INTERNAL_PHONE_HOME = [
|
|
9
|
+
'"MAP cache.pack.google.com 127.0.0.1"',
|
|
10
|
+
'"MAP clients1.google.com 127.0.0.1"',
|
|
11
|
+
'"MAP update.googleapis.com 127.0.0.1"',
|
|
12
|
+
'"MAP redirector.gvt1.com 127.0.0.1"',
|
|
13
|
+
'"MAP laptop-updates.brave.com 127.0.0.1"',
|
|
14
|
+
'"MAP offlinepages-pa.googleapis.com 127.0.0.1"',
|
|
15
|
+
'"MAP edge.microsoft.com 127.0.0.1"',
|
|
16
|
+
'"MAP optimizationguide-pa.googleapis.com 127.0.0.1"'
|
|
17
|
+
];
|
|
18
|
+
|
|
8
19
|
module.exports = function (seleniumOptions, browserOptions, options, baseDir) {
|
|
9
20
|
// Fixing save password popup, only on Desktop
|
|
10
21
|
if (!options.android) {
|
|
@@ -64,6 +75,17 @@ module.exports = function (seleniumOptions, browserOptions, options, baseDir) {
|
|
|
64
75
|
excludes += 'MAP * 127.0.0.1, EXCLUDE ' + domain + ',';
|
|
65
76
|
}
|
|
66
77
|
seleniumOptions.addArguments('--host-resolver-rules=' + excludes);
|
|
78
|
+
} else {
|
|
79
|
+
// Make sure we only set this if we do not have any other host resolver rules
|
|
80
|
+
const chromeCommandLineArgs = util.toArray(browserOptions.args);
|
|
81
|
+
const argsWithHostResolverRules = chromeCommandLineArgs.filter(arg =>
|
|
82
|
+
arg.includes('host-resolver-rules')
|
|
83
|
+
);
|
|
84
|
+
if (argsWithHostResolverRules.length === 0) {
|
|
85
|
+
seleniumOptions.addArguments(
|
|
86
|
+
'--host-resolver-rules=' + CHROME_AMD_EDGE_INTERNAL_PHONE_HOME.join(',')
|
|
87
|
+
);
|
|
88
|
+
}
|
|
67
89
|
}
|
|
68
90
|
|
|
69
91
|
if (options.extension) {
|
|
@@ -9,6 +9,7 @@ const fs = require('fs');
|
|
|
9
9
|
const get = require('lodash.get');
|
|
10
10
|
const { promisify } = require('util');
|
|
11
11
|
const rename = promisify(fs.rename);
|
|
12
|
+
const copyFile = promisify(fs.copyFile);
|
|
12
13
|
const unlink = promisify(fs.unlink);
|
|
13
14
|
const defaults = require('../../defaults');
|
|
14
15
|
|
|
@@ -23,6 +24,11 @@ module.exports = async function (
|
|
|
23
24
|
const newStart = videoMetrics.videoRecordingStart / 1000;
|
|
24
25
|
let tmpFile = path.join(videoDir, 'tmp.mp4');
|
|
25
26
|
|
|
27
|
+
if (get(options, 'videoParams.keepOriginalVideo', false)) {
|
|
28
|
+
const originalFile = path.join(videoDir, index + '-original.mp4');
|
|
29
|
+
await copyFile(videoPath, originalFile);
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
// if there's no orange (too slow instance like travis?)
|
|
27
33
|
// we don't wanna cut
|
|
28
34
|
if (videoMetrics.videoRecordingStart > 0) {
|
|
@@ -45,11 +51,6 @@ module.exports = async function (
|
|
|
45
51
|
tmpFile = videoPath;
|
|
46
52
|
}
|
|
47
53
|
|
|
48
|
-
if (get(options, 'videoParams.keepOriginalVideo', false)) {
|
|
49
|
-
const originalFile = path.join(videoDir, index + '-original.mp4');
|
|
50
|
-
await rename(videoPath, originalFile);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
54
|
if (
|
|
54
55
|
options.android &&
|
|
55
56
|
get(options, 'videoParams.convert', defaults.convert)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Browsertime",
|
|
3
|
-
"version": "16.0
|
|
3
|
+
"version": "16.1.0",
|
|
4
4
|
"bin": "./bin/browsertime.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@cypress/xvfb": "1.2.4",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"@sitespeed.io/chromedriver": "100.0.4896-20",
|
|
9
9
|
"@sitespeed.io/edgedriver": "100.0.1185-29",
|
|
10
10
|
"@sitespeed.io/geckodriver": "0.30.0",
|
|
11
|
-
"@sitespeed.io/throttle": "3.
|
|
11
|
+
"@sitespeed.io/throttle": "3.1.1",
|
|
12
12
|
"@sitespeed.io/tracium": "0.3.3",
|
|
13
13
|
"btoa": "1.2.1",
|
|
14
|
-
"chrome-har": "0.
|
|
15
|
-
"chrome-remote-interface": "0.31.
|
|
16
|
-
"dayjs": "1.
|
|
14
|
+
"chrome-har": "0.13.0",
|
|
15
|
+
"chrome-remote-interface": "0.31.2",
|
|
16
|
+
"dayjs": "1.11.1",
|
|
17
17
|
"execa": "5.1.1",
|
|
18
18
|
"fast-stats": "0.0.6",
|
|
19
19
|
"find-up": "5.0.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lodash.pick": "4.4.0",
|
|
28
28
|
"lodash.set": "4.3.2",
|
|
29
29
|
"selenium-webdriver": "4.1.1",
|
|
30
|
-
"yargs": "17.
|
|
30
|
+
"yargs": "17.4.1"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
33
|
"jimp": "0.16.1"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"serve": "13.0.2"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
45
|
+
"node": ">=14.19.1"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
48
|
"CHANGELOG.md",
|