@chrome-devtools/rehydrated-devtools-app 1.20260830.0 → 1.20260906.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.
@@ -7,7 +7,7 @@
7
7
  __defProp(target, name, { get: all[name], enumerable: true });
8
8
  };
9
9
 
10
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/bfcache.js
10
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/bfcache.js
11
11
  var bfcacheRestoreTime = -1;
12
12
  var getBFCacheRestoreTime = () => bfcacheRestoreTime;
13
13
  var onBFCacheRestore = (cb) => {
@@ -19,7 +19,7 @@
19
19
  }, true);
20
20
  };
21
21
 
22
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js
22
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js
23
23
  var getRating = (value, thresholds) => {
24
24
  if (value > thresholds[1]) {
25
25
  return "poor";
@@ -47,12 +47,12 @@
47
47
  };
48
48
  };
49
49
 
50
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/doubleRAF.js
50
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/doubleRAF.js
51
51
  var doubleRAF = (cb) => {
52
52
  requestAnimationFrame(() => requestAnimationFrame(() => cb()));
53
53
  };
54
54
 
55
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js
55
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js
56
56
  var getNavigationEntry = () => {
57
57
  const navigationEntry = performance.getEntriesByType("navigation")[0];
58
58
  if (navigationEntry && navigationEntry.responseStart > 0 && navigationEntry.responseStart < performance.now()) {
@@ -60,12 +60,12 @@
60
60
  }
61
61
  };
62
62
 
63
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js
63
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js
64
64
  var getActivationStart = () => {
65
65
  return getNavigationEntry()?.activationStart ?? 0;
66
66
  };
67
67
 
68
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js
68
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js
69
69
  var firstHiddenTime = -1;
70
70
  var onHiddenFunctions = /* @__PURE__ */ new Set();
71
71
  var initHiddenTime = () => {
@@ -110,12 +110,12 @@
110
110
  };
111
111
  };
112
112
 
