chrome-devtools-frontend 1.0.1543082 → 1.0.1544076
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.
- package/AUTHORS +2 -0
- package/front_end/core/common/Gzip.ts +4 -4
- package/front_end/core/common/common.ts +0 -2
- package/front_end/core/host/AidaClient.ts +10 -7
- package/front_end/core/host/DispatchHttpRequestClient.ts +18 -3
- package/front_end/core/root/DevToolsContext.ts +60 -0
- package/front_end/core/root/Runtime.ts +8 -7
- package/front_end/core/root/root.ts +6 -1
- package/front_end/core/sdk/CPUThrottlingManager.ts +0 -4
- package/front_end/core/sdk/CSSMatchedStyles.ts +7 -9
- package/front_end/core/sdk/CSSModel.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +18 -6
- package/front_end/core/sdk/ChildTargetManager.ts +2 -2
- package/front_end/core/sdk/TargetManager.ts +5 -6
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +2 -0
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -13
- package/front_end/entrypoints/main/MainImpl.ts +2 -20
- package/front_end/foundation/Universe.ts +24 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -8
- package/front_end/models/ai_assistance/agents/PatchAgent.ts +7 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +0 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +4 -8
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +1 -1
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +5 -3
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +8 -7
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -15
- package/front_end/models/bindings/ResourceMapping.ts +57 -15
- package/front_end/models/live-metrics/LiveMetrics.ts +12 -20
- package/front_end/models/trace/handlers/SamplesHandler.ts +64 -6
- package/front_end/models/trace/types/TraceEvents.ts +16 -0
- package/front_end/models/workspace/IgnoreListManager.ts +10 -9
- package/front_end/models/workspace/WorkspaceImpl.ts +5 -10
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +6 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -4
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +2 -1
- package/front_end/panels/animation/AnimationTimeline.ts +6 -6
- package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -1
- package/front_end/panels/application/OpenedWindowDetailsView.ts +0 -2
- package/front_end/panels/application/ServiceWorkersView.ts +0 -2
- package/front_end/panels/application/StorageView.ts +0 -1
- package/front_end/panels/application/components/FrameDetailsView.ts +468 -447
- package/front_end/panels/application/components/ReportsGrid.ts +7 -2
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -3
- package/front_end/panels/application/components/TrustTokensView.ts +7 -1
- package/front_end/panels/application/preloading/PreloadingView.ts +10 -4
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +7 -11
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +15 -3
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +12 -13
- package/front_end/panels/{elements → common}/DOMLinkifier.ts +6 -6
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleView.ts +9 -7
- package/front_end/panels/console/ConsoleViewMessage.ts +23 -13
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +52 -15
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +24 -14
- package/front_end/panels/elements/elements-meta.ts +11 -2
- package/front_end/panels/elements/elements.ts +0 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +333 -318
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -1
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +2 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +7 -1
- package/front_end/panels/settings/SettingsScreen.ts +3 -6
- package/front_end/panels/settings/components/SyncSection.ts +218 -226
- package/front_end/panels/settings/components/syncSection.css +81 -80
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +42 -294
- package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +3 -1
- package/front_end/panels/sources/ResourceOriginPlugin.ts +7 -3
- package/front_end/panels/sources/SourcesPanel.ts +5 -1
- package/front_end/panels/timeline/TimelinePanel.ts +0 -21
- package/front_end/panels/timeline/TimelineUIUtils.ts +3 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +7 -4
- package/front_end/panels/timeline/components/insights/NodeLink.ts +3 -2
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +34 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkEventManager.ts +16 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +28 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/docs/component_docs.ts +0 -4
- package/front_end/ui/components/report_view/ReportView.ts +4 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -5
- package/front_end/ui/i18n/i18n.ts +16 -0
- package/front_end/ui/legacy/ReportView.ts +0 -5
- package/front_end/ui/legacy/TextPrompt.ts +65 -19
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +56 -25
- package/front_end/ui/legacy/XLink.ts +0 -2
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +8 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +239 -284
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +114 -184
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +0 -4
- package/front_end/ui/{components/docs/theme_colors/basic.ts → legacy/theme_support/ThemeColors.docs.ts} +33 -23
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/core/common/QueryParamHandler.ts +0 -7
- package/front_end/ui/components/docs/input/basic.html +0 -31
- package/front_end/ui/components/docs/input/basic.ts +0 -12
- package/front_end/ui/components/docs/report/basic.html +0 -27
- package/front_end/ui/components/docs/report/basic.ts +0 -48
- package/front_end/ui/components/docs/theme_colors/basic.html +0 -56
- package/front_end/ui/components/docs/toggle_dark_mode.ts +0 -36
- package/front_end/ui/components/docs/toggle_fonts.ts +0 -74
- package/front_end/ui/components/docs/user_agent_client_hints/basic.html +0 -25
- package/front_end/ui/components/docs/user_agent_client_hints/basic.ts +0 -26
- package/front_end/ui/components/expandable_list/ExpandableList.docs.ts +0 -30
- /package/front_end/panels/{elements → common}/domLinkifier.css +0 -0
|
@@ -9,7 +9,7 @@ import './StackTrace.js';
|
|
|
9
9
|
|
|
10
10
|
import * as Common from '../../../core/common/common.js';
|
|
11
11
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
12
|
-
import * as Platform from '../../../core/platform/platform.js';
|
|
12
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
|
13
13
|
import * as Root from '../../../core/root/root.js';
|
|
14
14
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
15
15
|
import * as Protocol from '../../../generated/protocol.js';
|
|
@@ -24,7 +24,7 @@ import * as RenderCoordinator from '../../../ui/components/render_coordinator/re
|
|
|
24
24
|
import type * as ReportView from '../../../ui/components/report_view/report_view.js';
|
|
25
25
|
import * as Components from '../../../ui/legacy/components/utils/utils.js';
|
|
26
26
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
27
|
-
import
|
|
27
|
+
import {Directives, html, type LitTemplate, nothing, render} from '../../../ui/lit/lit.js';
|
|
28
28
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
|
29
29
|
|
|
30
30
|
import frameDetailsReportViewStyles from './frameDetailsReportView.css.js';
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from './PermissionsPolicySection.js';
|
|
36
36
|
import type {StackTraceData} from './StackTrace.js';
|
|
37
37
|
|
|
38
|
-
const {
|
|
38
|
+
const {until} = Directives;
|
|
39
39
|
const {widgetConfig} = UI.Widget;
|
|
40
40
|
|
|
41
41
|
const UIStrings = {
|
|
@@ -278,85 +278,50 @@ export interface FrameDetailsReportViewData {
|
|
|
278
278
|
adScriptAncestry: Protocol.Page.AdScriptAncestry|null;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
281
|
+
interface FrameDetailsViewInput {
|
|
282
|
+
frame: SDK.ResourceTreeModel.ResourceTreeFrame;
|
|
283
|
+
target: SDK.Target.Target|null;
|
|
284
|
+
adScriptAncestry: Protocol.Page.AdScriptAncestry|null;
|
|
285
|
+
linkTargetDOMNode?: Promise<SDK.DOMModel.DOMNode|null>;
|
|
286
|
+
permissionsPolicies: Promise<Protocol.Page.PermissionsPolicyFeatureState[]|null>|null;
|
|
287
|
+
protocolMonitorExperimentEnabled: boolean;
|
|
288
|
+
trials: Protocol.Page.OriginTrial[]|null;
|
|
289
|
+
securityIsolationInfo?: Promise<Protocol.Network.SecurityIsolationStatus|null>;
|
|
290
|
+
onRevealInSources: () => void;
|
|
291
|
+
}
|
|
290
292
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
void this.render();
|
|
293
|
+
function renderFrameDetailsView(input: FrameDetailsViewInput, target: ShadowRoot): void {
|
|
294
|
+
if (!input.frame) {
|
|
295
|
+
return;
|
|
295
296
|
}
|
|
297
|
+
// clang-format off
|
|
298
|
+
render(html`
|
|
299
|
+
<style>${frameDetailsReportViewStyles}</style>
|
|
300
|
+
<devtools-report .data=${{reportTitle: input.frame.displayName()} as ReportView.ReportView.ReportData}
|
|
301
|
+
jslog=${VisualLogging.pane('frames')}>
|
|
302
|
+
${renderDocumentSection(input)}
|
|
303
|
+
${renderIsolationSection(input)}
|
|
304
|
+
${renderApiAvailabilitySection(input.frame)}
|
|
305
|
+
${renderOriginTrial(input.trials)}
|
|
306
|
+
${until(input.permissionsPolicies?.then?.(policies =>
|
|
307
|
+
html`
|
|
308
|
+
<devtools-resources-permissions-policy-section .data=${{policies, showDetails: false} as PermissionsPolicySectionData}>
|
|
309
|
+
</devtools-resources-permissions-policy-section>
|
|
310
|
+
`), nothing)}
|
|
311
|
+
${input.protocolMonitorExperimentEnabled ? renderAdditionalInfoSection(input.frame) : nothing}
|
|
312
|
+
</devtools-report>
|
|
313
|
+
`, target);
|
|
314
|
+
// clang-format on
|
|
315
|
+
}
|
|
296
316
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
override async render(): Promise<void> {
|
|
303
|
-
const result = await this.#frame?.parentFrame()?.getAdScriptAncestry(this.#frame?.id);
|
|
304
|
-
if (result && result.ancestryChain.length > 0) {
|
|
305
|
-
this.#adScriptAncestry = result;
|
|
306
|
-
|
|
307
|
-
// Obtain the Target associated with the first ad script, because in most scenarios all
|
|
308
|
-
// scripts share the same debuggerId. However, discrepancies might arise when content scripts
|
|
309
|
-
// from browser extensions are involved. We will monitor the debugging experiences and revisit
|
|
310
|
-
// this approach if it proves problematic.
|
|
311
|
-
const firstScript = this.#adScriptAncestry.ancestryChain[0];
|
|
312
|
-
const debuggerModel = firstScript?.debuggerId ?
|
|
313
|
-
await SDK.DebuggerModel.DebuggerModel.modelForDebuggerId(firstScript.debuggerId) :
|
|
314
|
-
null;
|
|
315
|
-
this.#target = debuggerModel?.target() ?? null;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
if (!this.#permissionsPolicies && this.#frame) {
|
|
319
|
-
this.#permissionsPolicies = this.#frame.getPermissionsPolicyState();
|
|
320
|
-
}
|
|
321
|
-
await RenderCoordinator.write('FrameDetailsView render', async () => {
|
|
322
|
-
if (!this.#frame) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
327
|
-
// clang-format off
|
|
328
|
-
Lit.render(html`
|
|
329
|
-
<style>${frameDetailsReportViewStyles}</style>
|
|
330
|
-
<devtools-report .data=${{reportTitle: this.#frame.displayName()} as ReportView.ReportView.ReportData}
|
|
331
|
-
jslog=${VisualLogging.pane('frames')}>
|
|
332
|
-
${this.#renderDocumentSection()}
|
|
333
|
-
${this.#renderIsolationSection()}
|
|
334
|
-
${this.#renderApiAvailabilitySection()}
|
|
335
|
-
${await this.#renderOriginTrial()}
|
|
336
|
-
${Lit.Directives.until(this.#permissionsPolicies?.then(policies => {
|
|
337
|
-
this.#permissionsPolicySectionData.policies = policies || [];
|
|
338
|
-
return html`
|
|
339
|
-
<devtools-resources-permissions-policy-section
|
|
340
|
-
.data=${this.#permissionsPolicySectionData}
|
|
341
|
-
>
|
|
342
|
-
</devtools-resources-permissions-policy-section>
|
|
343
|
-
`;
|
|
344
|
-
}), Lit.nothing)}
|
|
345
|
-
${this.#protocolMonitorExperimentEnabled ? this.#renderAdditionalInfoSection() : Lit.nothing}
|
|
346
|
-
</devtools-report>
|
|
347
|
-
`, this.#shadow, {host: this});
|
|
348
|
-
// clang-format on
|
|
349
|
-
});
|
|
317
|
+
function renderOriginTrial(trials: Protocol.Page.OriginTrial[]|null): LitTemplate {
|
|
318
|
+
if (!trials) {
|
|
319
|
+
return nothing;
|
|
350
320
|
}
|
|
351
321
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
const data = {trials: await this.#frame.getOriginTrials()};
|
|
358
|
-
// clang-format off
|
|
359
|
-
return html`
|
|
322
|
+
const data = {trials};
|
|
323
|
+
// clang-format off
|
|
324
|
+
return html`
|
|
360
325
|
<devtools-report-section-header>
|
|
361
326
|
${i18n.i18n.lockedString('Origin trials')}
|
|
362
327
|
</devtools-report-section-header>
|
|
@@ -372,166 +337,146 @@ export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.Wrappabl
|
|
|
372
337
|
<devtools-widget class="span-cols" .widgetConfig=${widgetConfig(OriginTrialTreeView, {data})}>
|
|
373
338
|
</devtools-widget>
|
|
374
339
|
<devtools-report-divider></devtools-report-divider>`;
|
|
375
|
-
|
|
376
|
-
|
|
340
|
+
// clang-format on
|
|
341
|
+
}
|
|
377
342
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
343
|
+
function renderDocumentSection(input: FrameDetailsViewInput): LitTemplate {
|
|
344
|
+
if (!input.frame) {
|
|
345
|
+
return nothing;
|
|
346
|
+
}
|
|
382
347
|
|
|
383
|
-
|
|
348
|
+
return html`
|
|
384
349
|
<devtools-report-section-header>${i18nString(UIStrings.document)}</devtools-report-section-header>
|
|
385
350
|
<devtools-report-key>${i18nString(UIStrings.url)}</devtools-report-key>
|
|
386
351
|
<devtools-report-value>
|
|
387
352
|
<div class="inline-items">
|
|
388
|
-
${
|
|
389
|
-
${
|
|
390
|
-
<div class="text-ellipsis" title=${
|
|
353
|
+
${maybeRenderSourcesLinkForURL(input.frame, input.onRevealInSources)}
|
|
354
|
+
${maybeRenderNetworkLinkForURL(input.frame)}
|
|
355
|
+
<div class="text-ellipsis" title=${input.frame.url}>${input.frame.url}</div>
|
|
391
356
|
</div>
|
|
392
357
|
</devtools-report-value>
|
|
393
|
-
${
|
|
394
|
-
${
|
|
395
|
-
${
|
|
396
|
-
${
|
|
397
|
-
${
|
|
398
|
-
${
|
|
358
|
+
${maybeRenderUnreachableURL(input.frame)}
|
|
359
|
+
${maybeRenderOrigin(input.frame)}
|
|
360
|
+
${until(input.linkTargetDOMNode?.then?.(value => renderOwnerElement(input.frame, value)), nothing)}
|
|
361
|
+
${maybeRenderCreationStacktrace(input.frame)}
|
|
362
|
+
${maybeRenderAdStatus(input.frame)}
|
|
363
|
+
${maybeRenderCreatorAdScriptAncestry(input.frame, input.target, input.adScriptAncestry)}
|
|
399
364
|
<devtools-report-divider></devtools-report-divider>
|
|
400
365
|
`;
|
|
401
|
-
|
|
366
|
+
}
|
|
402
367
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
return renderIconLink(
|
|
409
|
-
'label',
|
|
410
|
-
i18nString(UIStrings.clickToOpenInSourcesPanel),
|
|
411
|
-
async () => {
|
|
412
|
-
const sourceCode = this.#uiSourceCodeForFrame(frame);
|
|
413
|
-
if (sourceCode) {
|
|
414
|
-
await Common.Revealer.reveal(sourceCode);
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
'reveal-in-sources',
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
#maybeRenderNetworkLinkForURL(): Lit.LitTemplate {
|
|
422
|
-
if (this.#frame) {
|
|
423
|
-
const resource = this.#frame.resourceForURL(this.#frame.url);
|
|
424
|
-
if (resource?.request) {
|
|
425
|
-
const request = resource.request;
|
|
426
|
-
return renderIconLink('arrow-up-down-circle', i18nString(UIStrings.clickToOpenInNetworkPanel), () => {
|
|
427
|
-
const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
428
|
-
request, NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT);
|
|
429
|
-
return Common.Revealer.reveal(requestLocation);
|
|
430
|
-
}, 'reveal-in-network');
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
return Lit.nothing;
|
|
368
|
+
function maybeRenderSourcesLinkForURL(
|
|
369
|
+
frame: SDK.ResourceTreeModel.ResourceTreeFrame|null, onRevealInSources: () => void): LitTemplate {
|
|
370
|
+
if (!frame || frame.unreachableUrl()) {
|
|
371
|
+
return nothing;
|
|
434
372
|
}
|
|
373
|
+
return renderIconLink(
|
|
374
|
+
'label',
|
|
375
|
+
i18nString(UIStrings.clickToOpenInSourcesPanel),
|
|
376
|
+
onRevealInSources,
|
|
377
|
+
'reveal-in-sources',
|
|
378
|
+
);
|
|
379
|
+
}
|
|
435
380
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
381
|
+
function maybeRenderNetworkLinkForURL(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
382
|
+
if (frame) {
|
|
383
|
+
const resource = frame.resourceForURL(frame.url);
|
|
384
|
+
if (resource?.request) {
|
|
385
|
+
const request = resource.request;
|
|
386
|
+
return renderIconLink('arrow-up-down-circle', i18nString(UIStrings.clickToOpenInNetworkPanel), () => {
|
|
387
|
+
const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
388
|
+
request, NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT);
|
|
389
|
+
return Common.Revealer.reveal(requestLocation);
|
|
390
|
+
}, 'reveal-in-network');
|
|
445
391
|
}
|
|
446
|
-
return null;
|
|
447
392
|
}
|
|
393
|
+
return nothing;
|
|
394
|
+
}
|
|
448
395
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
396
|
+
function maybeRenderUnreachableURL(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
397
|
+
if (!frame?.unreachableUrl()) {
|
|
398
|
+
return nothing;
|
|
399
|
+
}
|
|
400
|
+
return html`
|
|
454
401
|
<devtools-report-key>${i18nString(UIStrings.unreachableUrl)}</devtools-report-key>
|
|
455
402
|
<devtools-report-value>
|
|
456
403
|
<div class="inline-items">
|
|
457
|
-
${
|
|
458
|
-
<div class="text-ellipsis" title=${
|
|
404
|
+
${renderNetworkLinkForUnreachableURL(frame)}
|
|
405
|
+
<div class="text-ellipsis" title=${frame.unreachableUrl()}>${frame.unreachableUrl()}</div>
|
|
459
406
|
</div>
|
|
460
407
|
</devtools-report-value>
|
|
461
408
|
`;
|
|
462
|
-
|
|
409
|
+
}
|
|
463
410
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
411
|
+
function renderNetworkLinkForUnreachableURL(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
412
|
+
if (frame) {
|
|
413
|
+
const unreachableUrl = Common.ParsedURL.ParsedURL.fromString(frame.unreachableUrl());
|
|
414
|
+
if (unreachableUrl) {
|
|
415
|
+
return renderIconLink(
|
|
416
|
+
'arrow-up-down-circle',
|
|
417
|
+
i18nString(UIStrings.clickToOpenInNetworkPanelMight),
|
|
418
|
+
():
|
|
419
|
+
void => {
|
|
420
|
+
void Common.Revealer.reveal(NetworkForward.UIFilter.UIRequestFilter.filters([
|
|
421
|
+
{
|
|
422
|
+
filterType: NetworkForward.UIFilter.FilterType.Domain,
|
|
423
|
+
filterValue: unreachableUrl.domain(),
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
filterType: null,
|
|
427
|
+
filterValue: unreachableUrl.path,
|
|
428
|
+
},
|
|
429
|
+
]));
|
|
430
|
+
},
|
|
431
|
+
'unreachable-url.reveal-in-network',
|
|
432
|
+
);
|
|
487
433
|
}
|
|
488
|
-
return Lit.nothing;
|
|
489
434
|
}
|
|
435
|
+
return nothing;
|
|
436
|
+
}
|
|
490
437
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
438
|
+
function maybeRenderOrigin(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
439
|
+
if (frame?.securityOrigin && frame?.securityOrigin !== '://') {
|
|
440
|
+
return html`
|
|
494
441
|
<devtools-report-key>${i18nString(UIStrings.origin)}</devtools-report-key>
|
|
495
442
|
<devtools-report-value>
|
|
496
|
-
<div class="text-ellipsis" title=${
|
|
443
|
+
<div class="text-ellipsis" title=${frame.securityOrigin}>${frame.securityOrigin}</div>
|
|
497
444
|
</devtools-report-value>
|
|
498
445
|
`;
|
|
499
|
-
}
|
|
500
|
-
return Lit.nothing;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
async #renderOwnerElement(): Promise<Lit.LitTemplate> {
|
|
504
|
-
if (this.#frame) {
|
|
505
|
-
const linkTargetDOMNode = await this.#frame.getOwnerDOMNodeOrDocument();
|
|
506
|
-
if (linkTargetDOMNode) {
|
|
507
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
508
|
-
// clang-format off
|
|
509
|
-
return html`
|
|
510
|
-
<devtools-report-key>${i18nString(UIStrings.ownerElement)}</devtools-report-key>
|
|
511
|
-
<devtools-report-value class="without-min-width">
|
|
512
|
-
<div class="inline-items">
|
|
513
|
-
<button class="link text-link" role="link" tabindex=0 title=${i18nString(UIStrings.clickToOpenInElementsPanel)}
|
|
514
|
-
@mouseenter=${() => this.#frame?.highlight()}
|
|
515
|
-
@mouseleave=${() => SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight()}
|
|
516
|
-
@click=${() => Common.Revealer.reveal(linkTargetDOMNode)}
|
|
517
|
-
jslog=${VisualLogging.action('reveal-in-elements').track({click: true})}
|
|
518
|
-
>
|
|
519
|
-
<${linkTargetDOMNode.nodeName().toLocaleLowerCase()}>
|
|
520
|
-
</button>
|
|
521
|
-
</div>
|
|
522
|
-
</devtools-report-value>
|
|
523
|
-
`;
|
|
524
|
-
// clang-format on
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
return Lit.nothing;
|
|
528
446
|
}
|
|
447
|
+
return nothing;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function renderOwnerElement(
|
|
451
|
+
frame: SDK.ResourceTreeModel.ResourceTreeFrame|null, linkTargetDOMNode: SDK.DOMModel.DOMNode|null): LitTemplate {
|
|
452
|
+
if (linkTargetDOMNode) {
|
|
453
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
454
|
+
// clang-format off
|
|
455
|
+
return html`
|
|
456
|
+
<devtools-report-key>${i18nString(UIStrings.ownerElement)}</devtools-report-key>
|
|
457
|
+
<devtools-report-value class="without-min-width">
|
|
458
|
+
<div class="inline-items">
|
|
459
|
+
<button class="link text-link" role="link" tabindex=0 title=${i18nString(UIStrings.clickToOpenInElementsPanel)}
|
|
460
|
+
@mouseenter=${() => frame?.highlight()}
|
|
461
|
+
@mouseleave=${() => SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight()}
|
|
462
|
+
@click=${() => Common.Revealer.reveal(linkTargetDOMNode)}
|
|
463
|
+
jslog=${VisualLogging.action('reveal-in-elements').track({click: true})}
|
|
464
|
+
>
|
|
465
|
+
<${linkTargetDOMNode.nodeName().toLocaleLowerCase()}>
|
|
466
|
+
</button>
|
|
467
|
+
</div>
|
|
468
|
+
</devtools-report-value>
|
|
469
|
+
`;
|
|
470
|
+
// clang-format on
|
|
471
|
+
}
|
|
472
|
+
return nothing;
|
|
473
|
+
}
|
|
529
474
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
475
|
+
function maybeRenderCreationStacktrace(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
476
|
+
const creationStackTraceData = frame?.getCreationStackTraceData();
|
|
477
|
+
if (creationStackTraceData?.creationStackTrace) {
|
|
478
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
479
|
+
// clang-format off
|
|
535
480
|
return html`
|
|
536
481
|
<devtools-report-key title=${i18nString(UIStrings.creationStackTraceExplanation)}>${
|
|
537
482
|
i18nString(UIStrings.creationStackTrace)}</devtools-report-key>
|
|
@@ -539,54 +484,54 @@ export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.Wrappabl
|
|
|
539
484
|
jslog=${VisualLogging.section('frame-creation-stack-trace')}
|
|
540
485
|
>
|
|
541
486
|
<devtools-resources-stack-trace .data=${{
|
|
542
|
-
frame
|
|
487
|
+
frame,
|
|
543
488
|
buildStackTraceRows: Components.JSPresentationUtils.buildStackTraceRowsForLegacyRuntimeStackTrace,
|
|
544
489
|
} as StackTraceData}>
|
|
545
490
|
</devtools-resources-stack-trace>
|
|
546
491
|
</devtools-report-value>
|
|
547
492
|
`;
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
return Lit.nothing;
|
|
493
|
+
// clang-format on
|
|
551
494
|
}
|
|
495
|
+
return nothing;
|
|
496
|
+
}
|
|
552
497
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
498
|
+
function getAdFrameTypeStrings(type: Protocol.Page.AdFrameType.Child|Protocol.Page.AdFrameType.Root):
|
|
499
|
+
{value: Platform.UIString.LocalizedString, description: Platform.UIString.LocalizedString} {
|
|
500
|
+
switch (type) {
|
|
501
|
+
case Protocol.Page.AdFrameType.Child:
|
|
502
|
+
return {value: i18nString(UIStrings.child), description: i18nString(UIStrings.childDescription)};
|
|
503
|
+
case Protocol.Page.AdFrameType.Root:
|
|
504
|
+
return {value: i18nString(UIStrings.root), description: i18nString(UIStrings.rootDescription)};
|
|
561
505
|
}
|
|
506
|
+
}
|
|
562
507
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}
|
|
508
|
+
function getAdFrameExplanationString(explanation: Protocol.Page.AdFrameExplanation): Platform.UIString.LocalizedString {
|
|
509
|
+
switch (explanation) {
|
|
510
|
+
case Protocol.Page.AdFrameExplanation.CreatedByAdScript:
|
|
511
|
+
return i18nString(UIStrings.createdByAdScriptExplanation);
|
|
512
|
+
case Protocol.Page.AdFrameExplanation.MatchedBlockingRule:
|
|
513
|
+
return i18nString(UIStrings.matchedBlockingRuleExplanation);
|
|
514
|
+
case Protocol.Page.AdFrameExplanation.ParentIsAd:
|
|
515
|
+
return i18nString(UIStrings.parentIsAdExplanation);
|
|
572
516
|
}
|
|
517
|
+
}
|
|
573
518
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
519
|
+
function maybeRenderAdStatus(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
520
|
+
if (!frame) {
|
|
521
|
+
return nothing;
|
|
522
|
+
}
|
|
523
|
+
const adFrameType = frame.adFrameType();
|
|
524
|
+
if (adFrameType === Protocol.Page.AdFrameType.None) {
|
|
525
|
+
return nothing;
|
|
526
|
+
}
|
|
527
|
+
const typeStrings = getAdFrameTypeStrings(adFrameType);
|
|
528
|
+
const rows = [html`<div title=${typeStrings.description}>${typeStrings.value}</div>`];
|
|
529
|
+
for (const explanation of frame.adFrameStatus()?.explanations || []) {
|
|
530
|
+
rows.push(html`<div>${getAdFrameExplanationString(explanation)}</div>`);
|
|
531
|
+
}
|
|
587
532
|
|
|
588
|
-
|
|
589
|
-
|
|
533
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
534
|
+
// clang-format off
|
|
590
535
|
return html`
|
|
591
536
|
<devtools-report-key>${i18nString(UIStrings.adStatus)}</devtools-report-key>
|
|
592
537
|
<devtools-report-value class="ad-status-list" jslog=${VisualLogging.section('ad-status')}>
|
|
@@ -594,40 +539,39 @@ export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.Wrappabl
|
|
|
594
539
|
{rows, title: i18nString(UIStrings.adStatus)} as ExpandableList.ExpandableList.ExpandableListData}>
|
|
595
540
|
</devtools-expandable-list>
|
|
596
541
|
</devtools-report-value>`;
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
#maybeRenderCreatorAdScriptAncestry(): Lit.LitTemplate {
|
|
601
|
-
if (!this.#frame) {
|
|
602
|
-
return Lit.nothing;
|
|
603
|
-
}
|
|
604
|
-
const adFrameType = this.#frame.adFrameType();
|
|
605
|
-
if (adFrameType === Protocol.Page.AdFrameType.None) {
|
|
606
|
-
return Lit.nothing;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
if (!this.#target || !this.#adScriptAncestry || this.#adScriptAncestry.ancestryChain.length === 0) {
|
|
610
|
-
return Lit.nothing;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
const rows = this.#adScriptAncestry.ancestryChain.map(adScriptId => {
|
|
614
|
-
const adScriptLinkElement = this.#linkifier.linkifyScriptLocation(
|
|
615
|
-
this.#target,
|
|
616
|
-
adScriptId.scriptId || null,
|
|
617
|
-
Platform.DevToolsPath.EmptyUrlString,
|
|
618
|
-
undefined,
|
|
619
|
-
undefined,
|
|
620
|
-
);
|
|
621
|
-
|
|
622
|
-
adScriptLinkElement?.setAttribute('jslog', `${VisualLogging.link('ad-script').track({click: true})}`);
|
|
542
|
+
// clang-format on
|
|
543
|
+
}
|
|
623
544
|
|
|
624
|
-
|
|
625
|
-
|
|
545
|
+
function maybeRenderCreatorAdScriptAncestry(
|
|
546
|
+
frame: SDK.ResourceTreeModel.ResourceTreeFrame|null, target: SDK.Target.Target|null,
|
|
547
|
+
adScriptAncestry: Protocol.Page.AdScriptAncestry|null): LitTemplate {
|
|
548
|
+
if (!frame) {
|
|
549
|
+
return nothing;
|
|
550
|
+
}
|
|
551
|
+
const adFrameType = frame.adFrameType();
|
|
552
|
+
if (adFrameType === Protocol.Page.AdFrameType.None) {
|
|
553
|
+
return nothing;
|
|
554
|
+
}
|
|
626
555
|
|
|
627
|
-
|
|
556
|
+
if (!target || !adScriptAncestry || adScriptAncestry.ancestryChain.length === 0) {
|
|
557
|
+
return nothing;
|
|
558
|
+
}
|
|
628
559
|
|
|
560
|
+
const rows = adScriptAncestry.ancestryChain.map(adScriptId => {
|
|
629
561
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
630
562
|
// clang-format off
|
|
563
|
+
return html`<div>
|
|
564
|
+
<devtools-widget .widgetConfig=${widgetConfig(Components.Linkifier.ScriptLocationLink, {
|
|
565
|
+
target, scriptId: adScriptId.scriptId, options: {jslogContext: 'ad-script'}})}>
|
|
566
|
+
</devtools-widget>
|
|
567
|
+
</div>`;
|
|
568
|
+
// clang-format on
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
const shouldRenderFilterlistRule = (adScriptAncestry.rootScriptFilterlistRule !== undefined);
|
|
572
|
+
|
|
573
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
574
|
+
// clang-format off
|
|
631
575
|
return html`
|
|
632
576
|
<devtools-report-key>${i18nString(UIStrings.creatorAdScriptAncestry)}</devtools-report-key>
|
|
633
577
|
<devtools-report-value class="creator-ad-script-ancestry-list" jslog=${VisualLogging.section('creator-ad-script-ancestry')}>
|
|
@@ -637,142 +581,138 @@ export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.Wrappabl
|
|
|
637
581
|
</devtools-report-value>
|
|
638
582
|
${shouldRenderFilterlistRule ? html`
|
|
639
583
|
<devtools-report-key>${i18nString(UIStrings.rootScriptFilterlistRule)}</devtools-report-key>
|
|
640
|
-
<devtools-report-value jslog=${VisualLogging.section('root-script-filterlist-rule')}>${
|
|
641
|
-
` :
|
|
584
|
+
<devtools-report-value jslog=${VisualLogging.section('root-script-filterlist-rule')}>${adScriptAncestry.rootScriptFilterlistRule}</devtools-report-value>
|
|
585
|
+
` : nothing}
|
|
642
586
|
`;
|
|
643
|
-
|
|
644
|
-
|
|
587
|
+
// clang-format on
|
|
588
|
+
}
|
|
645
589
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
590
|
+
function renderIsolationSection(input: FrameDetailsViewInput): LitTemplate {
|
|
591
|
+
if (!input.frame) {
|
|
592
|
+
return nothing;
|
|
593
|
+
}
|
|
594
|
+
return html`
|
|
651
595
|
<devtools-report-section-header>${i18nString(UIStrings.securityIsolation)}</devtools-report-section-header>
|
|
652
596
|
<devtools-report-key>${i18nString(UIStrings.secureContext)}</devtools-report-key>
|
|
653
597
|
<devtools-report-value>
|
|
654
|
-
${
|
|
655
|
-
|
|
598
|
+
${input.frame.isSecureContext() ? i18nString(UIStrings.yes) : i18nString(UIStrings.no)}\xA0${
|
|
599
|
+
maybeRenderSecureContextExplanation(input.frame)}
|
|
656
600
|
</devtools-report-value>
|
|
657
601
|
<devtools-report-key>${i18nString(UIStrings.crossoriginIsolated)}</devtools-report-key>
|
|
658
602
|
<devtools-report-value>
|
|
659
|
-
${
|
|
603
|
+
${input.frame.isCrossOriginIsolated() ? i18nString(UIStrings.yes) : i18nString(UIStrings.no)}
|
|
660
604
|
</devtools-report-value>
|
|
661
|
-
${
|
|
605
|
+
${until(input.securityIsolationInfo?.then?.(value => maybeRenderCoopCoepCSPStatus(value)), nothing)}
|
|
662
606
|
<devtools-report-divider></devtools-report-divider>
|
|
663
607
|
`;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function maybeRenderSecureContextExplanation(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
611
|
+
const explanation = getSecureContextExplanation(frame);
|
|
612
|
+
if (explanation) {
|
|
613
|
+
return html`<span class="inline-comment">${explanation}</span>`;
|
|
664
614
|
}
|
|
615
|
+
return nothing;
|
|
616
|
+
}
|
|
665
617
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
return null;
|
|
678
|
-
case Protocol.Page.SecureContextType.SecureLocalhost:
|
|
679
|
-
return i18nString(UIStrings.localhostIsAlwaysASecureContext);
|
|
680
|
-
case Protocol.Page.SecureContextType.InsecureAncestor:
|
|
681
|
-
return i18nString(UIStrings.aFrameAncestorIsAnInsecure);
|
|
682
|
-
case Protocol.Page.SecureContextType.InsecureScheme:
|
|
683
|
-
return i18nString(UIStrings.theFramesSchemeIsInsecure);
|
|
684
|
-
}
|
|
685
|
-
return null;
|
|
618
|
+
function getSecureContextExplanation(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null):
|
|
619
|
+
Platform.UIString.LocalizedString|null {
|
|
620
|
+
switch (frame?.getSecureContextType()) {
|
|
621
|
+
case Protocol.Page.SecureContextType.Secure:
|
|
622
|
+
return null;
|
|
623
|
+
case Protocol.Page.SecureContextType.SecureLocalhost:
|
|
624
|
+
return i18nString(UIStrings.localhostIsAlwaysASecureContext);
|
|
625
|
+
case Protocol.Page.SecureContextType.InsecureAncestor:
|
|
626
|
+
return i18nString(UIStrings.aFrameAncestorIsAnInsecure);
|
|
627
|
+
case Protocol.Page.SecureContextType.InsecureScheme:
|
|
628
|
+
return i18nString(UIStrings.theFramesSchemeIsInsecure);
|
|
686
629
|
}
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
687
632
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
const info = model && await model.getSecurityIsolationStatus(this.#frame.id);
|
|
692
|
-
if (info) {
|
|
693
|
-
return html`
|
|
633
|
+
async function maybeRenderCoopCoepCSPStatus(info: Protocol.Network.SecurityIsolationStatus|null): Promise<LitTemplate> {
|
|
634
|
+
if (info) {
|
|
635
|
+
return html`
|
|
694
636
|
${
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
637
|
+
maybeRenderCrossOriginStatus(
|
|
638
|
+
info.coep, i18n.i18n.lockedString('Cross-Origin Embedder Policy (COEP)'),
|
|
639
|
+
Protocol.Network.CrossOriginEmbedderPolicyValue.None)}
|
|
698
640
|
${
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
${
|
|
641
|
+
maybeRenderCrossOriginStatus(
|
|
642
|
+
info.coop, i18n.i18n.lockedString('Cross-Origin Opener Policy (COOP)'),
|
|
643
|
+
Protocol.Network.CrossOriginOpenerPolicyValue.UnsafeNone)}
|
|
644
|
+
${renderCSPSection(info.csp)}
|
|
703
645
|
`;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
return Lit.nothing;
|
|
707
646
|
}
|
|
647
|
+
return nothing;
|
|
648
|
+
}
|
|
708
649
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
650
|
+
function maybeRenderCrossOriginStatus(
|
|
651
|
+
info: Protocol.Network.CrossOriginEmbedderPolicyStatus|Protocol.Network.CrossOriginOpenerPolicyStatus|undefined,
|
|
652
|
+
policyName: string,
|
|
653
|
+
noneValue: Protocol.Network.CrossOriginEmbedderPolicyValue|
|
|
654
|
+
Protocol.Network.CrossOriginOpenerPolicyValue): LitTemplate {
|
|
655
|
+
if (!info) {
|
|
656
|
+
return nothing;
|
|
657
|
+
}
|
|
658
|
+
function crossOriginValueToString(
|
|
659
|
+
value: Protocol.Network.CrossOriginEmbedderPolicyValue|Protocol.Network.CrossOriginOpenerPolicyValue): string {
|
|
660
|
+
switch (value) {
|
|
661
|
+
case Protocol.Network.CrossOriginEmbedderPolicyValue.Credentialless:
|
|
662
|
+
return 'credentialless';
|
|
663
|
+
case Protocol.Network.CrossOriginEmbedderPolicyValue.None:
|
|
664
|
+
return 'none';
|
|
665
|
+
case Protocol.Network.CrossOriginEmbedderPolicyValue.RequireCorp:
|
|
666
|
+
return 'require-corp';
|
|
667
|
+
case Protocol.Network.CrossOriginOpenerPolicyValue.NoopenerAllowPopups:
|
|
668
|
+
return 'noopenener-allow-popups';
|
|
669
|
+
case Protocol.Network.CrossOriginOpenerPolicyValue.SameOrigin:
|
|
670
|
+
return 'same-origin';
|
|
671
|
+
case Protocol.Network.CrossOriginOpenerPolicyValue.SameOriginAllowPopups:
|
|
672
|
+
return 'same-origin-allow-popups';
|
|
673
|
+
case Protocol.Network.CrossOriginOpenerPolicyValue.SameOriginPlusCoep:
|
|
674
|
+
return 'same-origin-plus-coep';
|
|
675
|
+
case Protocol.Network.CrossOriginOpenerPolicyValue.RestrictProperties:
|
|
676
|
+
return 'restrict-properties';
|
|
677
|
+
case Protocol.Network.CrossOriginOpenerPolicyValue.RestrictPropertiesPlusCoep:
|
|
678
|
+
return 'restrict-properties-plus-coep';
|
|
679
|
+
case Protocol.Network.CrossOriginOpenerPolicyValue.UnsafeNone:
|
|
680
|
+
return 'unsafe-none';
|
|
741
681
|
}
|
|
682
|
+
}
|
|
742
683
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
684
|
+
const isEnabled = info.value !== noneValue;
|
|
685
|
+
const isReportOnly = (!isEnabled && info.reportOnlyValue !== noneValue);
|
|
686
|
+
const endpoint = isEnabled ? info.reportingEndpoint : info.reportOnlyReportingEndpoint;
|
|
687
|
+
return html`
|
|
747
688
|
<devtools-report-key>${policyName}</devtools-report-key>
|
|
748
689
|
<devtools-report-value>
|
|
749
690
|
${crossOriginValueToString(isEnabled ? info.value : info.reportOnlyValue)}
|
|
750
|
-
${isReportOnly ? html`<span class="inline-comment">report-only</span>` :
|
|
751
|
-
${
|
|
752
|
-
endpoint ? html`<span class="inline-name">${i18nString(UIStrings.reportingTo)}</span>${endpoint}` : Lit.nothing}
|
|
691
|
+
${isReportOnly ? html`<span class="inline-comment">report-only</span>` : nothing}
|
|
692
|
+
${endpoint ? html`<span class="inline-name">${i18nString(UIStrings.reportingTo)}</span>${endpoint}` : nothing}
|
|
753
693
|
</devtools-report-value>
|
|
754
694
|
`;
|
|
755
|
-
|
|
695
|
+
}
|
|
756
696
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
697
|
+
function renderEffectiveDirectives(directives: string): LitTemplate[] {
|
|
698
|
+
const parsedDirectives = new CspEvaluator.CspParser.CspParser(directives).csp.directives;
|
|
699
|
+
const result = [];
|
|
700
|
+
for (const directive in parsedDirectives) {
|
|
701
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
702
|
+
// clang-format off
|
|
763
703
|
result.push(html`
|
|
764
704
|
<div>
|
|
765
705
|
<span class="bold">${directive}</span>
|
|
766
706
|
${': ' + parsedDirectives[directive]?.join(', ')}
|
|
767
707
|
</div>`);
|
|
768
|
-
|
|
769
|
-
}
|
|
770
|
-
return result;
|
|
708
|
+
// clang-format on
|
|
771
709
|
}
|
|
710
|
+
return result;
|
|
711
|
+
}
|
|
772
712
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
713
|
+
function renderSingleCSP(cspInfo: Protocol.Network.ContentSecurityPolicyStatus, divider: boolean): LitTemplate {
|
|
714
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
715
|
+
// clang-format off
|
|
776
716
|
return html`
|
|
777
717
|
<devtools-report-key>
|
|
778
718
|
${cspInfo.isEnforced ? i18n.i18n.lockedString('Content-Security-Policy') : html`
|
|
@@ -789,22 +729,22 @@ export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.Wrappabl
|
|
|
789
729
|
<devtools-report-value>
|
|
790
730
|
${cspInfo.source === Protocol.Network.ContentSecurityPolicySource.HTTP ?
|
|
791
731
|
i18n.i18n.lockedString('HTTP header') : i18n.i18n.lockedString('Meta tag')}
|
|
792
|
-
${
|
|
732
|
+
${renderEffectiveDirectives(cspInfo.effectiveDirectives)}
|
|
793
733
|
</devtools-report-value>
|
|
794
|
-
${divider ? html`<devtools-report-divider class="subsection-divider"></devtools-report-divider>` :
|
|
734
|
+
${divider ? html`<devtools-report-divider class="subsection-divider"></devtools-report-divider>` : nothing}
|
|
795
735
|
`;
|
|
796
|
-
|
|
797
|
-
|
|
736
|
+
// clang-format on
|
|
737
|
+
}
|
|
798
738
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
739
|
+
function renderCSPSection(cspInfos: Protocol.Network.ContentSecurityPolicyStatus[]|undefined): LitTemplate {
|
|
740
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
741
|
+
// clang-format off
|
|
802
742
|
return html`
|
|
803
743
|
<devtools-report-divider></devtools-report-divider>
|
|
804
744
|
<devtools-report-section-header>
|
|
805
745
|
${i18nString(UIStrings.contentSecurityPolicy)}
|
|
806
746
|
</devtools-report-section-header>
|
|
807
|
-
${(cspInfos?.length) ? cspInfos.map((cspInfo, index) =>
|
|
747
|
+
${(cspInfos?.length) ? cspInfos.map((cspInfo, index) => renderSingleCSP(cspInfo, index < cspInfos?.length - 1)) : html`
|
|
808
748
|
<devtools-report-key>
|
|
809
749
|
${i18n.i18n.lockedString('Content-Security-Policy')}
|
|
810
750
|
</devtools-report-key>
|
|
@@ -813,16 +753,16 @@ export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.Wrappabl
|
|
|
813
753
|
</devtools-report-value>
|
|
814
754
|
`}
|
|
815
755
|
`;
|
|
816
|
-
|
|
817
|
-
|
|
756
|
+
// clang-format on
|
|
757
|
+
}
|
|
818
758
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
759
|
+
function renderApiAvailabilitySection(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
760
|
+
if (!frame) {
|
|
761
|
+
return nothing;
|
|
762
|
+
}
|
|
823
763
|
|
|
824
|
-
|
|
825
|
-
|
|
764
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
765
|
+
// clang-format off
|
|
826
766
|
return html`
|
|
827
767
|
<devtools-report-section-header>
|
|
828
768
|
${i18nString(UIStrings.apiAvailability)}
|
|
@@ -837,102 +777,183 @@ export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.Wrappabl
|
|
|
837
777
|
</x-link>
|
|
838
778
|
</span>
|
|
839
779
|
</devtools-report-section>
|
|
840
|
-
${
|
|
841
|
-
${
|
|
780
|
+
${renderSharedArrayBufferAvailability(frame)}
|
|
781
|
+
${renderMeasureMemoryAvailability(frame)}
|
|
842
782
|
<devtools-report-divider></devtools-report-divider>`;
|
|
843
|
-
|
|
844
|
-
|
|
783
|
+
// clang-format on
|
|
784
|
+
}
|
|
845
785
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
786
|
+
function renderSharedArrayBufferAvailability(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
787
|
+
if (frame) {
|
|
788
|
+
const features = frame.getGatedAPIFeatures();
|
|
789
|
+
if (features) {
|
|
790
|
+
const sabAvailable = features.includes(Protocol.Page.GatedAPIFeatures.SharedArrayBuffers);
|
|
791
|
+
const sabTransferAvailable =
|
|
792
|
+
sabAvailable && features.includes(Protocol.Page.GatedAPIFeatures.SharedArrayBuffersTransferAllowed);
|
|
793
|
+
const availabilityText = sabTransferAvailable ?
|
|
794
|
+
i18nString(UIStrings.availableTransferable) :
|
|
795
|
+
(sabAvailable ? i18nString(UIStrings.availableNotTransferable) : i18nString(UIStrings.unavailable));
|
|
796
|
+
const tooltipText = sabTransferAvailable ?
|
|
797
|
+
i18nString(UIStrings.sharedarraybufferConstructorIs) :
|
|
798
|
+
(sabAvailable ? i18nString(UIStrings.sharedarraybufferConstructorIsAvailable) : '');
|
|
799
|
+
|
|
800
|
+
function renderHint(frame: SDK.ResourceTreeModel.ResourceTreeFrame): LitTemplate {
|
|
801
|
+
switch (frame.getCrossOriginIsolatedContextType()) {
|
|
802
|
+
case Protocol.Page.CrossOriginIsolatedContextType.Isolated:
|
|
803
|
+
return nothing;
|
|
804
|
+
case Protocol.Page.CrossOriginIsolatedContextType.NotIsolated:
|
|
805
|
+
if (sabAvailable) {
|
|
806
|
+
// clang-format off
|
|
867
807
|
return html`
|
|
868
808
|
<span class="inline-comment">
|
|
869
809
|
${i18nString(UIStrings.willRequireCrossoriginIsolated)}
|
|
870
810
|
</span>`;
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
811
|
+
// clang-format on
|
|
812
|
+
}
|
|
813
|
+
return html`<span class="inline-comment">${i18nString(UIStrings.requiresCrossoriginIsolated)}</span>`;
|
|
814
|
+
case Protocol.Page.CrossOriginIsolatedContextType.NotIsolatedFeatureDisabled:
|
|
815
|
+
if (!sabTransferAvailable) {
|
|
816
|
+
// clang-format off
|
|
877
817
|
return html`
|
|
878
818
|
<span class="inline-comment">
|
|
879
819
|
${i18nString(UIStrings.transferRequiresCrossoriginIsolatedPermission)}
|
|
880
820
|
<code> cross-origin-isolated</code>
|
|
881
821
|
</span>`;
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
return Lit.nothing;
|
|
822
|
+
// clang-format on
|
|
823
|
+
}
|
|
824
|
+
break;
|
|
887
825
|
}
|
|
826
|
+
return nothing;
|
|
827
|
+
}
|
|
888
828
|
|
|
889
|
-
|
|
890
|
-
|
|
829
|
+
// SharedArrayBuffer is an API name, so we don't translate it.
|
|
830
|
+
return html`
|
|
891
831
|
<devtools-report-key>SharedArrayBuffers</devtools-report-key>
|
|
892
832
|
<devtools-report-value title=${tooltipText}>
|
|
893
|
-
${availabilityText}\xA0${renderHint(
|
|
833
|
+
${availabilityText}\xA0${renderHint(frame)}
|
|
894
834
|
</devtools-report-value>
|
|
895
835
|
`;
|
|
896
|
-
}
|
|
897
836
|
}
|
|
898
|
-
return Lit.nothing;
|
|
899
837
|
}
|
|
838
|
+
return nothing;
|
|
839
|
+
}
|
|
900
840
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
841
|
+
function renderMeasureMemoryAvailability(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
842
|
+
if (frame) {
|
|
843
|
+
const measureMemoryAvailable = frame.isCrossOriginIsolated();
|
|
844
|
+
const availabilityText =
|
|
845
|
+
measureMemoryAvailable ? i18nString(UIStrings.available) : i18nString(UIStrings.unavailable);
|
|
846
|
+
const tooltipText = measureMemoryAvailable ? i18nString(UIStrings.thePerformanceAPI) :
|
|
847
|
+
i18nString(UIStrings.thePerformancemeasureuseragentspecificmemory);
|
|
848
|
+
return html`
|
|
909
849
|
<devtools-report-key>${i18nString(UIStrings.measureMemory)}</devtools-report-key>
|
|
910
850
|
<devtools-report-value>
|
|
911
851
|
<span title=${tooltipText}>${
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
852
|
+
availabilityText}</span>\xA0<x-link class="link" href="https://web.dev/monitor-total-page-memory-usage/" jslog=${
|
|
853
|
+
VisualLogging.link('learn-more.monitor-memory-usage').track({click: true})}>${
|
|
854
|
+
i18nString(UIStrings.learnMore)}</x-link>
|
|
915
855
|
</devtools-report-value>
|
|
916
856
|
`;
|
|
917
|
-
}
|
|
918
|
-
return Lit.nothing;
|
|
919
857
|
}
|
|
858
|
+
return nothing;
|
|
859
|
+
}
|
|
920
860
|
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
861
|
+
function renderAdditionalInfoSection(frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitTemplate {
|
|
862
|
+
if (!frame) {
|
|
863
|
+
return nothing;
|
|
864
|
+
}
|
|
925
865
|
|
|
926
|
-
|
|
866
|
+
return html`
|
|
927
867
|
<devtools-report-section-header
|
|
928
868
|
title=${i18nString(UIStrings.thisAdditionalDebugging)}
|
|
929
869
|
>${i18nString(UIStrings.additionalInformation)}</devtools-report-section-header>
|
|
930
870
|
<devtools-report-key>${i18nString(UIStrings.frameId)}</devtools-report-key>
|
|
931
871
|
<devtools-report-value>
|
|
932
|
-
<div class="text-ellipsis" title=${
|
|
872
|
+
<div class="text-ellipsis" title=${frame.id}>${frame.id}</div>
|
|
933
873
|
</devtools-report-value>
|
|
934
874
|
<devtools-report-divider></devtools-report-divider>
|
|
935
875
|
`;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
export class FrameDetailsReportView extends LegacyWrapper.LegacyWrapper.WrappableComponent {
|
|
879
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
880
|
+
#frame?: SDK.ResourceTreeModel.ResourceTreeFrame;
|
|
881
|
+
#target: SDK.Target.Target|null = null;
|
|
882
|
+
#protocolMonitorExperimentEnabled = false;
|
|
883
|
+
#permissionsPolicies: Promise<Protocol.Page.PermissionsPolicyFeatureState[]|null>|null = null;
|
|
884
|
+
#linkifier = new Components.Linkifier.Linkifier();
|
|
885
|
+
#adScriptAncestry: Protocol.Page.AdScriptAncestry|null = null;
|
|
886
|
+
|
|
887
|
+
constructor(frame: SDK.ResourceTreeModel.ResourceTreeFrame) {
|
|
888
|
+
super();
|
|
889
|
+
this.#frame = frame;
|
|
890
|
+
void this.render();
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
connectedCallback(): void {
|
|
894
|
+
this.parentElement?.classList.add('overflow-auto');
|
|
895
|
+
this.#protocolMonitorExperimentEnabled = Root.Runtime.experiments.isEnabled('protocol-monitor');
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
override async render(): Promise<void> {
|
|
899
|
+
const result = await this.#frame?.parentFrame()?.getAdScriptAncestry(this.#frame?.id);
|
|
900
|
+
if (result && result.ancestryChain.length > 0) {
|
|
901
|
+
this.#adScriptAncestry = result;
|
|
902
|
+
|
|
903
|
+
// Obtain the Target associated with the first ad script, because in most scenarios all
|
|
904
|
+
// scripts share the same debuggerId. However, discrepancies might arise when content scripts
|
|
905
|
+
// from browser extensions are involved. We will monitor the debugging experiences and revisit
|
|
906
|
+
// this approach if it proves problematic.
|
|
907
|
+
const firstScript = this.#adScriptAncestry.ancestryChain[0];
|
|
908
|
+
const debuggerModel = firstScript?.debuggerId ?
|
|
909
|
+
await SDK.DebuggerModel.DebuggerModel.modelForDebuggerId(firstScript.debuggerId) :
|
|
910
|
+
null;
|
|
911
|
+
this.#target = debuggerModel?.target() ?? null;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
if (!this.#permissionsPolicies && this.#frame) {
|
|
915
|
+
this.#permissionsPolicies = this.#frame.getPermissionsPolicyState();
|
|
916
|
+
}
|
|
917
|
+
await RenderCoordinator.write('FrameDetailsView render', async () => {
|
|
918
|
+
const frame = this.#frame;
|
|
919
|
+
if (!frame) {
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
const networkManager = frame.resourceTreeModel().target().model(SDK.NetworkManager.NetworkManager);
|
|
923
|
+
const securityIsolationInfo = networkManager?.getSecurityIsolationStatus(frame.id);
|
|
924
|
+
const linkTargetDOMNode = frame.getOwnerDOMNodeOrDocument();
|
|
925
|
+
const input = {
|
|
926
|
+
frame,
|
|
927
|
+
target: this.#target,
|
|
928
|
+
protocolMonitorExperimentEnabled: this.#protocolMonitorExperimentEnabled,
|
|
929
|
+
permissionsPolicies: this.#permissionsPolicies,
|
|
930
|
+
adScriptAncestry: this.#adScriptAncestry,
|
|
931
|
+
linkifier: this.#linkifier,
|
|
932
|
+
linkTargetDOMNode,
|
|
933
|
+
trials: await frame.getOriginTrials(),
|
|
934
|
+
securityIsolationInfo,
|
|
935
|
+
onRevealInSources: async () => {
|
|
936
|
+
const sourceCode = this.#uiSourceCodeForFrame(frame);
|
|
937
|
+
if (sourceCode) {
|
|
938
|
+
await Common.Revealer.reveal(sourceCode);
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
};
|
|
942
|
+
renderFrameDetailsView(input, this.#shadow);
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
#uiSourceCodeForFrame(frame: SDK.ResourceTreeModel.ResourceTreeFrame): Workspace.UISourceCode.UISourceCode|null {
|
|
947
|
+
for (const project of Workspace.Workspace.WorkspaceImpl.instance().projects()) {
|
|
948
|
+
const projectTarget = Bindings.NetworkProject.NetworkProject.getTargetForProject(project);
|
|
949
|
+
if (projectTarget && projectTarget === frame.resourceTreeModel().target()) {
|
|
950
|
+
const uiSourceCode = project.uiSourceCodeForURL(frame.url);
|
|
951
|
+
if (uiSourceCode) {
|
|
952
|
+
return uiSourceCode;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return null;
|
|
936
957
|
}
|
|
937
958
|
}
|
|
938
959
|
|