chrome-devtools-frontend 1.0.1660788 → 1.0.1661063

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 (132) hide show
  1. package/.agents/skills/evaluate-ai-css-completion/SKILL.md +133 -0
  2. package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +76 -0
  3. package/eslint.config.mjs +7 -0
  4. package/extension-api/ExtensionAPI.d.ts +88 -0
  5. package/front_end/core/host/InspectorFrontendHost.ts +1 -0
  6. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  7. package/front_end/core/platform/StringUtilities.ts +20 -4
  8. package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
  9. package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
  10. package/front_end/core/sdk/DOMModel.ts +1 -0
  11. package/front_end/core/sdk/DebuggerModel.ts +4 -4
  12. package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
  13. package/front_end/core/sdk/FrameManager.ts +1 -0
  14. package/front_end/core/sdk/IsolateManager.ts +1 -0
  15. package/front_end/core/sdk/NetworkManager.ts +2 -0
  16. package/front_end/core/sdk/NetworkRequest.ts +1 -0
  17. package/front_end/core/sdk/PageResourceLoader.ts +2 -0
  18. package/front_end/core/sdk/SourceMap.ts +5 -5
  19. package/front_end/core/sdk/SourceMapManager.ts +3 -2
  20. package/front_end/core/sdk/TargetManager.ts +4 -0
  21. package/front_end/entrypoints/main/MainImpl.ts +2 -1
  22. package/front_end/models/bindings/CompilerScriptMapping.ts +5 -6
  23. package/front_end/models/bindings/ContentProviderBasedProject.ts +4 -4
  24. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -4
  25. package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
  26. package/front_end/models/bindings/NetworkProject.ts +1 -10
  27. package/front_end/models/bindings/ResourceMapping.ts +3 -4
  28. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -3
  29. package/front_end/models/bindings/SASSSourceMapping.ts +3 -4
  30. package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
  31. package/front_end/models/bindings/TempFile.ts +8 -3
  32. package/front_end/models/extensions/ExtensionAPI.ts +110 -46
  33. package/front_end/models/formatter/ScriptFormatter.ts +8 -11
  34. package/front_end/models/issues_manager/CookieIssue.ts +21 -9
  35. package/front_end/models/issues_manager/Issue.ts +3 -4
  36. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  37. package/front_end/models/issues_manager/IssueResolver.ts +2 -2
  38. package/front_end/models/issues_manager/IssuesManager.ts +136 -137
  39. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  40. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
  41. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +13 -10
  42. package/front_end/models/workspace/WorkspaceImpl.ts +10 -1
  43. package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
  44. package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
  45. package/front_end/panels/application/FrameDetailsView.ts +1 -1
  46. package/front_end/panels/application/WebMCPView.ts +38 -43
  47. package/front_end/panels/application/components/AdsView.ts +201 -30
  48. package/front_end/panels/application/components/adsView.css +25 -0
  49. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
  50. package/front_end/panels/console/ConsoleView.ts +2 -1
  51. package/front_end/panels/console/PromptBuilder.ts +2 -1
  52. package/front_end/panels/emulation/DeviceModeView.ts +52 -70
  53. package/front_end/panels/issues/IssueView.ts +0 -2
  54. package/front_end/panels/issues/IssuesPane.ts +1 -8
  55. package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
  56. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
  57. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
  58. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
  59. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
  60. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
  61. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
  62. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
  63. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
  64. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  65. package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
  66. package/front_end/panels/network/RequestPayloadView.ts +15 -13
  67. package/front_end/panels/network/RequestTimingView.ts +95 -127
  68. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
  69. package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
  70. package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
  71. package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
  72. package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
  73. package/front_end/panels/recorder/RecorderController.ts +88 -77
  74. package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
  75. package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
  76. package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
  77. package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
  78. package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
  79. package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
  80. package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
  81. package/front_end/panels/recorder/recorder.ts +23 -1
  82. package/front_end/panels/recorder/util/util.ts +113 -0
  83. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +2 -2
  84. package/front_end/panels/sources/SourcesNavigator.ts +2 -3
  85. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  86. package/front_end/panels/timeline/IsolateSelector.ts +10 -8
  87. package/front_end/panels/timeline/TimelinePanel.ts +18 -7
  88. package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
  89. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  90. package/front_end/third_party/chromium/README.chromium +1 -1
  91. package/front_end/ui/legacy/Treeoutline.ts +3 -0
  92. package/front_end/ui/legacy/Widget.ts +14 -15
  93. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
  94. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
  95. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
  96. package/package.json +1 -1
  97. package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
  98. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
  99. package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
  100. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  101. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  102. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
  103. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  104. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  105. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  106. package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
  107. package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  108. package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
  109. package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
  110. package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
  111. package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
  112. package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
  113. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
  114. package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
  115. package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
  116. package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
  117. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
  118. package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
  119. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
  120. package/front_end/panels/recorder/components/components.ts +0 -25
  121. package/front_end/panels/recorder/components/util.ts +0 -116
  122. /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
  123. /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
  124. /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
  125. /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
  126. /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
  127. /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
  128. /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
  129. /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
  130. /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
  131. /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
  132. /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
