browsertime 21.5.1 → 21.5.2
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 +4 -0
- package/browserscripts/pageinfo/loaf.js +33 -31
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
+
## 21.5.2 - 2024-03-12
|
|
4
|
+
### Fixed
|
|
5
|
+
* Another bug fix: Getting Long Animation Frame (loaf) was broken [#2099](https://github.com/sitespeedio/browsertime/pull/2099).
|
|
6
|
+
|
|
3
7
|
## 21.5.1 - 2024-03-12
|
|
4
8
|
### Fixed
|
|
5
9
|
* There was a bug in how we collect CPU power from Firefox and add it to the statistics. Fixed in [#2098](https://github.com/sitespeedio/browsertime/pull/2098).
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
(function () {
|
|
2
|
+
// See https://developer.chrome.com/docs/web-platform/long-animation-frames
|
|
3
|
+
if (
|
|
4
|
+
PerformanceObserver.supportedEntryTypes.includes('long-animation-frame')
|
|
5
|
+
) {
|
|
5
6
|
const MAX_LOAFS_TO_CONSIDER = 10;
|
|
6
7
|
const relevantLoadEntries = [];
|
|
7
|
-
const observer = new PerformanceObserver(list => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
).slice(0, MAX_LOAFS_TO_CONSIDER);
|
|
8
|
+
const observer = new PerformanceObserver(list => {});
|
|
9
|
+
observer.observe({type: 'long-animation-frame', buffered: true});
|
|
10
|
+
const entries = observer.takeRecords();
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
12
|
+
let longestBlockingLoAFs = []
|
|
13
|
+
.concat(entries)
|
|
14
|
+
.sort((a, b) => b.blockingDuration - a.blockingDuration)
|
|
15
|
+
.slice(0, MAX_LOAFS_TO_CONSIDER);
|
|
16
|
+
|
|
17
|
+
// re-package
|
|
18
|
+
for (let entry of longestBlockingLoAFs) {
|
|
19
|
+
const info = {};
|
|
20
|
+
info.blockingDuration = entry.blockingDuration;
|
|
21
|
+
info.duration = entry.duration;
|
|
22
|
+
info.styleAndLayoutStart = entry.styleAndLayoutStart;
|
|
23
|
+
info.renderStart = entry.renderStart;
|
|
24
|
+
info.scripts = [];
|
|
25
|
+
for (let script of entry.scripts) {
|
|
26
|
+
const s = {};
|
|
27
|
+
s.forcedStyleAndLayoutDuration = script.forcedStyleAndLayoutDuration;
|
|
28
|
+
s.invoker = script.invoker;
|
|
29
|
+
s.invokerType = script.invokerType;
|
|
30
|
+
s.sourceFunctionName = script.sourceFunctionName;
|
|
31
|
+
s.sourceURL = script.sourceURL;
|
|
32
|
+
info.scripts.push(s);
|
|
33
|
+
}
|
|
34
|
+
relevantLoadEntries.push(info);
|
|
34
35
|
}
|
|
36
|
+
return relevantLoadEntries;
|
|
37
|
+
}
|
|
35
38
|
})();
|
|
36
|
-
|
package/package.json
CHANGED