113
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js
113
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js
114
114
  var generateUniqueID = () => {
115
115
  return `v6-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;
116
116
  };
117
117
 
118
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js
118
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js
119
119
  var initMetric = (name, value = -1, navigationType, navigationId = 0, navigationInteractionId, navigationURL, navigationStartTime) => {
120
120
  const hardNavEntry = getNavigationEntry();
121
121
  const hardNavId = hardNavEntry?.navigationId || 0;
@@ -150,7 +150,7 @@
150
150
  };
151
151
  };
152
152
 
153
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.js
153
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.js
154
154
  var instanceMap = /* @__PURE__ */ new WeakMap();
155
155
  function initUnique(identityObj, ClassObj) {
156
156
  let classInstances = instanceMap.get(ClassObj);
@@ -164,7 +164,7 @@
164
164
  return classInstances.get(identityObj);
165
165
  }
166
166
 
167
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js
167
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js
168
168
  var LayoutShiftManager = class {
169
169
  _onAfterProcessingUnexpectedShift;
170
170
  _sessionValue = 0;
@@ -185,7 +185,7 @@
185
185
  }
186
186
  };
187
187
 
188
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js
188
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/observe.js
189
189
  var observe = (types, callback, opts = {}) => {
190
190
  try {
191
191
  const supportedTypes = types.filter((t) => PerformanceObserver.supportedEntryTypes.includes(t));
@@ -213,7 +213,7 @@
213
213
  return;
214
214
  };
215
215
 
216
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js
216
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js
217
217
  var checkSoftNavsEnabled = (opts) => {
218
218
  return (
219
219
  // Firefox has a preference to disable this, which some people use so add a guard
@@ -233,7 +233,7 @@
233
233
  }
234
234
  };
235
235
 
236
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/runOnce.js
236
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/runOnce.js
237
237
  var runOnce = (cb) => {
238
238
  let called = false;
239
239
  return () => {
@@ -244,12 +244,12 @@
244
244
  };
245
245
  };
246
246
 
247
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.js
247
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.js
248
248
  var FCPEntryManager = class {
249
249
  _softNavigationEntryMap;
250
250
  };
251
251
 
252
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/whenActivated.js
252
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/whenActivated.js
253
253
  var whenActivated = (callback) => {
254
254
  if (document.prerendering) {
255
255
  addEventListener("prerenderingchange", callback, true);
@@ -258,7 +258,7 @@
258
258
  }
259
259
  };
260
260
 
261
- // gen/front_end/third_party/web-vitals/package/dist/modules/onFCP.js
261
+ // ../../front_end/third_party/web-vitals/package/dist/modules/onFCP.js
262
262
  var FCPThresholds = [1800, 3e3];
263
263
  var onFCP = (onReport, opts = {}) => {
264
264
  const softNavsEnabled = checkSoftNavsEnabled(opts);
@@ -309,7 +309,7 @@
309
309
  });
310
310
  };
311
311
 
312
- // gen/front_end/third_party/web-vitals/package/dist/modules/onCLS.js
312
+ // ../../front_end/third_party/web-vitals/package/dist/modules/onCLS.js
313
313
  var CLSThresholds = [0.1, 0.25];
314
314
  var onCLS$1 = (onReport, opts = {}) => {
315
315
  const visibilityWatcher = getVisibilityWatcher();
@@ -363,7 +363,7 @@
363
363
  }));
364
364
  };
365
365
 
366
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js
366
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js
367
367
  var interactionCountEstimate = 0;
368
368
  var minKnownInteractionId = Infinity;
369
369
  var maxKnownInteractionId = 0;
@@ -388,7 +388,7 @@
388
388
  });
389
389
  };
390
390
 
391
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js
391
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js
392
392
  var MAX_INTERACTIONS_TO_CONSIDER = 10;
393
393
  var InteractionManager = class {
394
394
  /**
@@ -483,7 +483,7 @@
483
483
  }
484
484
  };
485
485
 
486
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js
486
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js
487
487
  var whenIdleOrHidden = (cb) => {
488
488
  const timeout = "requestIdleCallback" in globalThis ? 1e3 : 0;
489
489
  const rIC = globalThis.requestIdleCallback || setTimeout;
@@ -505,7 +505,7 @@
505
505
  }
506
506
  };
507
507
 
508
- // gen/front_end/third_party/web-vitals/package/dist/modules/onINP.js
508
+ // ../../front_end/third_party/web-vitals/package/dist/modules/onINP.js
509
509
  var INPThresholds = [200, 500];
510
510
  var DEFAULT_DURATION_THRESHOLD = 40;
511
511
  var onINP$1 = (onReport, opts = {}) => {
@@ -571,7 +571,7 @@
571
571
  });
572
572
  };
573
573
 
574
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.js
574
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.js
575
575
  var LCPEntryManager = class {
576
576
  _onBeforeProcessingEntry;
577
577
  _softNavigationEntryMap;
@@ -580,7 +580,7 @@
580
580
  }
581
581
  };
582
582
 
583
- // gen/front_end/third_party/web-vitals/package/dist/modules/onLCP.js
583
+ // ../../front_end/third_party/web-vitals/package/dist/modules/onLCP.js
584
584
  var LCPThresholds = [2500, 4e3];
585
585
  var onLCP$1 = (onReport, opts = {}) => {
586
586
  let isFinalized = false;
@@ -694,7 +694,7 @@
694
694
  });
695
695
  };
696
696
 
697
- // gen/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js
697
+ // ../../front_end/third_party/web-vitals/package/dist/modules/onTTFB.js
698
698
  var TTFBThresholds = [800, 1800];
699
699
  var whenReady = (callback) => {
700
700
  if (document.prerendering) {
@@ -738,7 +738,7 @@
738
738
  });
739
739
  };
740
740
 
741
- // gen/front_end/third_party/web-vitals/package/dist/modules/attribution/index.js
741
+ // ../../front_end/third_party/web-vitals/package/dist/modules/attribution/index.js
742
742
  var attribution_exports = {};
743
743
  __export(attribution_exports, {
744
744
  CLSThresholds: () => CLSThresholds,
@@ -753,7 +753,7 @@
753
753
  onTTFB: () => onTTFB2
754
754
  });
755
755
 
756
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js
756
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js
757
757
  var getLoadState = (timestamp) => {
758
758
  if (document.readyState === "loading") {
759
759
  return "loading";
@@ -771,7 +771,7 @@
771
771
  return "complete";
772
772
  };
773
773
 
774
- // gen/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js
774
+ // ../../front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js
775
775
  var getName = (node) => {
776
776
  const name = node.nodeName;
777
777
  return node.nodeType === 1 ? name.toLowerCase() : name.toUpperCase().replace(/^#/, "");
@@ -797,7 +797,7 @@
797
797
  return sel;
798
798
  };
799
799
 
800
- // gen/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js
800
+ // ../../front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js
801
801
  var getLargestLayoutShiftEntry = (entries) => {
802
802
  return entries.reduce((a, b) => a.value > b.value ? a : b);
803
803
  };
@@ -843,7 +843,7 @@
843
843
  }, opts);
844
844
  };
845
845
 
846
- // gen/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js
846
+ // ../../front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js
847
847
  var onFCP2 = (onReport, opts = {}) => {
848
848
  opts = Object.assign({}, opts);
849
849
  const fcpEntryManager = initUnique(opts, FCPEntryManager);
@@ -892,7 +892,7 @@
892
892
  }, opts);
893
893
  };
894
894
 
895
- // gen/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js
895
+ // ../../front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js
896
896
  var MAX_PENDING_FRAMES = 10;
897
897
  var onINP2 = (onReport, opts = {}) => {
898
898
  opts = Object.assign({}, opts);
@@ -1123,7 +1123,7 @@
1123
1123
  }, opts);
1124
1124
  };
1125
1125
 
1126
- // gen/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js
1126
+ // ../../front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js
1127
1127
  var DEFAULT_RESOURCE_BUFFER_SIZE = 50;
1128
1128
  var resourceBufferSizeLimit = DEFAULT_RESOURCE_BUFFER_SIZE;
1129
1129
  var resourceBuffer = [];
@@ -1212,7 +1212,7 @@
1212
1212
  }, opts);
1213
1213
  };
1214
1214
 
1215
- // gen/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js
1215
+ // ../../front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js
1216
1216
  var attributeTTFB = (metric) => {
1217
1217
  const navigationEntry = metric.entries[0];
1218
1218
  let attribution = {
@@ -1294,6 +1294,52 @@
1294
1294
  function getUniqueLayoutShiftId(entry) {
1295
1295
  return `layout-shift-${entry.value}-${entry.startTime}`;
1296
1296
  }
1297
+ function limitScripts(loafs) {
1298
+ return loafs.map((loaf) => {
1299
+ loaf.scripts = loaf.scripts.slice().sort((a, b) => b.duration - a.duration).slice(0, SCRIPTS_PER_LOAF_LIMIT).sort((a, b) => a.startTime - b.startTime);
1300
+ return loaf;
1301
+ });
1302
+ }
1303
+ function createInteractionEntryEvent(interaction) {
1304
+ const event = {
1305
+ name: "InteractionEntry",
1306
+ duration: interaction.value,
1307
+ subparts: {
1308
+ inputDelay: interaction.attribution.inputDelay,
1309
+ processingDuration: interaction.attribution.processingDuration,
1310
+ presentationDelay: interaction.attribution.presentationDelay
1311
+ },
1312
+ startTime: interaction.entries?.[0]?.startTime,
1313
+ navigationId: interaction.navigationId,
1314
+ entryGroupId: interaction.entries?.[0]?.interactionId,
1315
+ nextPaintTime: interaction.attribution.nextPaintTime,
1316
+ interactionType: interaction.attribution.interactionType,
1317
+ eventName: interaction.entries?.[0]?.name,
1318
+ // To limit the amount of events, just get the last 5 LoAFs
1319
+ longAnimationFrameEntries: limitScripts(
1320
+ interaction.attribution.longAnimationFrameEntries?.slice(-5).map((loaf) => loaf.toJSON()) ?? []
1321
+ )
1322
+ };
1323
+ const target = interaction.attribution.interactionTarget;
1324
+ if (target) {
1325
+ event.nodeIndex = Number(target);
1326
+ }
1327
+ return event;
1328
+ }
1329
+ function createInpChangeEvent(metric) {
1330
+ return {
1331
+ name: "INP",
1332
+ value: metric.value,
1333
+ subparts: {
1334
+ inputDelay: metric.attribution.inputDelay,
1335
+ processingDuration: metric.attribution.processingDuration,
1336
+ presentationDelay: metric.attribution.presentationDelay
1337
+ },
1338
+ startTime: metric.entries?.[0]?.startTime,
1339
+ entryGroupId: metric.entries?.[0]?.interactionId,
1340
+ interactionType: metric.attribution.interactionType
1341
+ };
1342
+ }
1297
1343
 
1298
1344
  // Copyright 2024 The Chromium Authors
1299
1345
  // Use of this source code is governed by a BSD-style license that can be
@@ -1385,25 +1431,6 @@
1385
1431
  window.getNodeForIndex = (index) => {
1386
1432
  return nodeList[index].deref();
1387
1433
  };
1388
- function limitScripts(loafs) {
1389
- return loafs.map(loaf => {
1390
- const longestScripts = [];
1391
- for (const script of loaf.scripts) {
1392
- if (longestScripts.length < SCRIPTS_PER_LOAF_LIMIT) {
1393
- longestScripts.push(script);
1394
- continue;
1395
- }
1396
- const shorterIndex = longestScripts.findIndex(s => s.duration < script.duration);
1397
- if (shorterIndex === -1) {
1398
- continue;
1399
- }
1400
- longestScripts[shorterIndex] = script;
1401
- }
1402
- longestScripts.sort((a, b) => a.startTime - b.startTime);
1403
- loaf.scripts = longestScripts;
1404
- return loaf;
1405
- });
1406
- }
1407
1434
  function isPrerendered() {
1408
1435
  if (document.prerendering) {
1409
1436
  return true;
@@ -1463,46 +1490,10 @@
1463
1490
  sendEventToDevTools(event);
1464
1491
  }, { reportAllChanges: true, reportSoftNavs: window.devToolsReportSoftNavs });
1465
1492
  function onEachInteraction(interaction) {
1466
- // Multiple `InteractionEntry` events can be emitted for the same `uniqueInteractionId`
1467
- // However, it is easier to combine these entries in the DevTools client rather than in
1468
- // this injected code.
1469
- const event = {
1470
- name: 'InteractionEntry',
1471
- duration: interaction.value,
1472
- subparts: {
1473
- inputDelay: interaction.attribution.inputDelay,
1474
- processingDuration: interaction.attribution.processingDuration,
1475
- presentationDelay: interaction.attribution.presentationDelay,
1476
- },
1477
- startTime: interaction.entries[0].startTime,
1478
- navigationId: interaction.navigationId,
1479
- entryGroupId: interaction.entries[0].interactionId,
1480
- nextPaintTime: interaction.attribution.nextPaintTime,
1481
- interactionType: interaction.attribution.interactionType,
1482
- eventName: interaction.entries[0].name,
1483
- // To limit the amount of events, just get the last 5 LoAFs
1484
- longAnimationFrameEntries: limitScripts(interaction.attribution.longAnimationFrameEntries.slice(-5).map(loaf => loaf.toJSON())),
1485
- };
1486
- const target = interaction.attribution.interactionTarget;
1487
- if (target) {
1488
- event.nodeIndex = Number(target);
1489
- }
1490
- sendEventToDevTools(event);
1493
+ sendEventToDevTools(createInteractionEntryEvent(interaction));
1491
1494
  }
1492
1495
  onINP(metric => {
1493
- const event = {
1494
- name: 'INP',
1495
- value: metric.value,
1496
- subparts: {
1497
- inputDelay: metric.attribution.inputDelay,
1498
- processingDuration: metric.attribution.processingDuration,
1499
- presentationDelay: metric.attribution.presentationDelay,
1500
- },
1501
- startTime: metric.entries[0].startTime,
1502
- entryGroupId: metric.entries[0].interactionId,
1503
- interactionType: metric.attribution.interactionType,
1504
- };
1505
- sendEventToDevTools(event);
1496
+ sendEventToDevTools(createInpChangeEvent(metric));
1506
1497
  }, {
1507
1498
  reportAllChanges: true,
1508
1499
  durationThreshold: 0,
File without changes