chrome-devtools-frontend 1.0.1153166 → 1.0.1155899

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.
Files changed (61) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -2
  2. package/front_end/core/common/Revealer.ts +1 -1
  3. package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
  4. package/front_end/core/host/UserMetrics.ts +32 -12
  5. package/front_end/core/platform/array-utilities.ts +25 -9
  6. package/front_end/core/sdk/ChildTargetManager.ts +2 -1
  7. package/front_end/core/sdk/FilmStripModel.ts +35 -25
  8. package/front_end/devtools_compatibility.js +2 -0
  9. package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +8 -2
  10. package/front_end/entrypoints/worker_app/worker_app.ts +0 -1
  11. package/front_end/generated/InspectorBackendCommands.js +2 -1
  12. package/front_end/generated/protocol.ts +36 -0
  13. package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +90 -73
  14. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  15. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +31 -61
  16. package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +69 -0
  17. package/front_end/models/issues_manager/descriptions/stylesheetLateImport.md +4 -0
  18. package/front_end/models/issues_manager/descriptions/stylesheetRequestFailed.md +3 -0
  19. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  20. package/front_end/models/timeline_model/TimelineModel.ts +4 -0
  21. package/front_end/models/trace/ModelImpl.ts +1 -0
  22. package/front_end/models/trace/README.md +73 -17
  23. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +1 -1
  24. package/front_end/models/trace/handlers/RendererHandler.ts +33 -143
  25. package/front_end/models/trace/handlers/UserTimings.md +1 -1
  26. package/front_end/models/trace/types/TraceEvents.ts +3 -2
  27. package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -6
  28. package/front_end/panels/application/PreloadingTreeElement.ts +25 -7
  29. package/front_end/panels/application/preloading/PreloadingView.ts +64 -31
  30. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +19 -9
  31. package/front_end/panels/console/ConsoleViewMessage.ts +14 -2
  32. package/front_end/panels/elements/ElementsPanel.ts +2 -3
  33. package/front_end/panels/elements/components/LayoutPane.ts +256 -60
  34. package/front_end/panels/elements/elements-legacy.ts +0 -3
  35. package/front_end/panels/elements/elements-meta.ts +10 -2
  36. package/front_end/panels/elements/elements.ts +0 -2
  37. package/front_end/panels/network/NetworkDataGridNode.ts +8 -0
  38. package/front_end/panels/network/NetworkLogView.ts +2 -1
  39. package/front_end/panels/network/NetworkPanel.ts +12 -1
  40. package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
  41. package/front_end/panels/sources/DebuggerPlugin.ts +7 -4
  42. package/front_end/panels/sources/SourcesPanel.ts +1 -1
  43. package/front_end/panels/sources/components/BreakpointsView.ts +406 -89
  44. package/front_end/panels/sources/sources-meta.ts +13 -4
  45. package/front_end/panels/sources/sources.ts +0 -2
  46. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
  47. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +106 -95
  48. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  49. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +5 -0
  50. package/front_end/panels/timeline/TimelinePanel.ts +8 -8
  51. package/front_end/ui/legacy/UIUtils.ts +1 -1
  52. package/front_end/ui/legacy/components/perf_ui/.eslintrc.js +18 -0
  53. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +5 -1
  54. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +5 -2
  55. package/front_end/ui/legacy/components/utils/Linkifier.ts +10 -0
  56. package/package.json +1 -1
  57. package/scripts/build/generate_deprecations.py +3 -0
  58. package/front_end/panels/elements/LayoutSidebarPane.ts +0 -249
  59. package/front_end/panels/sources/BreakpointsSidebarPane.ts +0 -480
  60. package/front_end/ui/components/docs/layout_pane/basic.html +0 -25
  61. package/front_end/ui/components/docs/layout_pane/basic.ts +0 -78