@@ -101,8 +101,9 @@ UI.ViewManager.registerViewExtension({
101
101
  order: 50,
102
102
  async loadView(universe) {
103
103
  const Timeline = await loadTimelineModule();
104
- const {pageResourceLoader: resourceLoader} = universe;
105
- return Timeline.TimelinePanel.TimelinePanel.instance({forceNew: true, resourceLoader});
104
+ const {pageResourceLoader: resourceLoader, targetManager, isolateManager} = universe;
105
+ return Timeline.TimelinePanel.TimelinePanel.instance(
106
+ {forceNew: true, resourceLoader, targetManager, isolateManager});
106
107
  },
107
108
  });
108
109
 
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: Internal
3
3
  Version: N/A
4
- Revision: 3b182a93aa48827df1b3cec658c8b9de8d324d54
4
+ Revision: a37baa84e85d62d8bdc7eef3ff6237217c0c8a9e
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -1895,6 +1895,9 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
1895
1895
  removeNode(treeElement);
1896
1896
  }
1897
1897
  parent.treeElement.insertChild(treeElement, index);
1898
+ if (parent.treeElement instanceof TreeViewTreeElement) {
1899
+ parent.treeElement.updateExpansionFromAttribute();
1900
+ }
1898
1901
  if (hasBooleanAttribute(node, 'selected')) {
1899
1902
  treeElement.revealAndSelect(true);
1900
1903
  }
@@ -84,7 +84,8 @@ function enqueueIntoNextUpdateQueue(widget: AnyWidget): Promise<void> {
84
84
  nextUpdateQueue.delete(widget);
85
85
  nextUpdateQueue.set(widget, scheduledUpdate);
86
86
  if (pendingAnimationFrame === null) {
87
- pendingAnimationFrame = requestAnimationFrame(runNextUpdate);
87
+ const widgetWindow = widget.contentElement.window() || window;
88
+ pendingAnimationFrame = widgetWindow.requestAnimationFrame(runNextUpdate);
88
89
  }
89
90
  return scheduledUpdate.promise;
90
91
  }
