Danil Somsikov | 4ba8f35 | 2021-06-09 12:27:22 | [diff] [blame] | 1 | // Copyright 2021 The Chromium Authors. All rights reserved. |
Wolfgang Beyer | 760462e | 2020-07-13 15:01:35 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Wolfgang Beyer | 1909394 | 2021-03-15 15:00:34 | [diff] [blame] | 5 | import type {StackTraceData} from './StackTrace.js'; |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 6 | import {StackTrace} from './StackTrace.js'; |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 7 | import type {PermissionsPolicySectionData} from './PermissionsPolicySection.js'; |
| 8 | import {PermissionsPolicySection, renderIconLink} from './PermissionsPolicySection.js'; |
Tim van der Lippe | 1bd5e21 | 2021-05-06 10:54:29 | [diff] [blame] | 9 | import * as Bindings from '../../../models/bindings/bindings.js'; |
| 10 | import * as Common from '../../../core/common/common.js'; |
| 11 | import * as i18n from '../../../core/i18n/i18n.js'; |
Sigurd Schneider | 2e36ec6 | 2021-06-11 06:14:27 | [diff] [blame] | 12 | import * as NetworkForward from '../../../panels/network/forward/forward.js'; |
Jack Franklin | a75ae7c | 2021-05-11 13:22:54 | [diff] [blame] | 13 | import type * as Platform from '../../../core/platform/platform.js'; |
Tim van der Lippe | 1bd5e21 | 2021-05-06 10:54:29 | [diff] [blame] | 14 | import * as Root from '../../../core/root/root.js'; |
Tim van der Lippe | c2cbf32 | 2021-07-26 14:35:33 | [diff] [blame] | 15 | import * as SDK from '../../../core/sdk/sdk.js'; |
Paul Lewis | 01f4939 | 2021-05-10 13:54:20 | [diff] [blame] | 16 | import * as LitHtml from '../../../ui/lit-html/lit-html.js'; |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 17 | import * as ExpandableList from '../../../ui/components/expandable_list/expandable_list.js'; |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 18 | import * as ReportView from '../../../ui/components/report_view/report_view.js'; |
| 19 | import * as IconButton from '../../../ui/components/icon_button/icon_button.js'; |
Tim van der Lippe | 1bd5e21 | 2021-05-06 10:54:29 | [diff] [blame] | 20 | import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js'; |
| 21 | import * as UI from '../../../ui/legacy/legacy.js'; |
| 22 | import * as Workspace from '../../../models/workspace/workspace.js'; |
| 23 | import * as Components from '../../../ui/legacy/components/utils/utils.js'; |
Tim van der Lippe | 229a54f | 2021-05-14 16:59:05 | [diff] [blame] | 24 | import * as Protocol from '../../../generated/protocol.js'; |
Charlie Hu | 2086be5 | 2021-07-02 16:12:12 | [diff] [blame] | 25 | import type {OriginTrialTreeViewData} from './OriginTrialTreeView.js'; |
| 26 | import {OriginTrialTreeView} from './OriginTrialTreeView.js'; |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 27 | import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; |
Wolfgang Beyer | 760462e | 2020-07-13 15:01:35 | [diff] [blame] | 28 | |
Kriti Sapra | 9db87f5 | 2021-07-14 12:51:12 | [diff] [blame] | 29 | import frameDetailsReportViewStyles from './frameDetailsReportView.css.js'; |
| 30 | |
Simon Zünd | 697fb0b | 2021-03-01 10:12:42 | [diff] [blame] | 31 | const UIStrings = { |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 32 | /** |
| 33 | *@description Section header in the Frame Details view |
| 34 | */ |
| 35 | additionalInformation: 'Additional Information', |
| 36 | /** |
| 37 | *@description Explanation for why the additional information section is being shown |
| 38 | */ |
| 39 | thisAdditionalDebugging: |
| 40 | 'This additional (debugging) information is shown because the \'Protocol Monitor\' experiment is enabled.', |
| 41 | /** |
| 42 | *@description Label for subtitle of frame details view |
| 43 | */ |
| 44 | frameId: 'Frame ID', |
| 45 | /** |
| 46 | *@description Name of a network resource type |
| 47 | */ |
| 48 | document: 'Document', |
| 49 | /** |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 50 | *@description A web URL (for a lot of languages this does not need to be translated, please translate only where necessary) |
| 51 | */ |
| 52 | url: 'URL', |
| 53 | /** |
| 54 | /** |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 55 | *@description Title for a link to the Sources panel |
| 56 | */ |
| 57 | clickToRevealInSourcesPanel: 'Click to reveal in Sources panel', |
| 58 | /** |
| 59 | *@description Title for a link to the Network panel |
| 60 | */ |
| 61 | clickToRevealInNetworkPanel: 'Click to reveal in Network panel', |
| 62 | /** |
| 63 | *@description Title for unreachable URL field |
| 64 | */ |
| 65 | unreachableUrl: 'Unreachable URL', |
| 66 | /** |
| 67 | *@description Title for a link that applies a filter to the network panel |
| 68 | */ |
| 69 | clickToRevealInNetworkPanelMight: 'Click to reveal in Network panel (might require page reload)', |
| 70 | /** |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 71 | *@description The origin of a URL (https://web.dev/same-site-same-origin/#origin) |
| 72 | *(for a lot of languages this does not need to be translated, please translate only where necessary) |
| 73 | */ |
| 74 | origin: 'Origin', |
| 75 | /** |
| 76 | /** |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 77 | *@description Related node label in Timeline UIUtils of the Performance panel |
| 78 | */ |
| 79 | ownerElement: 'Owner Element', |
| 80 | /** |
| 81 | *@description Title for a link to the Elements panel |
| 82 | */ |
| 83 | clickToRevealInElementsPanel: 'Click to reveal in Elements panel', |
| 84 | /** |
| 85 | *@description Title for ad frame type field |
| 86 | */ |
| 87 | adStatus: 'Ad Status', |
| 88 | /** |
| 89 | *@description Description for ad frame type |
| 90 | */ |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 91 | rootDescription: 'This frame has been identified as the root frame of an ad', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 92 | /** |
| 93 | *@description Value for ad frame type |
| 94 | */ |
| 95 | root: 'root', |
| 96 | /** |
| 97 | *@description Description for ad frame type |
| 98 | */ |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 99 | childDescription: 'This frame has been identified as a child frame of an ad', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 100 | /** |
| 101 | *@description Value for ad frame type |
| 102 | */ |
| 103 | child: 'child', |
| 104 | /** |
| 105 | *@description Section header in the Frame Details view |
| 106 | */ |
| 107 | securityIsolation: 'Security & Isolation', |
| 108 | /** |
| 109 | *@description Row title for in the Frame Details view |
| 110 | */ |
| 111 | secureContext: 'Secure Context', |
| 112 | /** |
| 113 | *@description Text in Timeline indicating that input has happened recently |
| 114 | */ |
| 115 | yes: 'Yes', |
| 116 | /** |
| 117 | *@description Text in Timeline indicating that input has not happened recently |
| 118 | */ |
| 119 | no: 'No', |
| 120 | /** |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 121 | *@description Label for whether a frame is cross-origin isolated |
| 122 | *(https://developer.chrome.com/docs/extensions/mv3/cross-origin-isolation/) |
| 123 | *(for a lot of languages this does not need to be translated, please translate only where necessary) |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 124 | */ |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 125 | crossoriginIsolated: 'Cross-Origin Isolated', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 126 | /** |
| 127 | *@description Explanatory text in the Frame Details view |
| 128 | */ |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 129 | localhostIsAlwaysASecureContext: '`Localhost` is always a secure context', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 130 | /** |
| 131 | *@description Explanatory text in the Frame Details view |
| 132 | */ |
| 133 | aFrameAncestorIsAnInsecure: 'A frame ancestor is an insecure context', |
| 134 | /** |
| 135 | *@description Explanatory text in the Frame Details view |
| 136 | */ |
| 137 | theFramesSchemeIsInsecure: 'The frame\'s scheme is insecure', |
| 138 | /** |
Peter Marshall | ec86188 | 2021-02-16 11:14:21 | [diff] [blame] | 139 | *@description This label specifies the server endpoints to which the server is reporting errors |
| 140 | *and warnings through the Report-to API. Following this label will be the URL of the server. |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 141 | */ |
| 142 | reportingTo: 'reporting to', |
| 143 | /** |
| 144 | *@description Section header in the Frame Details view |
| 145 | */ |
| 146 | apiAvailability: 'API availability', |
| 147 | /** |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 148 | *@description Explanation of why cross-origin isolation is important |
| 149 | *(https://web.dev/why-coop-coep/) |
| 150 | *(for a lot of languages 'cross-origin isolation' does not need to be translated, please translate only where necessary) |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 151 | */ |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 152 | availabilityOfCertainApisDepends: 'Availability of certain APIs depends on the document being cross-origin isolated.', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 153 | /** |
| 154 | *@description Description of the SharedArrayBuffer status |
| 155 | */ |
| 156 | availableTransferable: 'available, transferable', |
| 157 | /** |
| 158 | *@description Description of the SharedArrayBuffer status |
| 159 | */ |
| 160 | availableNotTransferable: 'available, not transferable', |
| 161 | /** |
| 162 | *@description Explanation for the SharedArrayBuffer availability status |
| 163 | */ |
| 164 | unavailable: 'unavailable', |
| 165 | /** |
| 166 | *@description Tooltip for the SharedArrayBuffer availability status |
| 167 | */ |
| 168 | sharedarraybufferConstructorIs: |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 169 | '`SharedArrayBuffer` constructor is available and `SABs` can be transferred via `postMessage`', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 170 | /** |
| 171 | *@description Tooltip for the SharedArrayBuffer availability status |
| 172 | */ |
| 173 | sharedarraybufferConstructorIsAvailable: |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 174 | '`SharedArrayBuffer` constructor is available but `SABs` cannot be transferred via `postMessage`', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 175 | /** |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 176 | *@description Explanation why SharedArrayBuffer will not be available in the future |
| 177 | *(https://developer.chrome.com/docs/extensions/mv3/cross-origin-isolation/) |
| 178 | *(for a lot of languages 'cross-origin isolation' does not need to be translated, please translate only where necessary) |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 179 | */ |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 180 | willRequireCrossoriginIsolated: '⚠️ will require cross-origin isolated context in the future', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 181 | /** |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 182 | *@description Explanation why SharedArrayBuffer is not available |
| 183 | *(https://developer.chrome.com/docs/extensions/mv3/cross-origin-isolation/) |
| 184 | *(for a lot of languages 'cross-origin isolation' does not need to be translated, please translate only where necessary). |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 185 | */ |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 186 | requiresCrossoriginIsolated: 'requires cross-origin isolated context', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 187 | /** |
Sigurd Schneider | f7e58be | 2021-05-14 14:41:52 | [diff] [blame] | 188 | *@description Explanation for the SharedArrayBuffer availability status in case the transfer of a SAB requires the |
| 189 | * permission policy `cross-origin-isolated` to be enabled (e.g. because the message refers to the situation in an iframe). |
| 190 | */ |
| 191 | transferRequiresCrossoriginIsolatedPermission: |
| 192 | '`SharedArrayBuffer` transfer requires enabling the permission policy:', |
Sigurd Schneider | 2a45025 | 2021-05-04 07:13:15 | [diff] [blame] | 193 | /** |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 194 | *@description Explanation for the Measure Memory availability status |
| 195 | */ |
| 196 | available: 'available', |
| 197 | /** |
| 198 | *@description Tooltip for the Measure Memory availability status |
| 199 | */ |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 200 | thePerformanceAPI: 'The `performance.measureUserAgentSpecificMemory()` API is available', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 201 | /** |
| 202 | *@description Tooltip for the Measure Memory availability status |
| 203 | */ |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 204 | thePerformancemeasureuseragentspecificmemory: |
| 205 | 'The `performance.measureUserAgentSpecificMemory()` API is not available', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 206 | /** |
| 207 | *@description Entry in the API availability section of the frame details view |
| 208 | */ |
| 209 | measureMemory: 'Measure Memory', |
| 210 | /** |
| 211 | *@description Text that is usually a hyperlink to more documentation |
| 212 | */ |
| 213 | learnMore: 'Learn more', |
Wolfgang Beyer | 1909394 | 2021-03-15 15:00:34 | [diff] [blame] | 214 | /** |
Wolfgang Beyer | 4083492 | 2021-05-10 08:34:22 | [diff] [blame] | 215 | *@description Label for a stack trace. If a frame is created programmatically (i.e. via JavaScript), there is a |
| 216 | * stack trace for the line of code which caused the creation of the iframe. This is the stack trace we are showing here. |
Wolfgang Beyer | 1909394 | 2021-03-15 15:00:34 | [diff] [blame] | 217 | */ |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 218 | creationStackTrace: 'Frame Creation `Stack Trace`', |
Wolfgang Beyer | 1909394 | 2021-03-15 15:00:34 | [diff] [blame] | 219 | /** |
| 220 | *@description Tooltip for 'Frame Creation Stack Trace' explaining that the stack |
| 221 | *trace shows where in the code the frame has been created programmatically |
| 222 | */ |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 223 | creationStackTraceExplanation: |
| 224 | 'This frame was created programmatically. The `stack trace` shows where this happened.', |
Wolfgang Beyer | 4751c1c | 2021-03-24 15:32:35 | [diff] [blame] | 225 | /** |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 226 | *@description Text descripting why a frame has been indentified as an advertisement. |
| 227 | */ |
| 228 | parentIsAdExplanation: 'This frame is considered an ad frame because its parent frame is an ad frame.', |
| 229 | /** |
| 230 | *@description Text descripting why a frame has been indentified as an advertisement. |
| 231 | */ |
| 232 | matchedBlockingRuleExplanation: |
| 233 | 'This frame is considered an ad frame because its current (or previous) main document is an ad resource.', |
| 234 | /** |
| 235 | *@description Text descripting why a frame has been indentified as an advertisement. |
| 236 | */ |
| 237 | createdByAdScriptExplanation: |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 238 | 'There was an ad script in the `(async) stack` when this frame was created. Examining the creation `stack trace` of this frame might provide more insight.', |
Wolfgang Beyer | 1a432c4 | 2022-01-20 09:30:14 | [diff] [blame] | 239 | /** |
| 240 | *@description Label for a button which when clicked causes some information to be refreshed/updated. |
| 241 | */ |
| 242 | refresh: 'Refresh', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 243 | }; |
Tim van der Lippe | 1bd5e21 | 2021-05-06 10:54:29 | [diff] [blame] | 244 | const str_ = i18n.i18n.registerUIStrings('panels/application/components/FrameDetailsView.ts', UIStrings); |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 245 | const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); |
Sigurd Schneider | 1e5ad28 | 2020-07-17 11:52:08 | [diff] [blame] | 246 | export class FrameDetailsView extends UI.ThrottledWidget.ThrottledWidget { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 247 | readonly #reportView = new FrameDetailsReportView(); |
| 248 | readonly #frame: SDK.ResourceTreeModel.ResourceTreeFrame; |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 249 | |
Wolfgang Beyer | 309863f | 2021-01-21 09:01:21 | [diff] [blame] | 250 | constructor(frame: SDK.ResourceTreeModel.ResourceTreeFrame) { |
Wolfgang Beyer | 760462e | 2020-07-13 15:01:35 | [diff] [blame] | 251 | super(); |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 252 | this.#frame = frame; |
Wolfgang Beyer | e5d1a9f | 2021-02-05 09:42:43 | [diff] [blame] | 253 | this.contentElement.classList.add('overflow-auto'); |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 254 | this.contentElement.appendChild(this.#reportView); |
Sigurd Schneider | 1e5ad28 | 2020-07-17 11:52:08 | [diff] [blame] | 255 | this.update(); |
| 256 | } |
| 257 | |
Wolfgang Beyer | 309863f | 2021-01-21 09:01:21 | [diff] [blame] | 258 | async doUpdate(): Promise<void> { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 259 | this.#reportView.data = {frame: this.#frame}; |
Sigurd Schneider | eabef96 | 2020-11-05 10:51:49 | [diff] [blame] | 260 | } |
Wolfgang Beyer | 760462e | 2020-07-13 15:01:35 | [diff] [blame] | 261 | } |
Wolfgang Beyer | 3b4747f | 2020-08-12 07:30:46 | [diff] [blame] | 262 | |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 263 | const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); |
| 264 | |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 265 | export interface FrameDetailsReportViewData { |
| 266 | frame: SDK.ResourceTreeModel.ResourceTreeFrame; |
| 267 | } |
| 268 | |
| 269 | export class FrameDetailsReportView extends HTMLElement { |
Jack Franklin | af799b3 | 2021-07-01 08:37:18 | [diff] [blame] | 270 | static readonly litTagName = LitHtml.literal`devtools-resources-frame-details-view`; |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 271 | readonly #shadow = this.attachShadow({mode: 'open'}); |
| 272 | #frame?: SDK.ResourceTreeModel.ResourceTreeFrame; |
| 273 | #protocolMonitorExperimentEnabled = false; |
| 274 | #permissionsPolicies: Promise<Protocol.Page.PermissionsPolicyFeatureState[]|null>|null = null; |
| 275 | #permissionsPolicySectionData: PermissionsPolicySectionData = {policies: [], showDetails: false}; |
| 276 | #originTrialTreeView: OriginTrialTreeView = new OriginTrialTreeView(); |
Wolfgang Beyer | e5d1a9f | 2021-02-05 09:42:43 | [diff] [blame] | 277 | |
| 278 | connectedCallback(): void { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 279 | this.#protocolMonitorExperimentEnabled = Root.Runtime.experiments.isEnabled('protocolMonitor'); |
| 280 | this.#shadow.adoptedStyleSheets = [frameDetailsReportViewStyles]; |
Wolfgang Beyer | e5d1a9f | 2021-02-05 09:42:43 | [diff] [blame] | 281 | } |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 282 | |
| 283 | set data(data: FrameDetailsReportViewData) { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 284 | this.#frame = data.frame; |
| 285 | if (!this.#permissionsPolicies && this.#frame) { |
| 286 | this.#permissionsPolicies = this.#frame.getPermissionsPolicyState(); |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 287 | } |
Tim van der Lippe | 2d9a95c | 2022-01-04 15:18:03 | [diff] [blame] | 288 | void this.#render(); |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 289 | } |
| 290 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 291 | async #render(): Promise<void> { |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 292 | await coordinator.write('FrameDetailsView render', () => { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 293 | if (!this.#frame) { |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 294 | return; |
| 295 | } |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 296 | |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 297 | // Disabled until https://crbug.com/1079231 is fixed. |
| 298 | // clang-format off |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 299 | LitHtml.render(LitHtml.html` |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 300 | <${ReportView.ReportView.Report.litTagName} .data=${{reportTitle: this.#frame.displayName()} as ReportView.ReportView.ReportData}> |
| 301 | ${this.#renderDocumentSection()} |
| 302 | ${this.#renderIsolationSection()} |
| 303 | ${this.#renderApiAvailabilitySection()} |
| 304 | ${this.#renderOriginTrial()} |
| 305 | ${LitHtml.Directives.until(this.#permissionsPolicies?.then(policies => { |
| 306 | this.#permissionsPolicySectionData.policies = policies || []; |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 307 | return LitHtml.html` |
| 308 | <${PermissionsPolicySection.litTagName} |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 309 | .data=${this.#permissionsPolicySectionData as PermissionsPolicySectionData} |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 310 | > |
| 311 | </${PermissionsPolicySection.litTagName}> |
| 312 | `; |
| 313 | }), LitHtml.nothing)} |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 314 | ${this.#protocolMonitorExperimentEnabled ? this.#renderAdditionalInfoSection() : LitHtml.nothing} |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 315 | </${ReportView.ReportView.Report.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 316 | `, this.#shadow, {host: this}); |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 317 | // clang-format on |
| 318 | }); |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 319 | } |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 320 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 321 | #renderOriginTrial(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 322 | if (!this.#frame) { |
Charlie Hu | 2086be5 | 2021-07-02 16:12:12 | [diff] [blame] | 323 | return LitHtml.nothing; |
| 324 | } |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 325 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 326 | this.#originTrialTreeView.classList.add('span-cols'); |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 327 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 328 | const frame = this.#frame; |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 329 | const refreshOriginTrials: () => void = () => { |
Tim van der Lippe | 2d9a95c | 2022-01-04 15:18:03 | [diff] [blame] | 330 | void frame.getOriginTrials().then(trials => { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 331 | this.#originTrialTreeView.data = {trials} as OriginTrialTreeViewData; |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 332 | }); |
| 333 | }; |
| 334 | refreshOriginTrials(); |
| 335 | |
Charlie Hu | 2086be5 | 2021-07-02 16:12:12 | [diff] [blame] | 336 | return LitHtml.html` |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 337 | <${ReportView.ReportView.ReportSectionHeader.litTagName}> |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 338 | ${i18n.i18n.lockedString('Origin Trials')} |
Jack Franklin | a31102b | 2021-12-03 15:01:22 | [diff] [blame] | 339 | <${IconButton.IconButton.IconButton.litTagName} class="inline-button" .data=${{ |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 340 | clickHandler: refreshOriginTrials, |
| 341 | groups: [ |
| 342 | { |
| 343 | iconName: 'refresh_12x12_icon', |
Wolfgang Beyer | 1a432c4 | 2022-01-20 09:30:14 | [diff] [blame] | 344 | text: i18nString(UIStrings.refresh), |
Wolfgang Beyer | 6bdafac | 2022-01-24 09:24:43 | [diff] [blame] | 345 | iconColor: 'var(--color-text-primary)', |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 346 | } as IconButton.IconButton.IconWithTextData, |
| 347 | ], |
Jack Franklin | a31102b | 2021-12-03 15:01:22 | [diff] [blame] | 348 | } as IconButton.IconButton.IconButtonData}> |
Charlie Hu | 6c295cf | 2021-08-10 15:38:48 | [diff] [blame] | 349 | </${IconButton.IconButton.IconButton.litTagName}> |
Charlie Hu | 2086be5 | 2021-07-02 16:12:12 | [diff] [blame] | 350 | </${ReportView.ReportView.ReportSectionHeader.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 351 | ${this.#originTrialTreeView} |
Charlie Hu | 2086be5 | 2021-07-02 16:12:12 | [diff] [blame] | 352 | <${ReportView.ReportView.ReportSectionDivider.litTagName}></${ |
| 353 | ReportView.ReportView.ReportSectionDivider.litTagName}> |
| 354 | `; |
| 355 | } |
| 356 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 357 | #renderDocumentSection(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 358 | if (!this.#frame) { |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 359 | return LitHtml.nothing; |
| 360 | } |
| 361 | |
| 362 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 363 | <${ReportView.ReportView.ReportSectionHeader.litTagName}>${i18nString(UIStrings.document)}</${ |
| 364 | ReportView.ReportView.ReportSectionHeader.litTagName}> |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 365 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.url)}</${ |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 366 | ReportView.ReportView.ReportKey.litTagName}> |
| 367 | <${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 368 | <div class="inline-items"> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 369 | ${this.#maybeRenderSourcesLinkForURL()} |
| 370 | ${this.#maybeRenderNetworkLinkForURL()} |
| 371 | <div class="text-ellipsis" title=${this.#frame.url}>${this.#frame.url}</div> |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 372 | </div> |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 373 | </${ReportView.ReportView.ReportValue.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 374 | ${this.#maybeRenderUnreachableURL()} |
| 375 | ${this.#maybeRenderOrigin()} |
| 376 | ${LitHtml.Directives.until(this.#renderOwnerElement(), LitHtml.nothing)} |
| 377 | ${this.#maybeRenderCreationStacktrace()} |
| 378 | ${this.#maybeRenderAdStatus()} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 379 | <${ReportView.ReportView.ReportSectionDivider.litTagName}></${ |
| 380 | ReportView.ReportView.ReportSectionDivider.litTagName}> |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 381 | `; |
| 382 | } |
| 383 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 384 | #maybeRenderSourcesLinkForURL(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 385 | if (!this.#frame || this.#frame.unreachableUrl()) { |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 386 | return LitHtml.nothing; |
| 387 | } |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 388 | const sourceCode = this.#uiSourceCodeForFrame(this.#frame); |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 389 | return renderIconLink( |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 390 | 'sources_panel_icon', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 391 | i18nString(UIStrings.clickToRevealInSourcesPanel), |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 392 | (): Promise<void> => Common.Revealer.reveal(sourceCode), |
| 393 | ); |
| 394 | } |
| 395 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 396 | #maybeRenderNetworkLinkForURL(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 397 | if (this.#frame) { |
| 398 | const resource = this.#frame.resourceForURL(this.#frame.url); |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 399 | if (resource && resource.request) { |
| 400 | const request = resource.request; |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 401 | return renderIconLink( |
Sigurd Schneider | 14d3e9f | 2021-06-14 08:29:01 | [diff] [blame] | 402 | 'network_panel_icon', i18nString(UIStrings.clickToRevealInNetworkPanel), (): Promise<void> => { |
| 403 | const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab( |
| 404 | request, NetworkForward.UIRequestLocation.UIRequestTabs.Headers); |
| 405 | return Common.Revealer.reveal(requestLocation); |
| 406 | }); |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 407 | } |
| 408 | } |
| 409 | return LitHtml.nothing; |
| 410 | } |
| 411 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 412 | #uiSourceCodeForFrame(frame: SDK.ResourceTreeModel.ResourceTreeFrame): Workspace.UISourceCode.UISourceCode|null { |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 413 | for (const project of Workspace.Workspace.WorkspaceImpl.instance().projects()) { |
| 414 | const projectTarget = Bindings.NetworkProject.NetworkProject.getTargetForProject(project); |
| 415 | if (projectTarget && projectTarget === frame.resourceTreeModel().target()) { |
| 416 | const uiSourceCode = project.uiSourceCodeForURL(frame.url); |
| 417 | if (uiSourceCode) { |
| 418 | return uiSourceCode; |
| 419 | } |
| 420 | } |
| 421 | } |
| 422 | return null; |
| 423 | } |
| 424 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 425 | #maybeRenderUnreachableURL(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 426 | if (!this.#frame || !this.#frame.unreachableUrl()) { |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 427 | return LitHtml.nothing; |
| 428 | } |
| 429 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 430 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.unreachableUrl)}</${ |
| 431 | ReportView.ReportView.ReportKey.litTagName}> |
| 432 | <${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 433 | <div class="inline-items"> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 434 | ${this.#renderNetworkLinkForUnreachableURL()} |
| 435 | <div class="text-ellipsis" title=${this.#frame.unreachableUrl()}>${this.#frame.unreachableUrl()}</div> |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 436 | </div> |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 437 | </${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 438 | `; |
| 439 | } |
| 440 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 441 | #renderNetworkLinkForUnreachableURL(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 442 | if (this.#frame) { |
| 443 | const unreachableUrl = Common.ParsedURL.ParsedURL.fromString(this.#frame.unreachableUrl()); |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 444 | if (unreachableUrl) { |
Wolfgang Beyer | ffae99f | 2021-07-08 08:46:53 | [diff] [blame] | 445 | return renderIconLink( |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 446 | 'network_panel_icon', |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 447 | i18nString(UIStrings.clickToRevealInNetworkPanelMight), |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 448 | (): |
| 449 | void => { |
Tim van der Lippe | 2d9a95c | 2022-01-04 15:18:03 | [diff] [blame] | 450 | void Common.Revealer.reveal(NetworkForward.UIFilter.UIRequestFilter.filters([ |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 451 | { |
Sigurd Schneider | 3072258 | 2021-06-16 06:54:16 | [diff] [blame] | 452 | filterType: NetworkForward.UIFilter.FilterType.Domain, |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 453 | filterValue: unreachableUrl.domain(), |
| 454 | }, |
| 455 | { |
| 456 | filterType: null, |
| 457 | filterValue: unreachableUrl.path, |
| 458 | }, |
Sigurd Schneider | 3072258 | 2021-06-16 06:54:16 | [diff] [blame] | 459 | ])); |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 460 | }, |
| 461 | ); |
| 462 | } |
| 463 | } |
| 464 | return LitHtml.nothing; |
| 465 | } |
| 466 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 467 | #maybeRenderOrigin(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 468 | if (this.#frame && this.#frame.securityOrigin && this.#frame.securityOrigin !== '://') { |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 469 | return LitHtml.html` |
Wolfgang Beyer | 5e451ff | 2021-12-08 16:44:35 | [diff] [blame] | 470 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.origin)}</${ |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 471 | ReportView.ReportView.ReportKey.litTagName}> |
| 472 | <${ReportView.ReportView.ReportValue.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 473 | <div class="text-ellipsis" title=${this.#frame.securityOrigin}>${this.#frame.securityOrigin}</div> |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 474 | </${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 475 | `; |
| 476 | } |
| 477 | return LitHtml.nothing; |
| 478 | } |
| 479 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 480 | async #renderOwnerElement(): Promise<LitHtml.LitTemplate> { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 481 | if (this.#frame) { |
| 482 | const linkTargetDOMNode = await this.#frame.getOwnerDOMNodeOrDocument(); |
Wolfgang Beyer | f0d985e | 2021-02-05 12:56:52 | [diff] [blame] | 483 | if (linkTargetDOMNode) { |
| 484 | // Disabled until https://crbug.com/1079231 is fixed. |
| 485 | // clang-format off |
Wolfgang Beyer | f0d985e | 2021-02-05 12:56:52 | [diff] [blame] | 486 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 487 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.ownerElement)}</${ReportView.ReportView.ReportKey.litTagName}> |
| 488 | <${ReportView.ReportView.ReportValue.litTagName} class="without-min-width"> |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 489 | <button class="link" role="link" tabindex=0 title=${i18nString(UIStrings.clickToRevealInElementsPanel)} |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 490 | @mouseenter=${(): Promise<void>|undefined => this.#frame?.highlight()} |
Wolfgang Beyer | f0d985e | 2021-02-05 12:56:52 | [diff] [blame] | 491 | @mouseleave=${(): void => SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight()} |
| 492 | @click=${(): Promise<void> => Common.Revealer.reveal(linkTargetDOMNode)} |
| 493 | > |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 494 | <${IconButton.Icon.Icon.litTagName} class="button-icon-with-text" .data=${{ |
Wolfgang Beyer | f0d985e | 2021-02-05 12:56:52 | [diff] [blame] | 495 | iconName: 'elements_panel_icon', |
| 496 | color: 'var(--color-primary)', |
| 497 | width: '16px', |
| 498 | height: '16px', |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 499 | } as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}> |
Jack Franklin | 5ba6ec6 | 2021-04-30 07:36:20 | [diff] [blame] | 500 | <${linkTargetDOMNode.nodeName().toLocaleLowerCase()}> |
Wolfgang Beyer | 09b0e8e | 2021-02-09 13:39:48 | [diff] [blame] | 501 | </button> |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 502 | </${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | f0d985e | 2021-02-05 12:56:52 | [diff] [blame] | 503 | `; |
| 504 | // clang-format on |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 505 | } |
| 506 | } |
| 507 | return LitHtml.nothing; |
| 508 | } |
| 509 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 510 | #maybeRenderCreationStacktrace(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 511 | const creationStackTraceData = this.#frame?.getCreationStackTraceData(); |
Wolfgang Beyer | a20485a | 2021-04-21 07:22:19 | [diff] [blame] | 512 | if (creationStackTraceData && creationStackTraceData.creationStackTrace) { |
Wolfgang Beyer | a036d0c | 2021-03-19 09:09:33 | [diff] [blame] | 513 | // Disabled until https://crbug.com/1079231 is fixed. |
| 514 | // clang-format off |
Wolfgang Beyer | 1909394 | 2021-03-15 15:00:34 | [diff] [blame] | 515 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 516 | <${ReportView.ReportView.ReportKey.litTagName} title=${i18nString(UIStrings.creationStackTraceExplanation)}>${ |
| 517 | i18nString(UIStrings.creationStackTrace)}</${ReportView.ReportView.ReportKey.litTagName}> |
| 518 | <${ReportView.ReportView.ReportValue.litTagName}> |
| 519 | <${StackTrace.litTagName} .data=${{ |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 520 | frame: this.#frame, |
Wolfgang Beyer | a036d0c | 2021-03-19 09:09:33 | [diff] [blame] | 521 | buildStackTraceRows: Components.JSPresentationUtils.buildStackTraceRows, |
| 522 | } as StackTraceData}> |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 523 | </${StackTrace.litTagName}> |
| 524 | </${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | 1909394 | 2021-03-15 15:00:34 | [diff] [blame] | 525 | `; |
Wolfgang Beyer | a036d0c | 2021-03-19 09:09:33 | [diff] [blame] | 526 | // clang-format on |
Wolfgang Beyer | 1909394 | 2021-03-15 15:00:34 | [diff] [blame] | 527 | } |
| 528 | return LitHtml.nothing; |
| 529 | } |
| 530 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 531 | #getAdFrameTypeStrings(type: Protocol.Page.AdFrameType.Child|Protocol.Page.AdFrameType.Root): |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 532 | {value: Platform.UIString.LocalizedString, description: Platform.UIString.LocalizedString} { |
| 533 | switch (type) { |
| 534 | case Protocol.Page.AdFrameType.Child: |
| 535 | return {value: i18nString(UIStrings.child), description: i18nString(UIStrings.childDescription)}; |
| 536 | case Protocol.Page.AdFrameType.Root: |
| 537 | return {value: i18nString(UIStrings.root), description: i18nString(UIStrings.rootDescription)}; |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 538 | } |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 539 | } |
| 540 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 541 | #getAdFrameExplanationString(explanation: Protocol.Page.AdFrameExplanation): Platform.UIString.LocalizedString { |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 542 | switch (explanation) { |
| 543 | case Protocol.Page.AdFrameExplanation.CreatedByAdScript: |
| 544 | return i18nString(UIStrings.createdByAdScriptExplanation); |
| 545 | case Protocol.Page.AdFrameExplanation.MatchedBlockingRule: |
| 546 | return i18nString(UIStrings.matchedBlockingRuleExplanation); |
| 547 | case Protocol.Page.AdFrameExplanation.ParentIsAd: |
| 548 | return i18nString(UIStrings.parentIsAdExplanation); |
| 549 | } |
| 550 | } |
| 551 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 552 | #maybeRenderAdStatus(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 553 | if (!this.#frame) { |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 554 | return LitHtml.nothing; |
| 555 | } |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 556 | const adFrameType = this.#frame.adFrameType(); |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 557 | if (adFrameType === Protocol.Page.AdFrameType.None) { |
| 558 | return LitHtml.nothing; |
| 559 | } |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 560 | const typeStrings = this.#getAdFrameTypeStrings(adFrameType); |
Jack Franklin | a31102b | 2021-12-03 15:01:22 | [diff] [blame] | 561 | const rows = [LitHtml.html`<div title=${typeStrings.description}>${typeStrings.value}</div>`]; |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 562 | for (const explanation of this.#frame.adFrameStatus()?.explanations || []) { |
| 563 | rows.push(LitHtml.html`<div>${this.#getAdFrameExplanationString(explanation)}</div>`); |
Sigurd Schneider | cc9a02e | 2021-06-16 06:20:33 | [diff] [blame] | 564 | } |
| 565 | return LitHtml.html` |
| 566 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.adStatus)}</${ |
| 567 | ReportView.ReportView.ReportKey.litTagName}> |
| 568 | <${ReportView.ReportView.ReportValue.litTagName}> |
| 569 | <${ExpandableList.ExpandableList.ExpandableList.litTagName} .data=${ |
| 570 | {rows} as ExpandableList.ExpandableList.ExpandableListData}></${ |
| 571 | ExpandableList.ExpandableList.ExpandableList.litTagName}></${ReportView.ReportView.ReportValue.litTagName}> |
| 572 | `; |
Wolfgang Beyer | 1525b1f | 2021-02-02 14:12:30 | [diff] [blame] | 573 | } |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 574 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 575 | #renderIsolationSection(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 576 | if (!this.#frame) { |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 577 | return LitHtml.nothing; |
| 578 | } |
| 579 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 580 | <${ReportView.ReportView.ReportSectionHeader.litTagName}>${i18nString(UIStrings.securityIsolation)}</${ |
| 581 | ReportView.ReportView.ReportSectionHeader.litTagName}> |
| 582 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.secureContext)}</${ |
| 583 | ReportView.ReportView.ReportKey.litTagName}> |
| 584 | <${ReportView.ReportView.ReportValue.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 585 | ${this.#frame.isSecureContext() ? i18nString(UIStrings.yes) : i18nString(UIStrings.no)}\xA0${ |
| 586 | this.#maybeRenderSecureContextExplanation()} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 587 | </${ReportView.ReportView.ReportValue.litTagName}> |
| 588 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.crossoriginIsolated)}</${ |
| 589 | ReportView.ReportView.ReportKey.litTagName}> |
| 590 | <${ReportView.ReportView.ReportValue.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 591 | ${this.#frame.isCrossOriginIsolated() ? i18nString(UIStrings.yes) : i18nString(UIStrings.no)} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 592 | </${ReportView.ReportView.ReportValue.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 593 | ${LitHtml.Directives.until(this.#maybeRenderCoopCoepStatus(), LitHtml.nothing)} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 594 | <${ReportView.ReportView.ReportSectionDivider.litTagName}></${ |
| 595 | ReportView.ReportView.ReportSectionDivider.litTagName}> |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 596 | `; |
| 597 | } |
| 598 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 599 | #maybeRenderSecureContextExplanation(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 600 | const explanation = this.#getSecureContextExplanation(); |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 601 | if (explanation) { |
Tim van der Lippe | 0005b80 | 2021-06-03 10:47:59 | [diff] [blame] | 602 | return LitHtml.html`<span class="inline-comment">${explanation}</span>`; |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 603 | } |
| 604 | return LitHtml.nothing; |
| 605 | } |
| 606 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 607 | #getSecureContextExplanation(): Platform.UIString.LocalizedString|null { |
| 608 | switch (this.#frame?.getSecureContextType()) { |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 609 | case Protocol.Page.SecureContextType.Secure: |
| 610 | return null; |
| 611 | case Protocol.Page.SecureContextType.SecureLocalhost: |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 612 | return i18nString(UIStrings.localhostIsAlwaysASecureContext); |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 613 | case Protocol.Page.SecureContextType.InsecureAncestor: |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 614 | return i18nString(UIStrings.aFrameAncestorIsAnInsecure); |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 615 | case Protocol.Page.SecureContextType.InsecureScheme: |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 616 | return i18nString(UIStrings.theFramesSchemeIsInsecure); |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 617 | } |
| 618 | return null; |
| 619 | } |
| 620 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 621 | async #maybeRenderCoopCoepStatus(): Promise<LitHtml.LitTemplate> { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 622 | if (this.#frame) { |
| 623 | const model = this.#frame.resourceTreeModel().target().model(SDK.NetworkManager.NetworkManager); |
| 624 | const info = model && await model.getSecurityIsolationStatus(this.#frame.id); |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 625 | if (info) { |
| 626 | return LitHtml.html` |
| 627 | ${ |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 628 | this.#maybeRenderCrossOriginStatus( |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 629 | info.coep, i18n.i18n.lockedString('Cross-Origin Embedder Policy (COEP)'), |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 630 | Protocol.Network.CrossOriginEmbedderPolicyValue.None)} |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 631 | ${ |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 632 | this.#maybeRenderCrossOriginStatus( |
Wolfgang Beyer | dbf211e | 2021-11-23 10:23:54 | [diff] [blame] | 633 | info.coop, i18n.i18n.lockedString('Cross-Origin Opener Policy (COOP)'), |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 634 | Protocol.Network.CrossOriginOpenerPolicyValue.UnsafeNone)} |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 635 | `; |
| 636 | } |
| 637 | } |
| 638 | return LitHtml.nothing; |
| 639 | } |
| 640 | |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 641 | #maybeRenderCrossOriginStatus( |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 642 | info: Protocol.Network.CrossOriginEmbedderPolicyStatus|Protocol.Network.CrossOriginOpenerPolicyStatus|undefined, |
| 643 | policyName: string, |
| 644 | noneValue: Protocol.Network.CrossOriginEmbedderPolicyValue| |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 645 | Protocol.Network.CrossOriginOpenerPolicyValue): LitHtml.LitTemplate { |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 646 | if (!info) { |
| 647 | return LitHtml.nothing; |
| 648 | } |
| 649 | const isEnabled = info.value !== noneValue; |
| 650 | const isReportOnly = (!isEnabled && info.reportOnlyValue !== noneValue); |
| 651 | const endpoint = isEnabled ? info.reportingEndpoint : info.reportOnlyReportingEndpoint; |
| 652 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 653 | <${ReportView.ReportView.ReportKey.litTagName}>${policyName}</${ReportView.ReportView.ReportKey.litTagName}> |
| 654 | <${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 655 | ${isEnabled ? info.value : info.reportOnlyValue} |
| 656 | ${isReportOnly ? LitHtml.html`<span class="inline-comment">report-only</span>` : LitHtml.nothing} |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 657 | ${ |
| 658 | endpoint ? LitHtml.html`<span class="inline-name">${i18nString(UIStrings.reportingTo)}</span>${endpoint}` : |
| 659 | LitHtml.nothing} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 660 | </${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | abfc847 | 2021-02-04 11:29:50 | [diff] [blame] | 661 | `; |
| 662 | } |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 663 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 664 | #renderApiAvailabilitySection(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 665 | if (!this.#frame) { |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 666 | return LitHtml.nothing; |
| 667 | } |
| 668 | |
| 669 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 670 | <${ReportView.ReportView.ReportSectionHeader.litTagName}>${i18nString(UIStrings.apiAvailability)}</${ |
| 671 | ReportView.ReportView.ReportSectionHeader.litTagName}> |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 672 | <div class="span-cols"> |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 673 | ${i18nString(UIStrings.availabilityOfCertainApisDepends)} |
Wolfgang Beyer | 4751c1c | 2021-03-24 15:32:35 | [diff] [blame] | 674 | <x-link href="https://web.dev/why-coop-coep/" class="link">${i18nString(UIStrings.learnMore)}</x-link> |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 675 | </div> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 676 | ${this.#renderSharedArrayBufferAvailability()} |
| 677 | ${this.#renderMeasureMemoryAvailability()} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 678 | <${ReportView.ReportView.ReportSectionDivider.litTagName}></${ |
| 679 | ReportView.ReportView.ReportSectionDivider.litTagName}> |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 680 | `; |
| 681 | } |
| 682 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 683 | #renderSharedArrayBufferAvailability(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 684 | if (this.#frame) { |
| 685 | const features = this.#frame.getGatedAPIFeatures(); |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 686 | if (features) { |
| 687 | const sabAvailable = features.includes(Protocol.Page.GatedAPIFeatures.SharedArrayBuffers); |
| 688 | const sabTransferAvailable = |
| 689 | sabAvailable && features.includes(Protocol.Page.GatedAPIFeatures.SharedArrayBuffersTransferAllowed); |
| 690 | const availabilityText = sabTransferAvailable ? |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 691 | i18nString(UIStrings.availableTransferable) : |
| 692 | (sabAvailable ? i18nString(UIStrings.availableNotTransferable) : i18nString(UIStrings.unavailable)); |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 693 | const tooltipText = sabTransferAvailable ? |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 694 | i18nString(UIStrings.sharedarraybufferConstructorIs) : |
| 695 | (sabAvailable ? i18nString(UIStrings.sharedarraybufferConstructorIsAvailable) : ''); |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 696 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 697 | function renderHint(frame: SDK.ResourceTreeModel.ResourceTreeFrame): LitHtml.LitTemplate { |
Sigurd Schneider | 2a45025 | 2021-05-04 07:13:15 | [diff] [blame] | 698 | switch (frame.getCrossOriginIsolatedContextType()) { |
| 699 | case Protocol.Page.CrossOriginIsolatedContextType.Isolated: |
| 700 | return LitHtml.nothing; |
| 701 | case Protocol.Page.CrossOriginIsolatedContextType.NotIsolated: |
| 702 | if (sabAvailable) { |
| 703 | return LitHtml.html`<span class="inline-comment">${ |
| 704 | i18nString(UIStrings.willRequireCrossoriginIsolated)}</span>`; |
| 705 | } |
| 706 | return LitHtml.html`<span class="inline-comment">${ |
| 707 | i18nString(UIStrings.requiresCrossoriginIsolated)}</span>`; |
| 708 | case Protocol.Page.CrossOriginIsolatedContextType.NotIsolatedFeatureDisabled: |
| 709 | if (!sabTransferAvailable) { |
| 710 | return LitHtml.html`<span class="inline-comment">${ |
| 711 | i18nString( |
| 712 | UIStrings |
| 713 | .transferRequiresCrossoriginIsolatedPermission)} <code>cross-origin-isolated</code></span>`; |
| 714 | } |
| 715 | break; |
| 716 | } |
| 717 | return LitHtml.nothing; |
| 718 | } |
| 719 | |
Peter Marshall | 0e1cd82 | 2021-02-24 10:52:42 | [diff] [blame] | 720 | // SharedArrayBuffer is an API name, so we don't translate it. |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 721 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 722 | <${ReportView.ReportView.ReportKey.litTagName}>SharedArrayBuffers</${ |
| 723 | ReportView.ReportView.ReportKey.litTagName}> |
| 724 | <${ReportView.ReportView.ReportValue.litTagName} title=${tooltipText}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 725 | ${availabilityText}\xA0${renderHint(this.#frame)} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 726 | </${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 727 | `; |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 728 | } |
| 729 | } |
| 730 | return LitHtml.nothing; |
| 731 | } |
| 732 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 733 | #renderMeasureMemoryAvailability(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 734 | if (this.#frame) { |
| 735 | const measureMemoryAvailable = this.#frame.isCrossOriginIsolated(); |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 736 | const availabilityText = |
| 737 | measureMemoryAvailable ? i18nString(UIStrings.available) : i18nString(UIStrings.unavailable); |
| 738 | const tooltipText = measureMemoryAvailable ? i18nString(UIStrings.thePerformanceAPI) : |
| 739 | i18nString(UIStrings.thePerformancemeasureuseragentspecificmemory); |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 740 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 741 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.measureMemory)}</${ |
| 742 | ReportView.ReportView.ReportKey.litTagName}> |
| 743 | <${ReportView.ReportView.ReportValue.litTagName}> |
Tim van der Lippe | 0005b80 | 2021-06-03 10:47:59 | [diff] [blame] | 744 | <span title=${tooltipText}>${ |
| 745 | availabilityText}</span>\xA0<x-link class="link" href="https://web.dev/monitor-total-page-memory-usage/">${ |
Wolfgang Beyer | 09b0e8e | 2021-02-09 13:39:48 | [diff] [blame] | 746 | i18nString(UIStrings.learnMore)}</x-link> |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 747 | </${ReportView.ReportView.ReportValue.litTagName}> |
Wolfgang Beyer | 6a6efe6 | 2021-02-04 15:56:21 | [diff] [blame] | 748 | `; |
| 749 | } |
| 750 | return LitHtml.nothing; |
| 751 | } |
Wolfgang Beyer | e5d1a9f | 2021-02-05 09:42:43 | [diff] [blame] | 752 | |
Jack Franklin | d750830 | 2022-05-09 14:22:21 | [diff] [blame^] | 753 | #renderAdditionalInfoSection(): LitHtml.LitTemplate { |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 754 | if (!this.#frame) { |
Wolfgang Beyer | e5d1a9f | 2021-02-05 09:42:43 | [diff] [blame] | 755 | return LitHtml.nothing; |
| 756 | } |
| 757 | |
| 758 | return LitHtml.html` |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 759 | <${ReportView.ReportView.ReportSectionHeader.litTagName} |
Vidal Guillermo Diazleal Ortega | 0a997bb | 2021-02-09 04:33:01 | [diff] [blame] | 760 | title=${i18nString(UIStrings.thisAdditionalDebugging)} |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 761 | >${i18nString(UIStrings.additionalInformation)}</${ReportView.ReportView.ReportSectionHeader.litTagName}> |
| 762 | <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.frameId)}</${ |
| 763 | ReportView.ReportView.ReportKey.litTagName}> |
| 764 | <${ReportView.ReportView.ReportValue.litTagName}> |
Tim van der Lippe | c3f835a | 2021-12-15 13:28:32 | [diff] [blame] | 765 | <div class="text-ellipsis" title=${this.#frame.id}>${this.#frame.id}</div> |
Kriti Sapra | 7491545 | 2021-05-13 11:57:36 | [diff] [blame] | 766 | </${ReportView.ReportView.ReportValue.litTagName}> |
| 767 | <${ReportView.ReportView.ReportSectionDivider.litTagName}></${ |
| 768 | ReportView.ReportView.ReportSectionDivider.litTagName}> |
Wolfgang Beyer | e5d1a9f | 2021-02-05 09:42:43 | [diff] [blame] | 769 | `; |
| 770 | } |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 771 | } |
| 772 | |
Kriti Sapra | 34df98d | 2021-05-06 10:15:42 | [diff] [blame] | 773 | ComponentHelpers.CustomElements.defineComponent('devtools-resources-frame-details-view', FrameDetailsReportView); |
Wolfgang Beyer | 92395c9 | 2021-02-02 10:43:23 | [diff] [blame] | 774 | |
| 775 | declare global { |
| 776 | // eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 777 | interface HTMLElementTagNameMap { |
| 778 | 'devtools-resources-frame-details-view': FrameDetailsReportView; |
| 779 | } |
| 780 | } |