chrome-devtools-frontend 1.0.1549484 → 1.0.1550444

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 (196) hide show
  1. package/docs/styleguide/ux/components.md +53 -12
  2. package/docs/styleguide/ux/images/cards.png +0 -0
  3. package/docs/ui_engineering.md +2 -2
  4. package/front_end/core/sdk/NetworkManager.ts +12 -10
  5. package/front_end/core/sdk/PageResourceLoader.ts +8 -1
  6. package/front_end/core/sdk/SourceMapManager.ts +12 -6
  7. package/front_end/entrypoints/main/MainImpl.ts +0 -9
  8. package/front_end/foundation/Universe.ts +7 -0
  9. package/front_end/generated/InspectorBackendCommands.ts +5 -2
  10. package/front_end/generated/protocol-mapping.d.ts +8 -0
  11. package/front_end/generated/protocol-proxy-api.d.ts +6 -0
  12. package/front_end/generated/protocol.ts +76 -0
  13. package/front_end/models/ai_assistance/BuiltInAi.ts +79 -5
  14. package/front_end/models/issues_manager/AttributionReportingIssue.ts +6 -8
  15. package/front_end/models/issues_manager/BounceTrackingIssue.ts +4 -14
  16. package/front_end/models/issues_manager/ClientHintIssue.ts +5 -12
  17. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -12
  18. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +7 -14
  19. package/front_end/models/issues_manager/CookieIssue.ts +27 -30
  20. package/front_end/models/issues_manager/CorsIssue.ts +8 -17
  21. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -8
  22. package/front_end/models/issues_manager/DeprecationIssue.ts +7 -14
  23. package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +7 -14
  24. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +4 -11
  25. package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +4 -11
  26. package/front_end/models/issues_manager/GenericIssue.ts +11 -16
  27. package/front_end/models/issues_manager/HeavyAdIssue.ts +4 -11
  28. package/front_end/models/issues_manager/Issue.ts +12 -4
  29. package/front_end/models/issues_manager/IssueAggregator.ts +8 -2
  30. package/front_end/models/issues_manager/LowTextContrastIssue.ts +3 -10
  31. package/front_end/models/issues_manager/MixedContentIssue.ts +7 -13
  32. package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +4 -11
  33. package/front_end/models/issues_manager/PropertyRuleIssue.ts +6 -12
  34. package/front_end/models/issues_manager/QuirksModeIssue.ts +3 -10
  35. package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +7 -13
  36. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +4 -11
  37. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +6 -13
  38. package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +8 -13
  39. package/front_end/models/issues_manager/UnencodedDigestIssue.ts +2 -9
  40. package/front_end/models/javascript_metadata/NativeFunctions.js +0 -13
  41. package/front_end/panels/application/AppManifestView.ts +4 -4
  42. package/front_end/panels/application/ApplicationPanelSidebar.ts +21 -21
  43. package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -2
  44. package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -2
  45. package/front_end/panels/application/InterestGroupTreeElement.ts +2 -2
  46. package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -2
  47. package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
  48. package/front_end/panels/application/PreloadingTreeElement.ts +3 -3
  49. package/front_end/panels/application/ReportingApiTreeElement.ts +2 -2
  50. package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +3 -3
  51. package/front_end/panels/application/SharedStorageListTreeElement.ts +2 -2
  52. package/front_end/panels/application/StorageBucketsTreeElement.ts +3 -3
  53. package/front_end/panels/application/StorageView.ts +2 -2
  54. package/front_end/panels/application/TrustTokensTreeElement.ts +2 -2
  55. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
  56. package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
  57. package/front_end/panels/application/components/SharedStorageMetadataView.ts +1 -1
  58. package/front_end/panels/application/components/TrustTokensView.ts +1 -1
  59. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -1
  60. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +1 -1
  61. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
  62. package/front_end/panels/changes/ChangesSidebar.ts +2 -0
  63. package/front_end/panels/changes/CombinedDiffView.ts +2 -0
  64. package/front_end/panels/common/AnnotationManager.ts +71 -0
  65. package/front_end/panels/common/PersistenceUtils.ts +6 -7
  66. package/front_end/panels/common/common.ts +1 -0
  67. package/front_end/panels/console/ConsolePrompt.ts +4 -4
  68. package/front_end/panels/console/ConsoleView.ts +2 -2
  69. package/front_end/panels/console/ConsoleViewMessage.ts +10 -11
  70. package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -0
  71. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
  72. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +3 -3
  73. package/front_end/panels/elements/ElementsPanel.ts +49 -0
  74. package/front_end/panels/elements/ElementsTreeElement.ts +156 -108
  75. package/front_end/panels/elements/ElementsTreeOutline.ts +9 -2
  76. package/front_end/panels/elements/ShortcutTreeElement.ts +2 -2
  77. package/front_end/panels/elements/StyleEditorWidget.ts +2 -2
  78. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -6
  79. package/front_end/panels/elements/StylesSidebarPane.ts +4 -5
  80. package/front_end/panels/elements/TopLayerContainer.ts +2 -2
  81. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  82. package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
  83. package/front_end/panels/elements/components/QueryContainer.ts +1 -1
  84. package/front_end/panels/elements/components/StylePropertyEditor.ts +1 -1
  85. package/front_end/panels/emulation/DeviceModeWrapper.ts +48 -3
  86. package/front_end/panels/explain/components/ConsoleInsight.ts +6 -4
  87. package/front_end/panels/issues/AffectedResourcesView.ts +2 -2
  88. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +2 -2
  89. package/front_end/panels/issues/IssueKindView.ts +2 -2
  90. package/front_end/panels/issues/IssueView.ts +4 -4
  91. package/front_end/panels/js_timeline/js_timeline-meta.ts +4 -2
  92. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +1 -1
  93. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +1 -1
  94. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
  95. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
  96. package/front_end/panels/media/PlayerListView.ts +1 -1
  97. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +2 -2
  98. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +2 -3
  99. package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
  100. package/front_end/panels/network/NetworkFrameGrouper.ts +2 -2
  101. package/front_end/panels/network/NetworkItemView.ts +4 -4
  102. package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
  103. package/front_end/panels/network/RequestCookiesView.ts +2 -2
  104. package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
  105. package/front_end/panels/network/components/RequestTrustTokensView.ts +5 -6
  106. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -3
  107. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -2
  108. package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
  109. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  110. package/front_end/panels/recorder/components/CreateRecordingView.ts +1 -1
  111. package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
  112. package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
  113. package/front_end/panels/recorder/components/RecordingView.ts +1 -1
  114. package/front_end/panels/recorder/components/StepView.ts +1 -1
  115. package/front_end/panels/screencast/ScreencastView.ts +8 -8
  116. package/front_end/panels/search/SearchView.ts +1 -1
  117. package/front_end/panels/security/CookieControlsTreeElement.ts +2 -2
  118. package/front_end/panels/security/CookieReportTreeElement.ts +2 -2
  119. package/front_end/panels/security/SecurityPanel.ts +5 -5
  120. package/front_end/panels/security/SecurityPanelSidebar.ts +3 -4
  121. package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -4
  122. package/front_end/panels/settings/SettingsScreen.ts +2 -3
  123. package/front_end/panels/snippets/SnippetsQuickOpen.ts +16 -8
  124. package/front_end/panels/sources/BreakpointEditDialog.ts +3 -3
  125. package/front_end/panels/sources/BreakpointsView.ts +1 -1
  126. package/front_end/panels/sources/CSSPlugin.ts +3 -3
  127. package/front_end/panels/sources/CallStackSidebarPane.ts +4 -4
  128. package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
  129. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +39 -30
  130. package/front_end/panels/sources/GoToLineQuickOpen.ts +11 -7
  131. package/front_end/panels/sources/NavigatorView.ts +2 -2
  132. package/front_end/panels/sources/OpenFileQuickOpen.ts +11 -15
  133. package/front_end/panels/sources/OutlineQuickOpen.ts +23 -26
  134. package/front_end/panels/sources/SourcesView.ts +2 -2
  135. package/front_end/panels/sources/TabbedEditorContainer.ts +4 -5
  136. package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
  137. package/front_end/panels/sources/UISourceCodeFrame.ts +5 -5
  138. package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
  139. package/front_end/panels/timeline/TimelinePanel.ts +14 -9
  140. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +1 -1
  141. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
  142. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
  143. package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +1 -1
  144. package/front_end/panels/timeline/components/OriginMap.ts +1 -1
  145. package/front_end/panels/timeline/components/insights/Checklist.ts +1 -1
  146. package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -1
  147. package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -1
  148. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
  149. package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
  150. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
  151. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  152. package/front_end/panels/utils/utils.ts +1 -0
  153. package/front_end/third_party/chromium/README.chromium +1 -1
  154. package/front_end/ui/components/adorners/Adorner.ts +20 -0
  155. package/front_end/ui/components/annotations/AnnotationRepository.ts +1 -1
  156. package/front_end/ui/components/buttons/Button.ts +1 -1
  157. package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
  158. package/front_end/ui/components/highlighting/HighlightElement.ts +15 -2
  159. package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
  160. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  161. package/front_end/ui/components/icon_button/icon_button.ts +0 -2
  162. package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
  163. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
  164. package/front_end/ui/components/markdown_view/MarkdownImage.ts +3 -3
  165. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  166. package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
  167. package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
  168. package/front_end/ui/components/text_editor/config.ts +2 -2
  169. package/front_end/ui/kit/cards/Card.docs.ts +43 -0
  170. package/front_end/ui/{components/icon_button → kit/icons}/Icon.docs.ts +3 -4
  171. package/front_end/ui/{components/icon_button → kit/icons}/Icon.ts +4 -4
  172. package/front_end/ui/kit/kit.ts +1 -0
  173. package/front_end/ui/legacy/Infobar.ts +3 -3
  174. package/front_end/ui/legacy/InspectorView.ts +3 -3
  175. package/front_end/ui/legacy/SearchableView.ts +2 -2
  176. package/front_end/ui/legacy/SoftContextMenu.ts +5 -5
  177. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  178. package/front_end/ui/legacy/TabbedPane.ts +9 -9
  179. package/front_end/ui/legacy/Toolbar.ts +3 -3
  180. package/front_end/ui/legacy/Treeoutline.ts +2 -2
  181. package/front_end/ui/legacy/UIUtils.ts +4 -4
  182. package/front_end/ui/legacy/ViewManager.ts +4 -4
  183. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +8 -8
  184. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +4 -4
  185. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +4 -4
  186. package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +2 -2
  187. package/front_end/ui/legacy/components/inline_editor/Swatches.ts +5 -5
  188. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -3
  189. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
  190. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +22 -29
  191. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +8 -15
  192. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +11 -14
  193. package/front_end/ui/legacy/components/utils/Linkifier.ts +3 -3
  194. package/mcp/mcp.ts +1 -0
  195. package/package.json +1 -1
  196. /package/front_end/ui/{components/icon_button → kit/icons}/icon.css +0 -0