@@ -418,6 +418,8 @@ grd_files_release_sources = [
418
418
  "front_end/models/issues_manager/descriptions/heavyAd.md",
419
419
  "front_end/models/issues_manager/descriptions/mixedContent.md",
420
420
  "front_end/models/issues_manager/descriptions/sharedArrayBuffer.md",
421
+ "front_end/models/issues_manager/descriptions/stylesheetLateImport.md",
422
+ "front_end/models/issues_manager/descriptions/stylesheetRequestFailed.md",
421
423
  "front_end/models/issues_manager/issues_manager.js",
422
424
  "front_end/models/javascript_metadata/javascript_metadata.js",
423
425
  "front_end/models/logs/logs-meta.js",
@@ -878,6 +880,7 @@ grd_files_debug_sources = [
878
880
  "front_end/models/issues_manager/RelatedIssue.js",
879
881
  "front_end/models/issues_manager/SharedArrayBufferIssue.js",
880
882
  "front_end/models/issues_manager/SourceFrameIssuesManager.js",
883
+ "front_end/models/issues_manager/StylesheetLoadingIssue.js",
881
884
  "front_end/models/javascript_metadata/DOMPinnedProperties.js",
882
885
  "front_end/models/javascript_metadata/JavaScriptMetadata.js",
883
886
  "front_end/models/javascript_metadata/NativeFunctions.js",
@@ -1120,7 +1123,6 @@ grd_files_debug_sources = [
1120
1123
  "front_end/panels/elements/ImagePreviewPopover.js",
1121
1124
  "front_end/panels/elements/InspectElementModeController.js",
1122
1125
  "front_end/panels/elements/LayersWidget.js",
1123
- "front_end/panels/elements/LayoutSidebarPane.js",
1124
1126
  "front_end/panels/elements/MarkerDecorator.js",
1125
1127
  "front_end/panels/elements/MetricsSidebarPane.js",
1126
1128
  "front_end/panels/elements/NodeStackTraceWidget.js",
@@ -1467,7 +1469,6 @@ grd_files_debug_sources = [
1467
1469
  "front_end/panels/snippets/SnippetsQuickOpen.js",
1468
1470
  "front_end/panels/sources/AddSourceMapURLDialog.js",
1469
1471
  "front_end/panels/sources/BreakpointEditDialog.js",
1470
- "front_end/panels/sources/BreakpointsSidebarPane.js",
1471
1472
  "front_end/panels/sources/CSSPlugin.js",
1472
1473
  "front_end/panels/sources/CallStackSidebarPane.js",
1473
1474
  "front_end/panels/sources/CoveragePlugin.js",
@@ -62,7 +62,7 @@ export let reveal = async function(revealable: Object|null, omitFocus?: boolean)
62
62
  }
63
63
  };
64
64
 
65
- export function setRevealForTest(newReveal: (arg0: Object|null, arg1?: boolean|undefined) => Promise<undefined>): void {
65
+ export function setRevealForTest(newReveal: (arg0: Object|null, arg1?: boolean|undefined) => Promise<void>): void {
66
66
  reveal = newReveal;
67
67
  }
68
68
 
@@ -361,6 +361,7 @@ export enum EnumeratedHistogram {
361
361
  IssuesPanelOpenedFrom = 'DevTools.IssuesPanelOpenedFrom',
362
362
  IssuesPanelResourceOpened = 'DevTools.IssuesPanelResourceOpened',
363
363
  KeybindSetSettingChanged = 'DevTools.KeybindSetSettingChanged',
364
+ ElementsSidebarTabShown = 'DevTools.Elements.SidebarTabShown',
364
365
  ExperimentEnabledAtLaunch = 'DevTools.ExperimentEnabledAtLaunch',
365
366
  ExperimentEnabled = 'DevTools.ExperimentEnabled',
366
367
  ExperimentDisabled = 'DevTools.ExperimentDisabled',
@@ -379,6 +380,7 @@ export enum EnumeratedHistogram {
379
380
  RecordingReplaySpeed = 'DevTools.RecordingReplaySpeed',
380
381
  RecordingReplayStarted = 'DevTools.RecordingReplayStarted',
381
382
  RecordingToggled = 'DevTools.RecordingToggled',
383
+ SourcesSidebarTabShown = 'DevTools.Sources.SidebarTabShown',
382
384
  SourcesPanelFileDebugged = 'DevTools.SourcesPanelFileDebugged',
383
385
  SourcesPanelFileOpened = 'DevTools.SourcesPanelFileOpened',
384
386
  NetworkPanelResponsePreviewOpened = 'DevTools.NetworkPanelResponsePreviewOpened',
@@ -76,10 +76,16 @@ export class UserMetrics {
76
76
  this.#panelChangedSinceLaunch = true;
77
77
  }
78
78
 
79
- sidebarPaneShown(sidebarPaneName: string): void {
80
- const code = SidebarPaneCodes[sidebarPaneName as keyof typeof SidebarPaneCodes] || 0;
79
+ elementsSidebarTabShown(sidebarPaneName: string): void {
80
+ const code = ElementsSidebarTabCodes[sidebarPaneName as keyof typeof ElementsSidebarTabCodes] || 0;
81
81
  InspectorFrontendHostInstance.recordEnumeratedHistogram(
82
- EnumeratedHistogram.SidebarPaneShown, code, SidebarPaneCodes.MaxValue);
82
+ EnumeratedHistogram.ElementsSidebarTabShown, code, ElementsSidebarTabCodes.MaxValue);
83
+ }
84
+
85
+ sourcesSidebarTabShown(sidebarPaneName: string): void {
86
+ const code = SourcesSidebarTabCodes[sidebarPaneName as keyof typeof SourcesSidebarTabCodes] || 0;
87
+ InspectorFrontendHostInstance.recordEnumeratedHistogram(
88
+ EnumeratedHistogram.SourcesSidebarTabShown, code, SourcesSidebarTabCodes.MaxValue);
83
89
  }
84
90
 
85
91
  settingsPanelShown(settingsViewId: string): void {
@@ -509,7 +515,8 @@ export enum Action {
509
515
  RemoveFileSystemForOverrides = 77,
510
516
  FileSystemSourceSelected = 78,
511
517
  OverridesSourceSelected = 79,
512
- MaxValue = 80,
518
+ StyleSheetInitiatorLinkClicked = 80,
519
+ MaxValue = 81,
513
520
  }
514
521
 
515
522
  /* eslint-disable @typescript-eslint/naming-convention */
@@ -582,12 +589,13 @@ export enum PanelCodes {
582
589
  'bounce_tracking_mitigations' = 65,
583
590
  MaxValue = 66,
584
591
  }
592
+
585
593
  /* eslint-enable @typescript-eslint/naming-convention */
586
594
 
587
595
  /* eslint-disable @typescript-eslint/naming-convention */
588
596
  // TODO(crbug.com/1167717): Make this a const enum again
589
597
  // eslint-disable-next-line rulesdir/const_enum
590
- export enum SidebarPaneCodes {
598
+ export enum ElementsSidebarTabCodes {
591
599
  'OtherSidebarPane' = 0,
592
600
  'Styles' = 1,
593
601
  'Computed' = 2,
@@ -596,12 +604,22 @@ export enum SidebarPaneCodes {
596
604
  'elements.domBreakpoints' = 5,
597
605
  'elements.domProperties' = 6,
598
606
  'accessibility.view' = 7,
599
- 'navigator-network' = 8,
600
- 'navigator-files' = 9,
601
- 'navigator-overrides' = 10,
602
- 'navigator-contentScripts' = 11,
603
- 'navigator-snippets' = 12,
604
- MaxValue = 13,
607
+ MaxValue = 8,
608
+ }
609
+
610
+ /* eslint-enable @typescript-eslint/naming-convention */
611
+
612
+ /* eslint-disable @typescript-eslint/naming-convention */
613
+ // TODO(crbug.com/1167717): Make this a const enum again
614
+ // eslint-disable-next-line rulesdir/const_enum
615
+ export enum SourcesSidebarTabCodes {
616
+ 'OtherSidebarPane' = 0,
617
+ 'navigator-network' = 1,
618
+ 'navigator-files' = 2,
619
+ 'navigator-overrides' = 3,
620
+ 'navigator-contentScripts' = 4,
621
+ 'navigator-snippets' = 5,
622
+ MaxValue = 6,
605
623
  }
606
624
  /* eslint-enable @typescript-eslint/naming-convention */
607
625
 
@@ -1006,7 +1024,9 @@ export enum IssueCreated {
1006
1024
  'GenericIssue::FormLabelForMatchesNonExistingIdError' = 73,
1007
1025
  'GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError' = 74,
1008
1026
  'GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError' = 75,
1009
- MaxValue = 76,
1027
+ 'StylesheetLoadingIssue::LateImportRule' = 76,
1028
+ 'StylesheetLoadingIssue::RequestFailed' = 77,
1029
+ MaxValue = 78,
1010
1030
  }
1011
1031
 
1012
1032
  // TODO(crbug.com/1167717): Make this a const enum again
@@ -110,15 +110,23 @@ export const mergeOrdered = <T>(array1: T[], array2: T[], comparator: (a: T, b:
110
110
  return mergeOrIntersect(array1, array2, comparator, true);
111
111
  };
112
112
 
113
- export const DEFAULT_COMPARATOR = (a: string|number, b: string|number): number => {
113
+ export const DEFAULT_COMPARATOR = (a: string|number, b: string|number): -1|0|1 => {
114
114
  return a < b ? -1 : (a > b ? 1 : 0);
115
115
  };
116
116
 
117
117
  /**
118
- * Return index of the leftmost element that is equal or greater
119
- * than the specimen object. If there's no such element (i.e. all
120
- * elements are smaller than the specimen) returns right bound.
121
- * The function works for sorted array.
118
+ * Returns the index of the element closest to the needle that is equal to or
119
+ * greater than it. Assumes that the provided array is sorted.
120
+ *
121
+ * If no element is found, the right bound is returned.
122
+ *
123
+ * Uses the provided comparator function to determine if two items are equal or
124
+ * if one is greater than the other. If you are working with strings or
125
+ * numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you
126
+ * should define one that takes the needle element and an element from the
127
+ * array and returns a positive or negative number to indicate which is greater
128
+ * than the other.
129
+ *
122
130
  * When specified, |left| (inclusive) and |right| (exclusive) indices
123
131
  * define the search window.
124
132
  */
@@ -143,10 +151,18 @@ export function lowerBound<S, T, A extends S[]>(
143
151
  }
144
152
 
145
153
  /**
146
- * Return index of the leftmost element that is greater
147
- * than the specimen object. If there's no such element (i.e. all
148
- * elements are smaller or equal to the specimen) returns right bound.
149
- * The function works for sorted array.
154
+ * Returns the index of the element closest to the needle that is greater than
155
+ * it. Assumes that the provided array is sorted.
156
+ *
157
+ * If no element is found, the right bound is returned.
158
+ *
159
+ * Uses the provided comparator function to determine if two items are equal or
160
+ * if one is greater than the other. If you are working with strings or
161
+ * numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you
162
+ * should define one that takes the needle element and an element from the
163
+ * array and returns a positive or negative number to indicate which is greater
164
+ * than the other.
165
+ *
150
166
  * When specified, |left| (inclusive) and |right| (exclusive) indices
151
167
  * define the search window.
152
168
  */
@@ -129,7 +129,8 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
129
129
  if (targetInfo.type === 'worker' && targetInfo.title && targetInfo.title !== targetInfo.url) {
130
130
  targetName = targetInfo.title;
131
131
  } else if (!['page', 'iframe', 'webview'].includes(targetInfo.type)) {
132
- if (targetInfo.url === 'chrome://print/') {
132
+ if (targetInfo.url === 'chrome://print/' ||
133
+ (targetInfo.url.startsWith('chrome://') && targetInfo.url.endsWith('.top-chrome/'))) {
133
134
  type = Type.Frame;
134
135
  } else {
135
136
  const parsedURL = Common.ParsedURL.ParsedURL.fromString(targetInfo.url);
@@ -2,9 +2,10 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import * as TraceEngine from '../../models/trace/trace.js';
5
6
  import * as Platform from '../platform/platform.js';
6
7
 
7
- import {TracingModel, type Event, type ObjectSnapshot} from './TracingModel.js';
8
+ import {TracingModel, type ObjectSnapshot} from './TracingModel.js';
8
9
 
9
10
  export class FilmStripModel {
10
11
  #framesInternal: Frame[];
@@ -34,15 +35,10 @@ export class FilmStripModel {
34
35
  if (event.startTime < this.#zeroTimeInternal) {
35
36
  continue;
36
37
  }
37
- if (!event.hasCategory(category)) {
38
+ if (!event.hasCategory(DEVTOOLS_SCREENSHOT_CATEGORY)) {
38
39
  continue;
39
40
  }
40
- if (event.name === TraceEvents.CaptureFrame) {
41
- const data = event.args['data'];
42
- if (data) {
43
- this.#framesInternal.push(Frame.fromEvent(this, event, this.#framesInternal.length));
44
- }
45
- } else if (event.name === TraceEvents.Screenshot) {
41
+ if (event.name === TraceEvents.Screenshot) {
46
42
  this.#framesInternal.push(Frame.fromSnapshot(this, (event as ObjectSnapshot), this.#framesInternal.length));
47
43
  }
48
44
  }
@@ -60,18 +56,25 @@ export class FilmStripModel {
60
56
  return this.#spanTimeInternal;
61
57
  }
62
58
 
63
- frameByTimestamp(timestamp: number): Frame|null {
64
- const index = Platform.ArrayUtilities.upperBound(
65
- this.#framesInternal, timestamp, (timestamp, frame) => timestamp - frame.timestamp) -
66
- 1;
67
- return index >= 0 ? this.#framesInternal[index] : null;
59
+ frameByTimestamp(searchTimestamp: number): Frame|null {
60
+ // We want to find the closest frame to the timestamp that happened BEFORE
61
+ // the timestamp. So to do that we walk from the end of the array of
62
+ // frames, looking for the first frame where its timestamp is less than the
63
+ // timestamp we are searching for. It is important we search from the end
64
+ // of the array of frames, otherwise we will simply return the first frame
65
+ // that happened before the timestamp, even if it is not the closest one.
66
+ const closestFrameIndexBeforeTimestamp =
67
+ Platform.ArrayUtilities.nearestIndexFromEnd(this.#framesInternal, frame => frame.timestamp < searchTimestamp);
68
+ if (closestFrameIndexBeforeTimestamp === null) {
69
+ return null;
70
+ }
71
+ return this.#framesInternal[closestFrameIndexBeforeTimestamp];
68
72
  }
69
73
  }
70
74
 
71
- const category = 'disabled-by-default-devtools.screenshot';
75
+ const DEVTOOLS_SCREENSHOT_CATEGORY = 'disabled-by-default-devtools.screenshot';
72
76
 
73
77
  const TraceEvents = {
74
- CaptureFrame: 'CaptureFrame',
75
78
  Screenshot: 'Screenshot',
76
79
  };
77
80
 
@@ -79,35 +82,42 @@ export class Frame {
79
82
  readonly #modelInternal: FilmStripModel;
80
83
  timestamp: number;
81
84
  index: number;
82
- #imageData: string|null;
83
85
  #snapshot: ObjectSnapshot|null;
86
+ #traceEvent: TraceEngine.Types.TraceEvents.TraceEventSnapshot|null;
87
+
84
88
  constructor(model: FilmStripModel, timestamp: number, index: number) {
85
89
  this.#modelInternal = model;
86
90
  this.timestamp = timestamp;
87
91
  this.index = index;
88
- this.#imageData = null;
92
+ this.#traceEvent = null;
89
93
  this.#snapshot = null;
90
94
  }
91
95
 
92
- static fromEvent(model: FilmStripModel, event: Event, index: number): Frame {
93
- const frame = new Frame(model, event.startTime, index);
94
- frame.#imageData = event.args['data'];
95
- return frame;
96
- }
97
-
98
96
  static fromSnapshot(model: FilmStripModel, snapshot: ObjectSnapshot, index: number): Frame {
99
97
  const frame = new Frame(model, snapshot.startTime, index);
100
98
  frame.#snapshot = snapshot;
101
99
  return frame;
102
100
  }
103
101
 
102
+ static fromTraceEvent(
103
+ model: FilmStripModel, snapshot: TraceEngine.Types.TraceEvents.TraceEventSnapshot, index: number): Frame {
104
+ const startTime = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(snapshot.ts);
105
+ const frame = new Frame(model, startTime, index);
106
+ frame.#traceEvent = snapshot;
107
+ return frame;
108
+ }
109
+
104
110
  model(): FilmStripModel {
105
111
  return this.#modelInternal;
106
112
  }
107
113
 
108
114
  imageDataPromise(): Promise<string|null> {
109
- if (this.#imageData || !this.#snapshot) {
110
- return Promise.resolve(this.#imageData);
115
+ if (this.#traceEvent) {
116
+ return Promise.resolve(this.#traceEvent.args.snapshot);
117
+ }
118
+
119
+ if (!this.#snapshot) {
120
+ return Promise.resolve(null);
111
121
  }
112
122
 
113
123
  return this.#snapshot.objectPromise() as Promise<string|null>;
@@ -400,6 +400,7 @@ const EnumeratedHistogram = {
400
400
  CSSHintShown: 'DevTools.CSSHintShown',
401
401
  DeveloperResourceLoaded: 'DevTools.DeveloperResourceLoaded',
402
402
  DeveloperResourceScheme: 'DevTools.DeveloperResourceScheme',
403
+ ElementsSidebarTabShown: 'DevTools.Elements.SidebarTabShown',
403
404
  ExperimentDisabled: 'DevTools.ExperimentDisabled',
404
405
  ExperimentEnabled: 'DevTools.ExperimentEnabled',
405
406
  ExperimentEnabledAtLaunch: 'DevTools.ExperimentEnabledAtLaunch',
@@ -426,6 +427,7 @@ const EnumeratedHistogram = {
426
427
  RecordingReplayStarted: 'DevTools.RecordingReplayStarted',
427
428
  RecordingToggled: 'DevTools.RecordingToggled',
428
429
  SidebarPaneShown: 'DevTools.SidebarPaneShown',
430
+ SourcesSidebarTabShown: 'DevTools.Sources.SidebarTabShown',
429
431
  SourcesPanelFileDebugged: 'DevTools.SourcesPanelFileDebugged',
430
432
  SourcesPanelFileOpened: 'DevTools.SourcesPanelFileOpened',
431
433
  NetworkPanelResponsePreviewOpened: 'DevTools.NetworkPanelResponsePreviewOpened',
@@ -144,8 +144,14 @@ async function invokeLH(action: string, args: any): Promise<unknown> {
144
144
  targetInfos,
145
145
  // For the most part, defer to Lighthouse for which targets are important.
146
146
  // Excluding devtools targets is required for e2e tests to work, and LH doesn't support auditing DT targets anyway.
147
- targetFilterCallback: targetInfo =>
148
- !targetInfo.url.match(/^https:\/\/i0.devtools-frontend/) && !targetInfo.url.match(/^devtools:\/\//),
147
+ targetFilterCallback: targetInfo => {
148
+ if (targetInfo.url.startsWith('https://i0.devtools-frontend') || targetInfo.url.startsWith('devtools://')) {
149
+ return false;
150
+ }
151
+ // TODO only connect to iframes that are related to the main target. This requires refactoring in Puppeteer: https://github.com/puppeteer/puppeteer/issues/3667.
152
+ return (
153
+ targetInfo.targetId === mainFrameId || targetInfo.openerId === mainFrameId || targetInfo.type === 'iframe');
154
+ },
149
155
  // Lighthouse can only audit normal pages.
150
156
  isPageTargetCallback: targetInfo => targetInfo.type === 'page',
151
157
  });
@@ -4,7 +4,6 @@
4
4
  import '../shell/shell.js';
5
5
  import '../../panels/browser_debugger/browser_debugger-meta.js';
6
6
  import '../../panels/developer_resources/developer_resources-meta.js';
7
- import '../../panels/elements/elements-meta.js';
8
7
  import '../../panels/issues/issues-meta.js';
9
8
  import '../../panels/layer_viewer/layer_viewer-meta.js';
10
9
  import '../../panels/mobile_throttling/mobile_throttling-meta.js';
@@ -66,7 +66,8 @@ inspectorBackend.registerEnum("Audits.AttributionReportingIssueType", {Permissio
66
66
  inspectorBackend.registerEnum("Audits.GenericIssueErrorType", {CrossOriginPortalPostMessageError: "CrossOriginPortalPostMessageError", FormLabelForNameError: "FormLabelForNameError", FormDuplicateIdForInputError: "FormDuplicateIdForInputError", FormInputWithNoLabelError: "FormInputWithNoLabelError", FormAutocompleteAttributeEmptyError: "FormAutocompleteAttributeEmptyError", FormEmptyIdAndNameAttributesForInputError: "FormEmptyIdAndNameAttributesForInputError", FormAriaLabelledByToNonExistingId: "FormAriaLabelledByToNonExistingId", FormInputAssignedAutocompleteValueToIdOrNameAttributeError: "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", FormLabelHasNeitherForNorNestedInput: "FormLabelHasNeitherForNorNestedInput", FormLabelForMatchesNonExistingIdError: "FormLabelForMatchesNonExistingIdError", FormInputHasWrongButWellIntendedAutocompleteValueError: "FormInputHasWrongButWellIntendedAutocompleteValueError"});
67
67
  inspectorBackend.registerEnum("Audits.ClientHintIssueReason", {MetaTagAllowListInvalidOrigin: "MetaTagAllowListInvalidOrigin", MetaTagModifiedHTML: "MetaTagModifiedHTML"});
68
68
  inspectorBackend.registerEnum("Audits.FederatedAuthRequestIssueReason", {ShouldEmbargo: "ShouldEmbargo", TooManyRequests: "TooManyRequests", WellKnownHttpNotFound: "WellKnownHttpNotFound", WellKnownNoResponse: "WellKnownNoResponse", WellKnownInvalidResponse: "WellKnownInvalidResponse", WellKnownListEmpty: "WellKnownListEmpty", WellKnownInvalidContentType: "WellKnownInvalidContentType", ConfigNotInWellKnown: "ConfigNotInWellKnown", WellKnownTooBig: "WellKnownTooBig", ConfigHttpNotFound: "ConfigHttpNotFound", ConfigNoResponse: "ConfigNoResponse", ConfigInvalidResponse: "ConfigInvalidResponse", ConfigInvalidContentType: "ConfigInvalidContentType", ClientMetadataHttpNotFound: "ClientMetadataHttpNotFound", ClientMetadataNoResponse: "ClientMetadataNoResponse", ClientMetadataInvalidResponse: "ClientMetadataInvalidResponse", ClientMetadataInvalidContentType: "ClientMetadataInvalidContentType", DisabledInSettings: "DisabledInSettings", ErrorFetchingSignin: "ErrorFetchingSignin", InvalidSigninResponse: "InvalidSigninResponse", AccountsHttpNotFound: "AccountsHttpNotFound", AccountsNoResponse: "AccountsNoResponse", AccountsInvalidResponse: "AccountsInvalidResponse", AccountsListEmpty: "AccountsListEmpty", AccountsInvalidContentType: "AccountsInvalidContentType", IdTokenHttpNotFound: "IdTokenHttpNotFound", IdTokenNoResponse: "IdTokenNoResponse", IdTokenInvalidResponse: "IdTokenInvalidResponse", IdTokenInvalidRequest: "IdTokenInvalidRequest", IdTokenInvalidContentType: "IdTokenInvalidContentType", ErrorIdToken: "ErrorIdToken", Canceled: "Canceled", RpPageNotVisible: "RpPageNotVisible", SilentMediationFailure: "SilentMediationFailure", ThirdPartyCookiesBlocked: "ThirdPartyCookiesBlocked"});
69
- inspectorBackend.registerEnum("Audits.InspectorIssueCode", {CookieIssue: "CookieIssue", MixedContentIssue: "MixedContentIssue", BlockedByResponseIssue: "BlockedByResponseIssue", HeavyAdIssue: "HeavyAdIssue", ContentSecurityPolicyIssue: "ContentSecurityPolicyIssue", SharedArrayBufferIssue: "SharedArrayBufferIssue", LowTextContrastIssue: "LowTextContrastIssue", CorsIssue: "CorsIssue", AttributionReportingIssue: "AttributionReportingIssue", QuirksModeIssue: "QuirksModeIssue", NavigatorUserAgentIssue: "NavigatorUserAgentIssue", GenericIssue: "GenericIssue", DeprecationIssue: "DeprecationIssue", ClientHintIssue: "ClientHintIssue", FederatedAuthRequestIssue: "FederatedAuthRequestIssue", BounceTrackingIssue: "BounceTrackingIssue"});
69
+ inspectorBackend.registerEnum("Audits.StyleSheetLoadingIssueReason", {LateImportRule: "LateImportRule", RequestFailed: "RequestFailed"});
70
+ inspectorBackend.registerEnum("Audits.InspectorIssueCode", {CookieIssue: "CookieIssue", MixedContentIssue: "MixedContentIssue", BlockedByResponseIssue: "BlockedByResponseIssue", HeavyAdIssue: "HeavyAdIssue", ContentSecurityPolicyIssue: "ContentSecurityPolicyIssue", SharedArrayBufferIssue: "SharedArrayBufferIssue", LowTextContrastIssue: "LowTextContrastIssue", CorsIssue: "CorsIssue", AttributionReportingIssue: "AttributionReportingIssue", QuirksModeIssue: "QuirksModeIssue", NavigatorUserAgentIssue: "NavigatorUserAgentIssue", GenericIssue: "GenericIssue", DeprecationIssue: "DeprecationIssue", ClientHintIssue: "ClientHintIssue", FederatedAuthRequestIssue: "FederatedAuthRequestIssue", BounceTrackingIssue: "BounceTrackingIssue", StylesheetLoadingIssue: "StylesheetLoadingIssue"});
70
71
  inspectorBackend.registerEvent("Audits.issueAdded", ["issue"]);
71
72
  inspectorBackend.registerEnum("Audits.GetEncodedResponseRequestEncoding", {Webp: "webp", Jpeg: "jpeg", Png: "png"});
72
73
  inspectorBackend.registerCommand("Audits.getEncodedResponse", [{"name": "requestId", "type": "string", "optional": false}, {"name": "encoding", "type": "string", "optional": false}, {"name": "quality", "type": "number", "optional": true}, {"name": "sizeOnly", "type": "boolean", "optional": true}], ["body", "originalSize", "encodedSize"]);
@@ -1101,6 +1101,40 @@ export namespace Audits {
1101
1101
  clientHintIssueReason: ClientHintIssueReason;
1102
1102
  }
1103
1103
 
1104
+ export interface FailedRequestInfo {
1105
+ /**
1106
+ * The URL that failed to load.
1107
+ */
1108
+ url: string;
1109
+ /**
1110
+ * The failure message for the failed request.
1111
+ */
1112
+ failureMessage: string;
1113
+ }
1114
+
1115
+ export const enum StyleSheetLoadingIssueReason {
1116
+ LateImportRule = 'LateImportRule',
1117
+ RequestFailed = 'RequestFailed',
1118
+ }
1119
+
1120
+ /**
1121
+ * This issue warns when a referenced stylesheet couldn't be loaded.
1122
+ */
1123
+ export interface StylesheetLoadingIssueDetails {
1124
+ /**
1125
+ * Source code position that referenced the failing stylesheet.
1126
+ */
1127
+ sourceCodeLocation: SourceCodeLocation;
1128
+ /**
1129
+ * Reason why the stylesheet couldn't be loaded.
1130
+ */
1131
+ styleSheetLoadingIssueReason: StyleSheetLoadingIssueReason;
1132
+ /**
1133
+ * Contains additional info when the failure was due to a request.
1134
+ */
1135
+ failedRequestInfo?: FailedRequestInfo;
1136
+ }
1137
+
1104
1138
  /**
1105
1139
  * A unique identifier for the type of issue. Each type may use one of the
1106
1140
  * optional fields in InspectorIssueDetails to convey more specific
@@ -1123,6 +1157,7 @@ export namespace Audits {
1123
1157
  ClientHintIssue = 'ClientHintIssue',
1124
1158
  FederatedAuthRequestIssue = 'FederatedAuthRequestIssue',
1125
1159
  BounceTrackingIssue = 'BounceTrackingIssue',
1160
+ StylesheetLoadingIssue = 'StylesheetLoadingIssue',
1126
1161
  }
1127
1162
 
1128
1163
  /**
@@ -1147,6 +1182,7 @@ export namespace Audits {
1147
1182
  clientHintIssueDetails?: ClientHintIssueDetails;
1148
1183
  federatedAuthRequestIssueDetails?: FederatedAuthRequestIssueDetails;
1149
1184
  bounceTrackingIssueDetails?: BounceTrackingIssueDetails;
1185
+ stylesheetLoadingIssueDetails?: StylesheetLoadingIssueDetails;
1150
1186
  }
1151
1187
 
1152
1188
  /**