@@ -155,7 +156,8 @@ function runNextUpdate(): void {
155
156
  if (nextUpdate) {
156
157
  void nextUpdate.promise.then(resolve);
157
158
  if (pendingAnimationFrame === null) {
158
- pendingAnimationFrame = requestAnimationFrame(runNextUpdate);
159
+ const widgetWindow = widget.contentElement.window() || window;
160
+ pendingAnimationFrame = widgetWindow.requestAnimationFrame(runNextUpdate);
159
161
  }
160
162
  } else {
161
163
  resolve();
@@ -182,16 +184,16 @@ function runNextUpdate(): void {
182
184
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
183
185
  const widgetConfigs = new WeakMap<HTMLElement, WidgetConfig<any>>();
184
186
 
185
- export function registerWidgetConfig<WidgetT extends AnyWidget>(
186
- element: HTMLElement, config: WidgetConfig<WidgetT>): void {
187
+ export function registerWidgetConfig<WidgetT extends AnyWidget>(element: HTMLElement,
188
+ config: WidgetConfig<WidgetT>): void {
187
189
  if (!widgetConfigs.has(element)) {
188
190
  setUpLifecycleTracking(element);
189
191
  }
190
192
  widgetConfigs.set(element, config);
191
193
  }
192
194
 
193
- function instantiateWidget<WidgetT extends AnyWidget>(
194
- element: HTMLElement, widgetConfig: WidgetConfig<WidgetT>): WidgetT {
195
+ function instantiateWidget<WidgetT extends AnyWidget>(element: HTMLElement,
196
+ widgetConfig: WidgetConfig<WidgetT>): WidgetT {
195
197
  if (!widgetConfig.widgetClass) {
196
198
  throw new Error('No widgetClass defined');
197
199
  }
@@ -794,9 +796,8 @@ export class Widget<ContentTypeT extends HTMLElement|DocumentFragment = HTMLElem
794
796
  if (this.#isRoot) {
795
797
  assert(!currentParent, 'Attempt to show root widget under another widget');
796
798
  } else {
797
- assert(
798
- currentParent && widgetMap.get(currentParent) === this.#parentWidget,
799
- 'Attempt to show under node belonging to alien widget');
799
+ assert(currentParent && widgetMap.get(currentParent) === this.#parentWidget,
800
+ 'Attempt to show under node belonging to alien widget');
800
801
  }
801
802
 
802
803
  const wasVisible = this.#visible;
@@ -1031,9 +1032,8 @@ export class Widget<ContentTypeT extends HTMLElement|DocumentFragment = HTMLElem
1031
1032
  getDefaultFocusedElement(): HTMLElement|null {
1032
1033
  const elements = this.getDefaultFocusedElements();
1033
1034
  if (elements.length > 1) {
1034
- console.error(
1035
- 'Multiple autofocus elements found', this.constructor.name,
1036
- ...elements.map(e => Platform.StringUtilities.trimMiddle(e.outerHTML, 250)));
1035
+ console.error('Multiple autofocus elements found', this.constructor.name,
1036
+ ...elements.map(e => Platform.StringUtilities.trimMiddle(e.outerHTML, 250)));
1037
1037
  }
1038
1038
  return elements[0] || null;
1039
1039
  }
@@ -1110,9 +1110,8 @@ export class Widget<ContentTypeT extends HTMLElement|DocumentFragment = HTMLElem
1110
1110
 
1111
1111
  private hasNonZeroConstraints(): boolean {
1112
1112
  const constraints = this.constraints();
1113
- return Boolean(
1114
- constraints.minimum.width || constraints.minimum.height || constraints.preferred.width ||
1115
- constraints.preferred.height);
1113
+ return Boolean(constraints.minimum.width || constraints.minimum.height || constraints.preferred.width ||
1114
+ constraints.preferred.height);
1116
1115
  }
1117
1116
 
1118
1117
  suspendInvalidations(): void {
@@ -442,6 +442,7 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
442
442
  get canExpandRecursively(): boolean {
443
443
  return true;
444
444
  }
445
+
445
446
  get sortPropertiesAlphabetically(): boolean {
446
447
  if (this.isWasm) {
447
448
  return false;
@@ -457,7 +458,6 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
457
458
  setting.set(value);
458
459
  this.removeChildren();
459
460
  }
460
-
461
461
  // Performs a pre-order tree traversal over the populated children. If any children need to be populated, callers must
462
462
  // do that while walking (pre-order visitation enables that).
463
463
  * #walk(maxDepth = -1, filter?: (node: ObjectTreeNodeBase) => boolean): Generator<ObjectTreeNodeBase> {
@@ -783,6 +783,7 @@ export class ObjectTreeNode extends ObjectTreeNodeBase {
783
783
  override get canExpandRecursively(): boolean {
784
784
  return this.property.name !== '[[Prototype]]';
785
785
  }
786
+
786
787
  get name(): string {
787
788
  return this.property.name;
788
789
  }
@@ -806,7 +807,7 @@ export class ObjectTreeNode extends ObjectTreeNodeBase {
806
807
  } else if (isInteger.test(this.name)) {
807
808
  this.#path = `${parentPath}[${this.name}]`;
808
809
  } else {
809
- this.#path = `${parentPath}[${JSON.stringify(this.name)}]`;
810
+ this.#path = `${parentPath}[${Platform.StringUtilities.formatAsJSLiteral(this.name)}]`;
810
811
  }
811
812
  }
812
813
  return this.#path;
@@ -1151,7 +1152,7 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
1151
1152
  return html`<span class=value title=${description}>${'<' + i18nString(UIStrings.unknown) + '>'}</span>`;
1152
1153
  }
1153
1154
  if (type === 'string' && typeof description === 'string') {
1154
- const text = JSON.stringify(description);
1155
+ const text = Platform.StringUtilities.escapeUnicode(JSON.stringify(description));
1155
1156
  const tooLong = description.length > maxRenderableStringLength;
1156
1157
  return html`<span class="value object-value-string" title=${ifDefined(tooLong ? undefined : description)}>${
1157
1158
  tooLong ? widget(ExpandableTextPropertyValue, {text}) : text}</span>`;
@@ -1162,7 +1163,7 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
1162
1163
  return html`<span class="value object-value-trustedtype" title=${ifDefined(tooLong ? undefined : text)}>${
1163
1164
  tooLong ? widget(ExpandableTextPropertyValue, {text}) :
1164
1165
  html`${className} <span class=object-value-string title=${description}>${
1165
- JSON.stringify(description)}</span>`}</span>`;
1166
+ Platform.StringUtilities.escapeUnicode(JSON.stringify(description))}</span>`}</span>`;
1166
1167
  }
1167
1168
  if (type === 'function') {
1168
1169
  return ObjectPropertiesSection.valueElementForFunctionDescription(description, undefined, undefined, 'value');
@@ -1320,7 +1321,8 @@ export function populateObjectTreeContextMenu(
1320
1321
 
1321
1322
  if (object.object instanceof SDK.RemoteObject.LocalJSONObject) {
1322
1323
  const {value} = object.object;
1323
- const propertyValue = typeof value === 'object' ? JSON.stringify(value, null, 2) : value;
1324
+ const propertyValue =
1325
+ typeof value === 'object' ? Platform.StringUtilities.escapeUnicode(JSON.stringify(value, null, 2)) : value;
1324
1326
  const copyValueHandler = (): void => {
1325
1327
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue);
1326
1328
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText((propertyValue as string | undefined));
@@ -1379,7 +1381,7 @@ export function renderObjectTree(
1379
1381
 
1380
1382
  return until(promise, html`<ul class="source-code object-properties-section" role="group"></ul>`);
1381
1383
  }
1382
- export class RootElement extends UI.TreeOutline.TreeElement {
1384
+ class RootElement extends UI.TreeOutline.TreeElement {
1383
1385
  private readonly object: ObjectTree;
1384
1386
  private readonly linkifier: Components.Linkifier.Linkifier|undefined;
1385
1387
  private readonly emptyPlaceholder: string|null|undefined;
@@ -1997,6 +1999,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
1997
1999
  this.collapse();
1998
2000
  }
1999
2001
  }
2002
+
2000
2003
  getContextMenu(event: Event): UI.ContextMenu.ContextMenu {
2001
2004
  const contextMenu = new UI.ContextMenu.ContextMenu(event);
2002
2005
  contextMenu.appendApplicableItems(this);
@@ -2007,7 +2010,8 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
2007
2010
  contextMenu.appendApplicableItems(this.property.object);
2008
2011
  if (this.property.parent?.object instanceof SDK.RemoteObject.LocalJSONObject) {
2009
2012
  const {object: {value}} = this.property;
2010
- const propertyValue = typeof value === 'object' ? JSON.stringify(value, null, 2) : value;
2013
+ const propertyValue =
2014
+ typeof value === 'object' ? Platform.StringUtilities.escapeUnicode(JSON.stringify(value, null, 2)) : value;
2011
2015
  const copyValueHandler = (): void => {
2012
2016
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue);
2013
2017
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText((propertyValue as string | undefined));
@@ -392,7 +392,8 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
392
392
  const content =
393
393
  this.rawContent instanceof CodeMirror.Text ? this.rawContent.sliceString(0) : this.rawContent || '';
394
394
  this.textEditor.state = this.placeholderEditorState(i18nString(UIStrings.formatting));
395
- const formatInfo = await Formatter.ScriptFormatter.formatScriptContent(this.contentType, content);
395
+ const formatInfo = await Formatter.ScriptFormatter.formatScriptContent(Common.Settings.Settings.instance(),
396
+ this.contentType, content);
396
397
  this.formattedMap = formatInfo.formattedMapping;
397
398
  await this.setContent(formatInfo.formattedContent);
398
399
  this.prettyBaseDoc = textEditor.state.doc;
@@ -268,9 +268,16 @@ export class StackTracePreviewContent extends UI.Widget.Widget<ShadowRoot> {
268
268
  if (Root.DevToolsContext.globalInstance().has(Workspace.IgnoreListManager.IgnoreListManager)) {
269
269
  Workspace.IgnoreListManager.IgnoreListManager.instance().addChangeListener(this.#updateHasNonIgnoredLinks);
270
270
  }
271
+ if (this.#stackTrace) {
272
+ this.#stackTrace.addEventListener(StackTrace.StackTrace.Events.UPDATED, this.requestUpdate, this);
273
+ }
274
+ this.requestUpdate();
271
275
  }
272
276
 
273
277
  override willHide(): void {
278
+ if (this.#stackTrace) {
279
+ this.#stackTrace.removeEventListener(StackTrace.StackTrace.Events.UPDATED, this.requestUpdate, this);
280
+ }
274
281
  if (Root.DevToolsContext.globalInstance().has(Workspace.IgnoreListManager.IgnoreListManager)) {
275
282
  Workspace.IgnoreListManager.IgnoreListManager.instance().removeChangeListener(this.#updateHasNonIgnoredLinks);
276
283
  }
@@ -291,7 +298,9 @@ export class StackTracePreviewContent extends UI.Widget.Widget<ShadowRoot> {
291
298
  this.#stackTrace.removeEventListener(StackTrace.StackTrace.Events.UPDATED, this.requestUpdate, this);
292
299
  }
293
300
  this.#stackTrace = stackTrace;
294
- this.#stackTrace.addEventListener(StackTrace.StackTrace.Events.UPDATED, this.requestUpdate, this);
301
+ if (this.#stackTrace && this.isShowing()) {
302
+ this.#stackTrace.addEventListener(StackTrace.StackTrace.Events.UPDATED, this.requestUpdate, this);
303
+ }
295
304
  this.requestUpdate();
296
305
  }
297
306
 
package/package.json CHANGED
@@ -92,5 +92,5 @@
92
92
  "webidl2": "24.5.0",
93
93
  "yargs": "17.7.2"
94
94
  },
95
- "version": "1.0.1660788"
95
+ "version": "1.0.1661063"
96
96
  }
@@ -1,247 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import type * as SDK from '../../core/sdk/sdk.js';
6
- import * as Protocol from '../../generated/protocol.js';
7
-
8
- import {Issue, IssueCategory, IssueKind} from './Issue.js';
9
- import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
10
-
11
- export const enum IssueCode {
12
- PERMISSION_POLICY_DISABLED = 'AttributionReportingIssue::PermissionPolicyDisabled',
13
- UNTRUSTWORTHY_REPORTING_ORIGIN = 'AttributionReportingIssue::UntrustworthyReportingOrigin',
14
- INSECURE_CONTEXT = 'AttributionReportingIssue::InsecureContext',
15
- INVALID_REGISTER_SOURCE_HEADER = 'AttributionReportingIssue::InvalidRegisterSourceHeader',
16
- INVALID_REGISTER_TRIGGER_HEADER = 'AttributionReportingIssue::InvalidRegisterTriggerHeader',
17
- SOURCE_AND_TRIGGER_HEADERS = 'AttributionReportingIssue::SourceAndTriggerHeaders',
18
- SOURCE_IGNORED = 'AttributionReportingIssue::SourceIgnored',
19
- TRIGGER_IGNORED = 'AttributionReportingIssue::TriggerIgnored',
20
- OS_SOURCE_IGNORED = 'AttributionReportingIssue::OsSourceIgnored',
21
- OS_TRIGGER_IGNORED = 'AttributionReportingIssue::OsTriggerIgnored',
22
- INVALID_REGISTER_OS_SOURCE_HEADER = 'AttributionReportingIssue::InvalidRegisterOsSourceHeader',
23
- INVALID_REGISTER_OS_TRIGGER_HEADER = 'AttributionReportingIssue::InvalidRegisterOsTriggerHeader',
24
- WEB_AND_OS_HEADERS = 'AttributionReportingIssue::WebAndOsHeaders',
25
- NO_WEB_OR_OS_SUPPORT = 'AttributionReportingIssue::NoWebOrOsSupport',
26
- NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION =
27
- 'AttributionReportingIssue::NavigationRegistrationWithoutTransientUserActivation',
28
- INVALID_INFO_HEADER = 'AttributionReportingIssue::InvalidInfoHeader',
29
- NO_REGISTER_SOURCE_HEADER = 'AttributionReportingIssue::NoRegisterSourceHeader',
30
- NO_REGISTER_TRIGGER_HEADER = 'AttributionReportingIssue::NoRegisterTriggerHeader',
31
- NO_REGISTER_OS_SOURCE_HEADER = 'AttributionReportingIssue::NoRegisterOsSourceHeader',
32
- NO_REGISTER_OS_TRIGGER_HEADER = 'AttributionReportingIssue::NoRegisterOsTriggerHeader',
33
- NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET =
34
- 'AttributionReportingIssue::NavigationRegistrationUniqueScopeAlreadySet',
35
- UNKNOWN = 'AttributionReportingIssue::Unknown',
36
- }
37
-
38
- function getIssueCode(details: Protocol.Audits.AttributionReportingIssueDetails): IssueCode {
39
- switch (details.violationType) {
40
- case Protocol.Audits.AttributionReportingIssueType.PermissionPolicyDisabled:
41
- return IssueCode.PERMISSION_POLICY_DISABLED;
42
- case Protocol.Audits.AttributionReportingIssueType.UntrustworthyReportingOrigin:
43
- return IssueCode.UNTRUSTWORTHY_REPORTING_ORIGIN;
44
- case Protocol.Audits.AttributionReportingIssueType.InsecureContext:
45
- return IssueCode.INSECURE_CONTEXT;
46
- case Protocol.Audits.AttributionReportingIssueType.InvalidHeader:
47
- return IssueCode.INVALID_REGISTER_SOURCE_HEADER;
48
- case Protocol.Audits.AttributionReportingIssueType.InvalidRegisterTriggerHeader:
49
- return IssueCode.INVALID_REGISTER_TRIGGER_HEADER;
50
- case Protocol.Audits.AttributionReportingIssueType.SourceAndTriggerHeaders:
51
- return IssueCode.SOURCE_AND_TRIGGER_HEADERS;
52
- case Protocol.Audits.AttributionReportingIssueType.SourceIgnored:
53
- return IssueCode.SOURCE_IGNORED;
54
- case Protocol.Audits.AttributionReportingIssueType.TriggerIgnored:
55
- return IssueCode.TRIGGER_IGNORED;
56
- case Protocol.Audits.AttributionReportingIssueType.OsSourceIgnored:
57
- return IssueCode.OS_SOURCE_IGNORED;
58
- case Protocol.Audits.AttributionReportingIssueType.OsTriggerIgnored:
59
- return IssueCode.OS_TRIGGER_IGNORED;
60
- case Protocol.Audits.AttributionReportingIssueType.InvalidRegisterOsSourceHeader:
61
- return IssueCode.INVALID_REGISTER_OS_SOURCE_HEADER;
62
- case Protocol.Audits.AttributionReportingIssueType.InvalidRegisterOsTriggerHeader:
63
- return IssueCode.INVALID_REGISTER_OS_TRIGGER_HEADER;
64
- case Protocol.Audits.AttributionReportingIssueType.WebAndOsHeaders:
65
- return IssueCode.WEB_AND_OS_HEADERS;
66
- case Protocol.Audits.AttributionReportingIssueType.NoWebOrOsSupport:
67
- return IssueCode.NO_WEB_OR_OS_SUPPORT;
68
- case Protocol.Audits.AttributionReportingIssueType.NavigationRegistrationWithoutTransientUserActivation:
69
- return IssueCode.NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION;
70
- case Protocol.Audits.AttributionReportingIssueType.InvalidInfoHeader:
71
- return IssueCode.INVALID_INFO_HEADER;
72
- case Protocol.Audits.AttributionReportingIssueType.NoRegisterSourceHeader:
73
- return IssueCode.NO_REGISTER_SOURCE_HEADER;
74
- case Protocol.Audits.AttributionReportingIssueType.NoRegisterTriggerHeader:
75
- return IssueCode.NO_REGISTER_TRIGGER_HEADER;
76
- case Protocol.Audits.AttributionReportingIssueType.NoRegisterOsSourceHeader:
77
- return IssueCode.NO_REGISTER_OS_SOURCE_HEADER;
78
- case Protocol.Audits.AttributionReportingIssueType.NoRegisterOsTriggerHeader:
79
- return IssueCode.NO_REGISTER_OS_TRIGGER_HEADER;
80
- case Protocol.Audits.AttributionReportingIssueType.NavigationRegistrationUniqueScopeAlreadySet:
81
- return IssueCode.NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET;
82
- default:
83
- return IssueCode.UNKNOWN;
84
- }
85
- }
86
-
87
- const structuredHeaderLink = {
88
- link: 'https://tools.ietf.org/id/draft-ietf-httpbis-header-structure-15.html#rfc.section.4.2.2',
89
- linkTitle: 'Structured Headers RFC',
90
- };
91
-
92
- export class AttributionReportingIssue extends Issue<Protocol.Audits.AttributionReportingIssueDetails, IssueCode> {
93
- constructor(
94
- issueDetails: Protocol.Audits.AttributionReportingIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
95
- super(getIssueCode(issueDetails), issueDetails, issuesModel);
96
- }
97
-
98
- getCategory(): IssueCategory {
99
- return IssueCategory.ATTRIBUTION_REPORTING;
100
- }
101
-
102
- getHeaderValidatorLink(name: string): {link: string, linkTitle: string} {
103
- const url = new URL('https://wicg.github.io/attribution-reporting-api/validate-headers');
104
- url.searchParams.set('header', name);
105
-
106
- const details = this.details();
107
- if (details.invalidParameter) {
108
- url.searchParams.set('json', details.invalidParameter);
109
- }
110
-
111
- return {
112
- link: url.toString(),
113
- linkTitle: 'Header Validator',
114
- };
115
- }
116
-
117
- getDescription(): MarkdownIssueDescription|null {
118
- switch (this.code()) {
119
- case IssueCode.PERMISSION_POLICY_DISABLED:
120
- return {
121
- file: 'arPermissionPolicyDisabled.md',
122
- links: [],
123
- };
124
- case IssueCode.UNTRUSTWORTHY_REPORTING_ORIGIN:
125
- return {
126
- file: 'arUntrustworthyReportingOrigin.md',
127
- links: [],
128
- };
129
- case IssueCode.INSECURE_CONTEXT:
130
- return {
131
- file: 'arInsecureContext.md',
132
- links: [],
133
- };
134
- case IssueCode.INVALID_REGISTER_SOURCE_HEADER:
135
- return {
136
- file: 'arInvalidRegisterSourceHeader.md',
137
- links: [this.getHeaderValidatorLink('source')],
138
- };
139
- case IssueCode.INVALID_REGISTER_TRIGGER_HEADER:
140
- return {
141
- file: 'arInvalidRegisterTriggerHeader.md',
142
- links: [this.getHeaderValidatorLink('trigger')],
143
- };
144
- case IssueCode.INVALID_REGISTER_OS_SOURCE_HEADER:
145
- return {
146
- file: 'arInvalidRegisterOsSourceHeader.md',
147
- links: [this.getHeaderValidatorLink('os-source')],
148
- };
149
- case IssueCode.INVALID_REGISTER_OS_TRIGGER_HEADER:
150
- return {
151
- file: 'arInvalidRegisterOsTriggerHeader.md',
152
- links: [this.getHeaderValidatorLink('os-trigger')],
153
- };
154
- case IssueCode.SOURCE_AND_TRIGGER_HEADERS:
155
- return {
156
- file: 'arSourceAndTriggerHeaders.md',
157
- links: [],
158
- };
159
- case IssueCode.WEB_AND_OS_HEADERS:
160
- return {
161
- file: 'arWebAndOsHeaders.md',
162
- links: [],
163
- };
164
- case IssueCode.SOURCE_IGNORED:
165
- return {
166
- file: 'arSourceIgnored.md',
167
- links: [structuredHeaderLink],
168
- };
169
- case IssueCode.TRIGGER_IGNORED:
170
- return {
171
- file: 'arTriggerIgnored.md',
172
- links: [structuredHeaderLink],
173
- };
174
- case IssueCode.OS_SOURCE_IGNORED:
175
- return {
176
- file: 'arOsSourceIgnored.md',
177
- links: [structuredHeaderLink],
178
- };
179
- case IssueCode.OS_TRIGGER_IGNORED:
180
- return {
181
- file: 'arOsTriggerIgnored.md',
182
- links: [structuredHeaderLink],
183
- };
184
- case IssueCode.NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION:
185
- return {
186
- file: 'arNavigationRegistrationWithoutTransientUserActivation.md',
187
- links: [],
188
- };
189
- case IssueCode.NO_WEB_OR_OS_SUPPORT:
190
- return {
191
- file: 'arNoWebOrOsSupport.md',
192
- links: [],
193
- };
194
- case IssueCode.INVALID_INFO_HEADER:
195
- return {
196
- file: 'arInvalidInfoHeader.md',
197
- links: [],
198
- };
199
- case IssueCode.NO_REGISTER_SOURCE_HEADER:
200
- return {
201
- file: 'arNoRegisterSourceHeader.md',
202
- links: [],
203
- };
204
- case IssueCode.NO_REGISTER_TRIGGER_HEADER:
205
- return {
206
- file: 'arNoRegisterTriggerHeader.md',
207
- links: [],
208
- };
209
- case IssueCode.NO_REGISTER_OS_SOURCE_HEADER:
210
- return {
211
- file: 'arNoRegisterOsSourceHeader.md',
212
- links: [],
213
- };
214
- case IssueCode.NO_REGISTER_OS_TRIGGER_HEADER:
215
- return {
216
- file: 'arNoRegisterOsTriggerHeader.md',
217
- links: [],
218
- };
219
- case IssueCode.NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET:
220
- return {
221
- file: 'arNavigationRegistrationUniqueScopeAlreadySet.md',
222
- links: [],
223
- };
224
- case IssueCode.UNKNOWN:
225
- return null;
226
- }
227
- }
228
-
229
- primaryKey(): string {
230
- return JSON.stringify(this.details());
231
- }
232
-
233
- getKind(): IssueKind {
234
- return IssueKind.PAGE_ERROR;
235
- }
236
-
237
- static fromInspectorIssue(
238
- issuesModel: SDK.IssuesModel.IssuesModel|null,
239
- inspectorIssue: Protocol.Audits.InspectorIssue): AttributionReportingIssue[] {
240
- const {attributionReportingIssueDetails} = inspectorIssue.details;
241
- if (!attributionReportingIssueDetails) {
242
- console.warn('Attribution Reporting issue without details received.');
243
- return [];
244
- }
245
- return [new AttributionReportingIssue(attributionReportingIssueDetails, issuesModel)];
246
- }
247
- }
@@ -1,7 +0,0 @@
1
- # Ensure that the attribution registration context is secure
2
-
3
- This page tried to register a source or trigger using the Attribution Reporting
4
- API but failed because the page that initiated the registration was not secure.
5
-
6
- The registration context must use HTTPS unless it is `localhost` or
7
- `127.0.0.1`.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Info` header is valid
2
-
3
- This page tried to register a source or trigger using the Attribution Reporting
4
- API but failed because an `Attribution-Reporting-Info` response header was
5
- invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-OS-Source` header is valid
2
-
3
- This page tried to register an OS source using the Attribution Reporting API
4
- but failed because an `Attribution-Reporting-Register-OS-Source` response
5
- header was invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-OS-Trigger` header is valid
2
-
3
- This page tried to register an OS trigger using the Attribution Reporting API
4
- but failed because an `Attribution-Reporting-Register-OS-Trigger` response
5
- header was invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-Source` header is valid
2
-
3
- This page tried to register a source using the Attribution Reporting API but
4
- failed because an `Attribution-Reporting-Register-Source` response header was
5
- invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-Trigger` header is valid
2
-
3
- This page tried to register a trigger using the Attribution Reporting API but
4
- failed because an `Attribution-Reporting-Register-Trigger` response header was
5
- invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that multiple sources associated with the same navigation have the same attribution scopes
2
-
3
- The page tried to register a source using Attribution Reporting API, but the
4
- source was rejected because a previous source associated with the same
5
- navigation and reporting origin used a different set of attribution scopes.
@@ -1,6 +0,0 @@
1
- # Ensure that navigation-source registrations are initiated by a user gesture
2
-
3
- This page tried to register a navigation source using the Attribution Reporting
4
- API but failed because the navigation was not initiated by a user gesture.
5
- Compared to event sources, navigation sources can release more cross-site
6
- information, and are therefore subject to this additional privacy control.
@@ -1,5 +0,0 @@
1
- # OS attribution source expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register an OS source using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-OS-Source` header was missing.
@@ -1,5 +0,0 @@
1
- # OS attribution trigger expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register an OS trigger using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-OS-Trigger` header was missing.
@@ -1,5 +0,0 @@
1
- # Web attribution source expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register a web source using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-Source` header was missing.
@@ -1,5 +0,0 @@
1
- # Web attribution trigger expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register a web trigger using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-Trigger` header was missing.
@@ -1,4 +0,0 @@
1
- # No web or OS support for Attribution Reporting
2
-
3
- The page tried to send an attributionsrc request, but there was neither web nor
4
- OS support for the Attribution Reporting API, so the request was skipped.
@@ -1,18 +0,0 @@
1
- # An attribution OS source registration was ignored because the request was ineligible
2
-
3
- This page tried to register an OS source using the Attribution Reporting API,
4
- but the request was ineligible to do so, so the OS source registration was
5
- ignored.
6
-
7
- A request is eligible for OS source registration if it has all of the following:
8
-
9
- - An `Attribution-Reporting-Eligible` header whose value is a structured
10
- dictionary that contains the key `navigation-source` or `event-source`
11
- - An `Attribution-Reporting-Support` header whose value is a structured
12
- dictionary that contains the key `os`
13
-
14
- Otherwise, any `Attribution-Reporting-Register-OS-Source` response header will
15
- be ignored.
16
-
17
- Additionally, a single HTTP redirect chain may register only all sources or all
18
- triggers, not a combination of both.
@@ -1,19 +0,0 @@
1
- # An attribution OS trigger registration was ignored because the request was ineligible
2
-
3
- This page tried to register an OS trigger using the Attribution Reporting API,
4
- but the request was ineligible to do so, so the OS trigger registration was
5
- ignored.
6
-
7
- A request is eligible for OS trigger registration if it has all of the following:
8
-
9
- - No `Attribution-Reporting-Eligible` header or an
10
- `Attribution-Reporting-Eligible` header whose value is a structured
11
- dictionary that contains the key `trigger`
12
- - An `Attribution-Reporting-Support` header whose value is a structured
13
- dictionary that contains the key `os`
14
-
15
- Otherwise, any `Attribution-Reporting-Register-OS-Trigger` response header will
16
- be ignored.
17
-
18
- Additionally, a single HTTP redirect chain may register only all sources or all
19
- triggers, not a combination of both.
@@ -1,8 +0,0 @@
1
- # The Attribution Reporting API can’t be used because Permissions Policy has been disabled
2
-
3
- This page tried to use the Attribution Reporting API but failed because the
4
- `attribution-reporting` Permission Policy was explicitly disabled.
5
-
6
- This API is currently enabled by default for top-level and cross-origin frames,
7
- but it is still possible for frames to have the permission disabled by their
8
- parent, e.g. with `<iframe src="…" allow="attribution-reporting 'none'">`.
@@ -1,9 +0,0 @@
1
- # Ensure that attribution responses contain either source or trigger, not both
2
-
3
- This page tried to register a source and a trigger in the same HTTP response
4
- using the Attribution Reporting API, which is prohibited.
5
-
6
- The corresponding request was eligible to register either a source or a
7
- trigger, but the response may only set either the
8
- `Attribution-Reporting-Register-Source` header or the
9
- `Attribution-Reporting-Register-Trigger` header, not both.