@@ -123,19 +123,10 @@ button.addEventListener('click', event => onClick(event));
123
123
 
124
124
  ### Resources
125
125
 
126
- #### For developers
127
-
128
- ##### Implementation
129
-
130
126
  * [`devtools-button`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/ui/components/buttons/Button.ts)
131
-
132
- #### For designers
133
-
134
- ##### Figma
135
-
136
- * [Buttons](https://www.figma.com/design/A5iQBBNAe5zPFpJvUzUgW8/CDT-design-kit?node-id=481-2167&m=dev)
127
+ * [Buttons Figma](https://www.figma.com/design/A5iQBBNAe5zPFpJvUzUgW8/CDT-design-kit?node-id=481-2167&m=dev)
137
128
  * [Icon
138
- buttons](https://www.figma.com/design/A5iQBBNAe5zPFpJvUzUgW8/CDT-design-kit?node-id=571-616&m=dev)
129
+ buttons Figma](https://www.figma.com/design/A5iQBBNAe5zPFpJvUzUgW8/CDT-design-kit?node-id=571-616&m=dev)
139
130
 
140
131
  ## Combo Boxes and Single Select menus
141
132
 
@@ -316,7 +307,7 @@ html`<devtools-icon name=${'some-icon-name'}></devtools-icon>`;
316
307
  Usage with the imperative API:
317
308
 
318
309
  ```ts
319
- const someIcon = IconButton.Icon.create('some-icon-name', 'some-class');
310
+ const someIcon = createIcon('some-icon-name', 'some-class');
320
311
  ```
321
312
 
322
313
  ## Context menus
@@ -568,3 +559,53 @@ UI.ContextMenu.registerItem({
568
559
  ```
569
560
 
570
561
  This will automatically add the "Open file" action to the context menu that appears when clicking the Elements panel's 3-dot button.
562
+
563
+
564
+ ## Cards
565
+
566
+ ![Card component](images/cards.png)
567
+
568
+ ### Usage
569
+
570
+ #### Developer guidelines
571
+
572
+ ###### Basic card with heading
573
+
574
+ Usage with lit-html:
575
+
576
+ ```ts
577
+ html`<devtools-card heading="Simple card">
578
+ <div class="content">This is a simple card.</div>
579
+ </devtools-card>`
580
+ ```
581
+
582
+ ###### Card without a heading
583
+
584
+ Usage with lit-html:
585
+
586
+ ```ts
587
+ html`<devtools-card>
588
+ <div class="content">This is a card without a heading.</div>
589
+ </devtools-card>`
590
+ ```
591
+
592
+ ###### Card with rich heading
593
+
594
+ Usage with lit-html:
595
+
596
+ ```ts
597
+ html`<devtools-card heading="Card with rich heading">
598
+ <span slot="heading-prefix">Slotted heading prefix</span>
599
+ <span slot="heading-suffix">Slotted heading suffix</span>
600
+ <div class="content">This is a card with a rich heading.</div>
601
+ </devtools-card>`
602
+ ```
603
+
604
+ ### Resources
605
+
606
+ * [`devtools-card`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/ui/kit/cards/Card.ts)
607
+ * [Component Documentation Example](https://chromedevtools.github.io/devtools-frontend/)
608
+
609
+ * [Cards Figma](https://www.figma.com/design/A5iQBBNAe5zPFpJvUzUgW8/Chrome-DevTools-Design-Kit?node-id=3456-939)
610
+
611
+ * [Greenlines](go/chrome-devtools:cards-greenlines)
@@ -730,7 +730,7 @@ class SomeWidget extends UI.Widget.Widget {
730
730
  }
731
731
  ```
732
732
 
733
- ## Migrating `IconButton.Icon.Icon`
733
+ ## Migrating `Icon`
734
734
 
735
735
  Replace the imperative `Icon` creation with the declarative `<devtools-icon>` component.
736
736
 
@@ -740,7 +740,7 @@ Replace the imperative `Icon` creation with the declarative `<devtools-icon>` co
740
740
  class SomeWidget extends UI.Widget.Widget {
741
741
  constructor() {
742
742
  super();
743
- const icon = new IconButton.Icon.Icon();
743
+ const icon = new Icon();
744
744
  icon.data = {iconName: 'checkmark', color: 'var(--icon-checkmark-green)', width: '14px', height: '14px'};
745
745
  this.contentElement.appendChild(icon);
746
746
  }
@@ -1978,8 +1978,6 @@ export namespace RequestConditions {
1978
1978
  }
1979
1979
  }
1980
1980
 
1981
- let multiTargetNetworkManagerInstance: MultitargetNetworkManager|null;
1982
-
1983
1981
  export class AppliedNetworkConditions {
1984
1982
  constructor(
1985
1983
  readonly conditions: Conditions, readonly appliedNetworkConditionsId: string, readonly urlPattern?: string) {
@@ -1988,6 +1986,7 @@ export class AppliedNetworkConditions {
1988
1986
 
1989
1987
  export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrapper<MultitargetNetworkManager.EventTypes>
1990
1988
  implements SDKModelObserver<NetworkManager> {
1989
+ readonly #targetManager: TargetManager;
1991
1990
  #userAgentOverride = '';
1992
1991
  #userAgentMetadataOverride: Protocol.Emulation.UserAgentMetadata|null = null;
1993
1992
  #customAcceptedEncodings: Protocol.Network.ContentEncoding[]|null = null;
@@ -2004,8 +2003,9 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
2004
2003
  #customUserAgent?: string;
2005
2004
  #isBlocking = false;
2006
2005
 
2007
- constructor() {
2006
+ constructor(targetManager: TargetManager) {
2008
2007
  super();
2008
+ this.#targetManager = targetManager;
2009
2009
 
2010
2010
  // TODO(allada) Remove these and merge it with request interception.
2011
2011
  const blockedPatternChanged: () => void = () => {
@@ -2016,22 +2016,24 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
2016
2016
  RequestConditions.Events.REQUEST_CONDITIONS_CHANGED, blockedPatternChanged);
2017
2017
  this.updateBlockedPatterns();
2018
2018
 
2019
- TargetManager.instance().observeModels(NetworkManager, this);
2019
+ this.#targetManager.observeModels(NetworkManager, this);
2020
2020
  }
2021
2021
 
2022
2022
  static instance(opts: {
2023
2023
  forceNew: boolean|null,
2024
+ targetManager?: TargetManager,
2024
2025
  } = {forceNew: null}): MultitargetNetworkManager {
2025
- const {forceNew} = opts;
2026
- if (!multiTargetNetworkManagerInstance || forceNew) {
2027
- multiTargetNetworkManagerInstance = new MultitargetNetworkManager();
2026
+ const {forceNew, targetManager} = opts;
2027
+ if (!Root.DevToolsContext.globalInstance().has(MultitargetNetworkManager) || forceNew) {
2028
+ Root.DevToolsContext.globalInstance().set(
2029
+ MultitargetNetworkManager, new MultitargetNetworkManager(targetManager ?? TargetManager.instance()));
2028
2030
  }
2029
2031
 
2030
- return multiTargetNetworkManagerInstance;
2032
+ return Root.DevToolsContext.globalInstance().get(MultitargetNetworkManager);
2031
2033
  }
2032
2034
 
2033
2035
  static dispose(): void {
2034
- multiTargetNetworkManagerInstance = null;
2036
+ Root.DevToolsContext.globalInstance().delete(MultitargetNetworkManager);
2035
2037
  }
2036
2038
 
2037
2039
  static patchUserAgentWithChromeVersion(uaString: string): string {
@@ -2319,7 +2321,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
2319
2321
  }
2320
2322
 
2321
2323
  async getCertificate(origin: string): Promise<string[]> {
2322
- const target = TargetManager.instance().primaryPageTarget();
2324
+ const target = this.#targetManager.primaryPageTarget();
2323
2325
  if (!target) {
2324
2326
  return [];
2325
2327
  }
@@ -70,6 +70,13 @@ export class ResourceKey {
70
70
 
71
71
  export type UserAgentProvider = Pick<MultitargetNetworkManager, 'currentUserAgent'>;
72
72
 
73
+ /**
74
+ * The PageResourceLoader has two responsibilities: loading resources and tracking statistics scoped to targets
75
+ * for the DeveloperResourcesPanel. Many places only require the former, so we expose that functionality via small
76
+ * sub-interface. This makes it easier to test classes that require resource loading.
77
+ */
78
+ export type ResourceLoader = Pick<PageResourceLoader, 'loadResource'>;
79
+
73
80
  interface LoadQueueEntry {
74
81
  resolve: () => void;
75
82
  reject: (arg0: Error) => void;
@@ -80,7 +87,7 @@ interface LoadQueueEntry {
80
87
  * `PageResource` object around that holds meta information. This can be as the basis for reporting to the user which
81
88
  * resources were loaded, and whether there was a load error.
82
89
  */
83
- export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
90
+ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements ResourceLoader {
84
91
  readonly #targetManager: TargetManager;
85
92
  readonly #settings: Common.Settings.Settings;
86
93
  readonly #userAgentProvider: UserAgentProvider;
@@ -6,7 +6,7 @@ import * as Common from '../common/common.js';
6
6
  import * as Platform from '../platform/platform.js';
7
7
 
8
8
  import type {FrameAssociated} from './FrameAssociated.js';
9
- import {PageResourceLoader, type PageResourceLoadInitiator} from './PageResourceLoader.js';
9
+ import {PageResourceLoader, type PageResourceLoadInitiator, type ResourceLoader} from './PageResourceLoader.js';
10
10
  import {type DebugId, parseSourceMap, SourceMap, type SourceMapV3} from './SourceMap.js';
11
11
  import {SourceMapCache} from './SourceMapCache.js';
12
12
  import {type Target, Type} from './Target.js';
@@ -112,8 +112,14 @@ export class SourceMapManager<T extends FrameAssociated> extends Common.ObjectWr
112
112
  if (this.#attachingClient === client) {
113
113
  this.#attachingClient = null;
114
114
  const initiator = client.createPageResourceLoadInitiator();
115
+ // TODO(crbug.com/458180550): Pass PageResourceLoader via constructor.
116
+ // The reason we grab it here lazily from the context is that otherwise every
117
+ // unit test using `createTarget` would need to set up a `PageResourceLoader`, as
118
+ // CSSModel and DebuggerModel are autostarted by default, and they create a
119
+ // SourceMapManager in their respective constructors.
120
+ const resourceLoader = this.#target.targetManager().context.get(PageResourceLoader);
115
121
  clientData.sourceMapPromise =
116
- loadSourceMap(PageResourceLoader.instance(), sourceMapURL, client.debugId(), initiator)
122
+ loadSourceMap(resourceLoader, sourceMapURL, client.debugId(), initiator)
117
123
  .then(
118
124
  payload => {
119
125
  const sourceMap = this.#factory(sourceURL, sourceMapURL, payload, client);
@@ -181,7 +187,7 @@ export class SourceMapManager<T extends FrameAssociated> extends Common.ObjectWr
181
187
  }
182
188
 
183
189
  async function loadSourceMap(
184
- pageResourceLoader: PageResourceLoader, url: Platform.DevToolsPath.UrlString, debugId: DebugId|null,
190
+ resourceLoader: ResourceLoader, url: Platform.DevToolsPath.UrlString, debugId: DebugId|null,
185
191
  initiator: PageResourceLoadInitiator): Promise<SourceMapV3> {
186
192
  try {
187
193
  if (debugId) {
@@ -191,7 +197,7 @@ async function loadSourceMap(
191
197
  }
192
198
  }
193
199
 
194
- const {content} = await pageResourceLoader.loadResource(url, initiator);
200
+ const {content} = await resourceLoader.loadResource(url, initiator);
195
201
  const sourceMap = parseSourceMap(content);
196
202
  if ('debugId' in sourceMap && sourceMap.debugId) {
197
203
  // In case something goes wrong with updating the cache, we still want to use the source map.
@@ -204,10 +210,10 @@ async function loadSourceMap(
204
210
  }
205
211
 
206
212
  export async function tryLoadSourceMap(
207
- pageResourceLoader: PageResourceLoader, url: Platform.DevToolsPath.UrlString,
213
+ resourceLoader: ResourceLoader, url: Platform.DevToolsPath.UrlString,
208
214
  initiator: PageResourceLoadInitiator): Promise<SourceMapV3|null> {
209
215
  try {
210
- return await loadSourceMap(pageResourceLoader, url, null, initiator);
216
+ return await loadSourceMap(resourceLoader, url, null, initiator);
211
217
  } catch (cause) {
212
218
  console.error(cause);
213
219
  return null;
@@ -441,20 +441,11 @@ export class MainImpl {
441
441
  IssuesManager.ContrastCheckTrigger.ContrastCheckTrigger.instance();
442
442
 
443
443
  UI.DockController.DockController.instance({forceNew: true, canDock});
444
- SDK.NetworkManager.MultitargetNetworkManager.instance({forceNew: true});
445
444
  SDK.DOMDebuggerModel.DOMDebuggerManager.instance({forceNew: true});
446
445
  const targetManager = SDK.TargetManager.TargetManager.instance();
447
446
  targetManager.addEventListener(
448
447
  SDK.TargetManager.Events.SUSPEND_STATE_CHANGED, this.#onSuspendStateChanged.bind(this));
449
448
 
450
- SDK.PageResourceLoader.PageResourceLoader.instance({
451
- forceNew: true,
452
- targetManager,
453
- settings: Common.Settings.Settings.instance(),
454
- userAgentProvider: SDK.NetworkManager.MultitargetNetworkManager.instance(),
455
- loadOverride: null,
456
- });
457
-
458
449
  Workspace.FileManager.FileManager.instance({forceNew: true});
459
450
 
460
451
  Bindings.NetworkProject.NetworkProjectManager.instance();
@@ -27,6 +27,13 @@ export class Universe {
27
27
  const targetManager = new SDK.TargetManager.TargetManager(this.context, options.overrideAutoStartModels);
28
28
  this.context.set(SDK.TargetManager.TargetManager, targetManager);
29
29
 
30
+ const multitargetNetworkManager = new SDK.NetworkManager.MultitargetNetworkManager(targetManager);
31
+ this.context.set(SDK.NetworkManager.MultitargetNetworkManager, multitargetNetworkManager);
32
+
33
+ const pageResourceLoader =
34
+ new SDK.PageResourceLoader.PageResourceLoader(targetManager, settings, multitargetNetworkManager, null);
35
+ this.context.set(SDK.PageResourceLoader.PageResourceLoader, pageResourceLoader);
36
+
30
37
  const workspace = new Workspace.Workspace.WorkspaceImpl();
31
38
  this.context.set(Workspace.Workspace.WorkspaceImpl, workspace);
32
39
 
@@ -90,7 +90,8 @@ inspectorBackend.registerEnum("Audits.ElementAccessibilityIssueReason", {Disallo
90
90
  inspectorBackend.registerEnum("Audits.StyleSheetLoadingIssueReason", {LateImportRule: "LateImportRule", RequestFailed: "RequestFailed"});
91
91
  inspectorBackend.registerEnum("Audits.PropertyRuleIssueReason", {InvalidSyntax: "InvalidSyntax", InvalidInitialValue: "InvalidInitialValue", InvalidInherits: "InvalidInherits", InvalidName: "InvalidName"});
92
92
  inspectorBackend.registerEnum("Audits.UserReidentificationIssueType", {BlockedFrameNavigation: "BlockedFrameNavigation", BlockedSubresource: "BlockedSubresource", NoisedCanvasReadback: "NoisedCanvasReadback"});
93
- inspectorBackend.registerEnum("Audits.InspectorIssueCode", {CookieIssue: "CookieIssue", MixedContentIssue: "MixedContentIssue", BlockedByResponseIssue: "BlockedByResponseIssue", HeavyAdIssue: "HeavyAdIssue", ContentSecurityPolicyIssue: "ContentSecurityPolicyIssue", SharedArrayBufferIssue: "SharedArrayBufferIssue", LowTextContrastIssue: "LowTextContrastIssue", CorsIssue: "CorsIssue", AttributionReportingIssue: "AttributionReportingIssue", QuirksModeIssue: "QuirksModeIssue", PartitioningBlobURLIssue: "PartitioningBlobURLIssue", NavigatorUserAgentIssue: "NavigatorUserAgentIssue", GenericIssue: "GenericIssue", DeprecationIssue: "DeprecationIssue", ClientHintIssue: "ClientHintIssue", FederatedAuthRequestIssue: "FederatedAuthRequestIssue", BounceTrackingIssue: "BounceTrackingIssue", CookieDeprecationMetadataIssue: "CookieDeprecationMetadataIssue", StylesheetLoadingIssue: "StylesheetLoadingIssue", FederatedAuthUserInfoRequestIssue: "FederatedAuthUserInfoRequestIssue", PropertyRuleIssue: "PropertyRuleIssue", SharedDictionaryIssue: "SharedDictionaryIssue", ElementAccessibilityIssue: "ElementAccessibilityIssue", SRIMessageSignatureIssue: "SRIMessageSignatureIssue", UnencodedDigestIssue: "UnencodedDigestIssue", UserReidentificationIssue: "UserReidentificationIssue"});
93
+ inspectorBackend.registerEnum("Audits.PermissionElementIssueType", {InvalidType: "InvalidType", FencedFrameDisallowed: "FencedFrameDisallowed", CspFrameAncestorsMissing: "CspFrameAncestorsMissing", PermissionsPolicyBlocked: "PermissionsPolicyBlocked", PaddingRightUnsupported: "PaddingRightUnsupported", PaddingBottomUnsupported: "PaddingBottomUnsupported", InsetBoxShadowUnsupported: "InsetBoxShadowUnsupported", RequestInProgress: "RequestInProgress", UntrustedEvent: "UntrustedEvent", RegistrationFailed: "RegistrationFailed", TypeNotSupported: "TypeNotSupported", InvalidTypeActivation: "InvalidTypeActivation", SecurityChecksFailed: "SecurityChecksFailed", ActivationDisabled: "ActivationDisabled", GeolocationDeprecated: "GeolocationDeprecated", InvalidDisplayStyle: "InvalidDisplayStyle", NonOpaqueColor: "NonOpaqueColor", LowContrast: "LowContrast", FontSizeTooSmall: "FontSizeTooSmall", FontSizeTooLarge: "FontSizeTooLarge", InvalidSizeValue: "InvalidSizeValue"});
94
+ inspectorBackend.registerEnum("Audits.InspectorIssueCode", {CookieIssue: "CookieIssue", MixedContentIssue: "MixedContentIssue", BlockedByResponseIssue: "BlockedByResponseIssue", HeavyAdIssue: "HeavyAdIssue", ContentSecurityPolicyIssue: "ContentSecurityPolicyIssue", SharedArrayBufferIssue: "SharedArrayBufferIssue", LowTextContrastIssue: "LowTextContrastIssue", CorsIssue: "CorsIssue", AttributionReportingIssue: "AttributionReportingIssue", QuirksModeIssue: "QuirksModeIssue", PartitioningBlobURLIssue: "PartitioningBlobURLIssue", NavigatorUserAgentIssue: "NavigatorUserAgentIssue", GenericIssue: "GenericIssue", DeprecationIssue: "DeprecationIssue", ClientHintIssue: "ClientHintIssue", FederatedAuthRequestIssue: "FederatedAuthRequestIssue", BounceTrackingIssue: "BounceTrackingIssue", CookieDeprecationMetadataIssue: "CookieDeprecationMetadataIssue", StylesheetLoadingIssue: "StylesheetLoadingIssue", FederatedAuthUserInfoRequestIssue: "FederatedAuthUserInfoRequestIssue", PropertyRuleIssue: "PropertyRuleIssue", SharedDictionaryIssue: "SharedDictionaryIssue", ElementAccessibilityIssue: "ElementAccessibilityIssue", SRIMessageSignatureIssue: "SRIMessageSignatureIssue", UnencodedDigestIssue: "UnencodedDigestIssue", UserReidentificationIssue: "UserReidentificationIssue", PermissionElementIssue: "PermissionElementIssue"});
94
95
  inspectorBackend.registerEvent("Audits.issueAdded", ["issue"]);
95
96
  inspectorBackend.registerEnum("Audits.GetEncodedResponseRequestEncoding", {Webp: "webp", Jpeg: "jpeg", Png: "png"});
96
97
  inspectorBackend.registerCommand("Audits.getEncodedResponse", [{"name": "requestId", "type": "string", "optional": false, "description": "Identifier of the network request to get content for.", "typeRef": "Network.RequestId"}, {"name": "encoding", "type": "string", "optional": false, "description": "The encoding to use.", "typeRef": "Audits.GetEncodedResponseRequestEncoding"}, {"name": "quality", "type": "number", "optional": true, "description": "The quality of the encoding (0-1). (defaults to 1)", "typeRef": null}, {"name": "sizeOnly", "type": "boolean", "optional": true, "description": "Whether to only return the size information (defaults to false).", "typeRef": null}], ["body", "originalSize", "encodedSize"], "Returns the response body and size if it were re-encoded with the specified settings. Only applies to images.");
@@ -130,7 +131,8 @@ inspectorBackend.registerType("Audits.ElementAccessibilityIssueDetails", [{"name
130
131
  inspectorBackend.registerType("Audits.StylesheetLoadingIssueDetails", [{"name": "sourceCodeLocation", "type": "object", "optional": false, "description": "Source code position that referenced the failing stylesheet.", "typeRef": "Audits.SourceCodeLocation"}, {"name": "styleSheetLoadingIssueReason", "type": "string", "optional": false, "description": "Reason why the stylesheet couldn't be loaded.", "typeRef": "Audits.StyleSheetLoadingIssueReason"}, {"name": "failedRequestInfo", "type": "object", "optional": true, "description": "Contains additional info when the failure was due to a request.", "typeRef": "Audits.FailedRequestInfo"}]);
131
132
  inspectorBackend.registerType("Audits.PropertyRuleIssueDetails", [{"name": "sourceCodeLocation", "type": "object", "optional": false, "description": "Source code position of the property rule.", "typeRef": "Audits.SourceCodeLocation"}, {"name": "propertyRuleIssueReason", "type": "string", "optional": false, "description": "Reason why the property rule was discarded.", "typeRef": "Audits.PropertyRuleIssueReason"}, {"name": "propertyValue", "type": "string", "optional": true, "description": "The value of the property rule property that failed to parse", "typeRef": null}]);
132
133
  inspectorBackend.registerType("Audits.UserReidentificationIssueDetails", [{"name": "type", "type": "string", "optional": false, "description": "", "typeRef": "Audits.UserReidentificationIssueType"}, {"name": "request", "type": "object", "optional": true, "description": "Applies to BlockedFrameNavigation and BlockedSubresource issue types.", "typeRef": "Audits.AffectedRequest"}, {"name": "sourceCodeLocation", "type": "object", "optional": true, "description": "Applies to NoisedCanvasReadback issue type.", "typeRef": "Audits.SourceCodeLocation"}]);
133
- inspectorBackend.registerType("Audits.InspectorIssueDetails", [{"name": "cookieIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieIssueDetails"}, {"name": "mixedContentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.MixedContentIssueDetails"}, {"name": "blockedByResponseIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BlockedByResponseIssueDetails"}, {"name": "heavyAdIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.HeavyAdIssueDetails"}, {"name": "contentSecurityPolicyIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ContentSecurityPolicyIssueDetails"}, {"name": "sharedArrayBufferIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedArrayBufferIssueDetails"}, {"name": "lowTextContrastIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.LowTextContrastIssueDetails"}, {"name": "corsIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CorsIssueDetails"}, {"name": "attributionReportingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.AttributionReportingIssueDetails"}, {"name": "quirksModeIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.QuirksModeIssueDetails"}, {"name": "partitioningBlobURLIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PartitioningBlobURLIssueDetails"}, {"name": "navigatorUserAgentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.NavigatorUserAgentIssueDetails"}, {"name": "genericIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.GenericIssueDetails"}, {"name": "deprecationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.DeprecationIssueDetails"}, {"name": "clientHintIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ClientHintIssueDetails"}, {"name": "federatedAuthRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthRequestIssueDetails"}, {"name": "bounceTrackingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BounceTrackingIssueDetails"}, {"name": "cookieDeprecationMetadataIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieDeprecationMetadataIssueDetails"}, {"name": "stylesheetLoadingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.StylesheetLoadingIssueDetails"}, {"name": "propertyRuleIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PropertyRuleIssueDetails"}, {"name": "federatedAuthUserInfoRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthUserInfoRequestIssueDetails"}, {"name": "sharedDictionaryIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedDictionaryIssueDetails"}, {"name": "elementAccessibilityIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ElementAccessibilityIssueDetails"}, {"name": "sriMessageSignatureIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SRIMessageSignatureIssueDetails"}, {"name": "unencodedDigestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UnencodedDigestIssueDetails"}, {"name": "userReidentificationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UserReidentificationIssueDetails"}]);
134
+ inspectorBackend.registerType("Audits.PermissionElementIssueDetails", [{"name": "issueType", "type": "string", "optional": false, "description": "", "typeRef": "Audits.PermissionElementIssueType"}, {"name": "type", "type": "string", "optional": true, "description": "The value of the type attribute.", "typeRef": null}, {"name": "nodeId", "type": "number", "optional": true, "description": "The node ID of the <permission> element.", "typeRef": "DOM.BackendNodeId"}, {"name": "isWarning", "type": "boolean", "optional": true, "description": "True if the issue is a warning, false if it is an error.", "typeRef": null}, {"name": "permissionName", "type": "string", "optional": true, "description": "Fields for message construction: Used for messages that reference a specific permission name", "typeRef": null}, {"name": "occluderNodeInfo", "type": "string", "optional": true, "description": "Used for messages about occlusion", "typeRef": null}, {"name": "occluderParentNodeInfo", "type": "string", "optional": true, "description": "Used for messages about occluder's parent", "typeRef": null}, {"name": "disableReason", "type": "string", "optional": true, "description": "Used for messages about activation disabled reason", "typeRef": null}]);
135
+ inspectorBackend.registerType("Audits.InspectorIssueDetails", [{"name": "cookieIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieIssueDetails"}, {"name": "mixedContentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.MixedContentIssueDetails"}, {"name": "blockedByResponseIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BlockedByResponseIssueDetails"}, {"name": "heavyAdIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.HeavyAdIssueDetails"}, {"name": "contentSecurityPolicyIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ContentSecurityPolicyIssueDetails"}, {"name": "sharedArrayBufferIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedArrayBufferIssueDetails"}, {"name": "lowTextContrastIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.LowTextContrastIssueDetails"}, {"name": "corsIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CorsIssueDetails"}, {"name": "attributionReportingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.AttributionReportingIssueDetails"}, {"name": "quirksModeIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.QuirksModeIssueDetails"}, {"name": "partitioningBlobURLIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PartitioningBlobURLIssueDetails"}, {"name": "navigatorUserAgentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.NavigatorUserAgentIssueDetails"}, {"name": "genericIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.GenericIssueDetails"}, {"name": "deprecationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.DeprecationIssueDetails"}, {"name": "clientHintIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ClientHintIssueDetails"}, {"name": "federatedAuthRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthRequestIssueDetails"}, {"name": "bounceTrackingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BounceTrackingIssueDetails"}, {"name": "cookieDeprecationMetadataIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieDeprecationMetadataIssueDetails"}, {"name": "stylesheetLoadingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.StylesheetLoadingIssueDetails"}, {"name": "propertyRuleIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PropertyRuleIssueDetails"}, {"name": "federatedAuthUserInfoRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthUserInfoRequestIssueDetails"}, {"name": "sharedDictionaryIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedDictionaryIssueDetails"}, {"name": "elementAccessibilityIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ElementAccessibilityIssueDetails"}, {"name": "sriMessageSignatureIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SRIMessageSignatureIssueDetails"}, {"name": "unencodedDigestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UnencodedDigestIssueDetails"}, {"name": "userReidentificationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UserReidentificationIssueDetails"}, {"name": "permissionElementIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PermissionElementIssueDetails"}]);
134
136
  inspectorBackend.registerType("Audits.InspectorIssue", [{"name": "code", "type": "string", "optional": false, "description": "", "typeRef": "Audits.InspectorIssueCode"}, {"name": "details", "type": "object", "optional": false, "description": "", "typeRef": "Audits.InspectorIssueDetails"}, {"name": "issueId", "type": "string", "optional": true, "description": "A unique id for this issue. May be omitted if no other entity (e.g. exception, CDP message, etc.) is referencing this issue.", "typeRef": "Audits.IssueId"}]);
135
137
 
136
138
  // Autofill.
@@ -1354,6 +1356,7 @@ inspectorBackend.registerCommand("Target.setAutoAttach", [{"name": "autoAttach",
1354
1356
  inspectorBackend.registerCommand("Target.autoAttachRelated", [{"name": "targetId", "type": "string", "optional": false, "description": "", "typeRef": "Target.TargetID"}, {"name": "waitForDebuggerOnStart", "type": "boolean", "optional": false, "description": "Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger` to run paused targets.", "typeRef": null}, {"name": "filter", "type": "array", "optional": true, "description": "Only targets matching filter will be attached.", "typeRef": "Target.TargetFilter"}], [], "Adds the specified target to the list of targets that will be monitored for any related target creation (such as child frames, child workers and new versions of service worker) and reported through `attachedToTarget`. The specified target is also auto-attached. This cancels the effect of any previous `setAutoAttach` and is also cancelled by subsequent `setAutoAttach`. Only available at the Browser target.");
1355
1357
  inspectorBackend.registerCommand("Target.setDiscoverTargets", [{"name": "discover", "type": "boolean", "optional": false, "description": "Whether to discover available targets.", "typeRef": null}, {"name": "filter", "type": "array", "optional": true, "description": "Only targets matching filter will be attached. If `discover` is false, `filter` must be omitted or empty.", "typeRef": "Target.TargetFilter"}], [], "Controls whether to discover available targets and notify via `targetCreated/targetInfoChanged/targetDestroyed` events.");
1356
1358
  inspectorBackend.registerCommand("Target.setRemoteLocations", [{"name": "locations", "type": "array", "optional": false, "description": "List of remote locations.", "typeRef": "Target.RemoteLocation"}], [], "Enables target discovery for the specified locations, when `setDiscoverTargets` was set to `true`.");
1359
+ inspectorBackend.registerCommand("Target.getDevToolsTarget", [{"name": "targetId", "type": "string", "optional": false, "description": "Page or tab target ID.", "typeRef": "Target.TargetID"}], ["targetId"], "Gets the targetId of the DevTools page target opened for the given target (if any).");
1357
1360
  inspectorBackend.registerCommand("Target.openDevTools", [{"name": "targetId", "type": "string", "optional": false, "description": "This can be the page or tab target ID.", "typeRef": "Target.TargetID"}, {"name": "panelId", "type": "string", "optional": true, "description": "The id of the panel we want DevTools to open initially. Currently supported panels are elements, console, network, sources, resources and performance.", "typeRef": null}], ["targetId"], "Opens a DevTools window for the target.");
1358
1361
  inspectorBackend.registerType("Target.TargetInfo", [{"name": "targetId", "type": "string", "optional": false, "description": "", "typeRef": "Target.TargetID"}, {"name": "type", "type": "string", "optional": false, "description": "List of types: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_agent_host_impl.cc?ss=chromium&q=f:devtools%20-f:out%20%22::kTypeTab%5B%5D%22", "typeRef": null}, {"name": "title", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "url", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "attached", "type": "boolean", "optional": false, "description": "Whether the target has an attached client.", "typeRef": null}, {"name": "openerId", "type": "string", "optional": true, "description": "Opener target Id", "typeRef": "Target.TargetID"}, {"name": "canAccessOpener", "type": "boolean", "optional": false, "description": "Whether the target has access to the originating window.", "typeRef": null}, {"name": "openerFrameId", "type": "string", "optional": true, "description": "Frame id of originating window (is only set if target has an opener).", "typeRef": "Page.FrameId"}, {"name": "parentFrameId", "type": "string", "optional": true, "description": "Id of the parent frame, only present for the \\\"iframe\\\" targets.", "typeRef": "Page.FrameId"}, {"name": "browserContextId", "type": "string", "optional": true, "description": "", "typeRef": "Browser.BrowserContextID"}, {"name": "subtype", "type": "string", "optional": true, "description": "Provides additional details for specific target types. For example, for the type of \\\"page\\\", this may be set to \\\"prerender\\\".", "typeRef": null}]);
1359
1362
  inspectorBackend.registerType("Target.FilterEntry", [{"name": "exclude", "type": "boolean", "optional": true, "description": "If set, causes exclusion of matching targets from the list.", "typeRef": null}, {"name": "type", "type": "string", "optional": true, "description": "If not present, matches any type.", "typeRef": null}]);
@@ -4837,6 +4837,14 @@ export namespace ProtocolMapping {
4837
4837
  paramsType: [Protocol.Target.SetRemoteLocationsRequest];
4838
4838
  returnType: void;
4839
4839
  };
4840
+ /**
4841
+ * Gets the targetId of the DevTools page target opened for the given target
4842
+ * (if any).
4843
+ */
4844
+ 'Target.getDevToolsTarget': {
4845
+ paramsType: [Protocol.Target.GetDevToolsTargetRequest];
4846
+ returnType: Protocol.Target.GetDevToolsTargetResponse;
4847
+ };
4840
4848
  /**
4841
4849
  * Opens a DevTools window for the target.
4842
4850
  */
@@ -4209,6 +4209,12 @@ declare namespace ProtocolProxyApi {
4209
4209
  */
4210
4210
  invoke_setRemoteLocations(params: Protocol.Target.SetRemoteLocationsRequest): Promise<Protocol.ProtocolResponseWithError>;
4211
4211
 
4212
+ /**
4213
+ * Gets the targetId of the DevTools page target opened for the given target
4214
+ * (if any).
4215
+ */
4216
+ invoke_getDevToolsTarget(params: Protocol.Target.GetDevToolsTargetRequest): Promise<Protocol.Target.GetDevToolsTargetResponse>;
4217
+
4212
4218
  /**
4213
4219
  * Opens a DevTools window for the target.
4214
4220
  */
@@ -1461,6 +1461,66 @@ export namespace Audits {
1461
1461
  sourceCodeLocation?: SourceCodeLocation;
1462
1462
  }
1463
1463
 
1464
+ export const enum PermissionElementIssueType {
1465
+ InvalidType = 'InvalidType',
1466
+ FencedFrameDisallowed = 'FencedFrameDisallowed',
1467
+ CspFrameAncestorsMissing = 'CspFrameAncestorsMissing',
1468
+ PermissionsPolicyBlocked = 'PermissionsPolicyBlocked',
1469
+ PaddingRightUnsupported = 'PaddingRightUnsupported',
1470
+ PaddingBottomUnsupported = 'PaddingBottomUnsupported',
1471
+ InsetBoxShadowUnsupported = 'InsetBoxShadowUnsupported',
1472
+ RequestInProgress = 'RequestInProgress',
1473
+ UntrustedEvent = 'UntrustedEvent',
1474
+ RegistrationFailed = 'RegistrationFailed',
1475
+ TypeNotSupported = 'TypeNotSupported',
1476
+ InvalidTypeActivation = 'InvalidTypeActivation',
1477
+ SecurityChecksFailed = 'SecurityChecksFailed',
1478
+ ActivationDisabled = 'ActivationDisabled',
1479
+ GeolocationDeprecated = 'GeolocationDeprecated',
1480
+ InvalidDisplayStyle = 'InvalidDisplayStyle',
1481
+ NonOpaqueColor = 'NonOpaqueColor',
1482
+ LowContrast = 'LowContrast',
1483
+ FontSizeTooSmall = 'FontSizeTooSmall',
1484
+ FontSizeTooLarge = 'FontSizeTooLarge',
1485
+ InvalidSizeValue = 'InvalidSizeValue',
1486
+ }
1487
+
1488
+ /**
1489
+ * This issue warns about improper usage of the <permission> element.
1490
+ */
1491
+ export interface PermissionElementIssueDetails {
1492
+ issueType: PermissionElementIssueType;
1493
+ /**
1494
+ * The value of the type attribute.
1495
+ */
1496
+ type?: string;
1497
+ /**
1498
+ * The node ID of the <permission> element.
1499
+ */
1500
+ nodeId?: DOM.BackendNodeId;
1501
+ /**
1502
+ * True if the issue is a warning, false if it is an error.
1503
+ */
1504
+ isWarning?: boolean;
1505
+ /**
1506
+ * Fields for message construction:
1507
+ * Used for messages that reference a specific permission name
1508
+ */
1509
+ permissionName?: string;
1510
+ /**
1511
+ * Used for messages about occlusion
1512
+ */
1513
+ occluderNodeInfo?: string;
1514
+ /**
1515
+ * Used for messages about occluder's parent
1516
+ */
1517
+ occluderParentNodeInfo?: string;
1518
+ /**
1519
+ * Used for messages about activation disabled reason
1520
+ */
1521
+ disableReason?: string;
1522
+ }
1523
+
1464
1524
  /**
1465
1525
  * A unique identifier for the type of issue. Each type may use one of the
1466
1526
  * optional fields in InspectorIssueDetails to convey more specific
@@ -1493,6 +1553,7 @@ export namespace Audits {
1493
1553
  SRIMessageSignatureIssue = 'SRIMessageSignatureIssue',
1494
1554
  UnencodedDigestIssue = 'UnencodedDigestIssue',
1495
1555
  UserReidentificationIssue = 'UserReidentificationIssue',
1556
+ PermissionElementIssue = 'PermissionElementIssue',
1496
1557
  }
1497
1558
 
1498
1559
  /**
@@ -1530,6 +1591,7 @@ export namespace Audits {
1530
1591
  sriMessageSignatureIssueDetails?: SRIMessageSignatureIssueDetails;
1531
1592
  unencodedDigestIssueDetails?: UnencodedDigestIssueDetails;
1532
1593
  userReidentificationIssueDetails?: UserReidentificationIssueDetails;
1594
+ permissionElementIssueDetails?: PermissionElementIssueDetails;
1533
1595
  }
1534
1596
 
1535
1597
  /**
@@ -18501,6 +18563,20 @@ export namespace Target {
18501
18563
  locations: RemoteLocation[];
18502
18564
  }
18503
18565
 
18566
+ export interface GetDevToolsTargetRequest {
18567
+ /**
18568
+ * Page or tab target ID.
18569
+ */
18570
+ targetId: TargetID;
18571
+ }
18572
+
18573
+ export interface GetDevToolsTargetResponse extends ProtocolResponseWithError {
18574
+ /**
18575
+ * The targetId of DevTools page target if exists.
18576
+ */
18577
+ targetId?: TargetID;
18578
+ }
18579
+
18504
18580
  export interface OpenDevToolsRequest {
18505
18581
  /**
18506
18582
  * This can be the page or tab target ID.