chrome-devtools-frontend 1.0.1526630 → 1.0.1529186
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/docs/ui_engineering.md +159 -0
- package/eslint.config.mjs +6 -1
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/i18nImpl.ts +6 -1
- package/front_end/core/protocol_client/protocol_client.ts +1 -1
- package/front_end/core/root/Runtime.ts +38 -4
- package/front_end/core/sdk/CSSMatchedStyles.ts +50 -7
- package/front_end/core/sdk/CSSRule.ts +35 -6
- package/front_end/core/sdk/Connections.ts +2 -1
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -1
- package/front_end/core/sdk/NetworkManager.ts +267 -34
- package/front_end/core/sdk/PreloadingModel.ts +82 -17
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1 -1
- package/front_end/core/sdk/RehydratingConnection.ts +29 -4
- package/front_end/core/sdk/ScopeTreeCache.ts +8 -3
- package/front_end/core/sdk/SourceMap.ts +41 -11
- package/front_end/core/sdk/SourceMapManager.ts +13 -2
- package/front_end/core/sdk/SourceMapScopesInfo.ts +49 -2
- package/front_end/core/sdk/TargetManager.ts +0 -22
- package/front_end/core/sdk/TraceObject.ts +8 -7
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +81 -0
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +3 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +1 -0
- package/front_end/entrypoints/main/MainImpl.ts +42 -28
- package/front_end/generated/InspectorBackendCommands.js +3 -2
- package/front_end/generated/SupportedCSSProperties.js +2 -0
- package/front_end/generated/protocol.ts +17 -3
- package/front_end/models/ai_assistance/BuiltInAi.ts +111 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +15 -14
- package/front_end/models/ai_assistance/ai_assistance.ts +53 -24
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +105 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +6 -1
- package/front_end/models/extensions/ExtensionView.ts +3 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +31 -27
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +31 -29
- package/front_end/models/persistence/NetworkPersistenceManager.ts +3 -5
- package/front_end/models/persistence/PersistenceImpl.ts +0 -5
- package/front_end/models/persistence/persistence-meta.ts +0 -31
- package/front_end/models/persistence/persistence.ts +0 -6
- package/front_end/models/source_map_scopes/NamesResolver.ts +5 -11
- package/front_end/models/stack_trace/Trie.ts +9 -0
- package/front_end/models/trace/lantern/types/Lantern.ts +1 -1
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -0
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +120 -113
- package/front_end/panels/ai_assistance/PatchWidget.ts +9 -8
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +2 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +29 -29
- package/front_end/panels/ai_assistance/components/UserActionRow.ts +1 -0
- package/front_end/panels/animation/AnimationTimeline.ts +1 -0
- package/front_end/panels/application/CookieItemsView.ts +1 -0
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +2 -0
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +11 -5
- package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -5
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +22 -10
- package/front_end/panels/changes/CombinedDiffView.ts +1 -0
- package/front_end/{models/persistence → panels/common}/PersistenceUtils.ts +15 -17
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +369 -0
- package/front_end/panels/console/ConsolePanel.ts +2 -0
- package/front_end/panels/console/ConsolePrompt.ts +12 -2
- package/front_end/panels/console/ConsoleSidebar.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +12 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +44 -0
- package/front_end/panels/{explain → console}/PromptBuilder.ts +12 -7
- package/front_end/panels/console/console-meta.ts +14 -0
- package/front_end/panels/console/console.ts +6 -0
- package/front_end/panels/console/consoleInsightTeaser.css +83 -0
- package/front_end/panels/coverage/CoverageListView.ts +29 -11
- package/front_end/panels/coverage/CoverageView.ts +292 -284
- package/front_end/panels/coverage/coverageView.css +17 -0
- package/front_end/panels/elements/ComputedStyleWidget.ts +1 -0
- package/front_end/panels/elements/LayoutPane.ts +1 -0
- package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -0
- package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -1
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +17 -0
- package/front_end/panels/emulation/DeviceModeView.ts +2 -0
- package/front_end/panels/explain/ActionDelegate.ts +4 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +14 -12
- package/front_end/panels/explain/explain-meta.ts +7 -0
- package/front_end/panels/explain/explain.ts +0 -1
- package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -0
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -0
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -0
- package/front_end/panels/media/MainView.ts +1 -0
- package/front_end/panels/media/TickingFlameChart.ts +2 -0
- package/front_end/panels/network/BlockedURLsPane.ts +237 -108
- package/front_end/panels/network/EventSourceMessagesView.ts +1 -0
- package/front_end/panels/network/NetworkItemView.ts +1 -0
- package/front_end/panels/network/NetworkLogView.ts +9 -7
- package/front_end/panels/network/NetworkOverview.ts +1 -0
- package/front_end/panels/network/RequestCookiesView.ts +1 -0
- package/front_end/panels/network/RequestHTMLView.ts +1 -0
- package/front_end/panels/network/RequestInitiatorView.ts +1 -0
- package/front_end/panels/network/RequestPayloadView.ts +1 -0
- package/front_end/panels/network/RequestPreviewView.ts +1 -0
- package/front_end/panels/network/RequestResponseView.ts +1 -0
- package/front_end/panels/network/RequestTimingView.ts +2 -0
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -0
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -0
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -0
- package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -0
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +7 -0
- package/front_end/panels/profiler/IsolateSelector.ts +1 -0
- package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -0
- package/front_end/panels/profiler/ProfileView.ts +1 -0
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
- package/front_end/panels/recorder/RecorderPanel.ts +2 -0
- package/front_end/panels/screencast/ScreencastView.ts +1 -0
- package/front_end/panels/search/SearchView.ts +1 -0
- package/front_end/panels/settings/AISettingsTab.ts +3 -3
- package/front_end/{models/persistence → panels/settings}/EditFileSystemView.ts +3 -6
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +4 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
- package/front_end/panels/settings/settings.ts +2 -0
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +12 -0
- package/front_end/panels/sources/BreakpointsView.ts +1 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
- package/front_end/{models/persistence → panels/sources}/PersistenceActions.ts +8 -12
- package/front_end/panels/sources/TabbedEditorContainer.ts +2 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +17 -2
- package/front_end/panels/sources/sources-meta.ts +15 -0
- package/front_end/panels/sources/sources.ts +2 -0
- package/front_end/panels/timeline/README.md +2 -2
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -3
- package/front_end/panels/timeline/TimelineLayersView.ts +1 -0
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +114 -37
- package/front_end/panels/timeline/TimelinePanel.ts +43 -62
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
- package/front_end/panels/timeline/components/LiveMetricsView.ts +4 -8
- package/front_end/panels/timeline/components/Sidebar.ts +2 -0
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +7 -7
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
- package/front_end/panels/utils/utils.ts +2 -1
- package/front_end/panels/web_audio/WebAudioView.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/diff/diff_match_patch.js +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1530 -2426
- package/front_end/third_party/lighthouse/locales/ar-XB.json +107 -455
- package/front_end/third_party/lighthouse/locales/ar.json +107 -455
- package/front_end/third_party/lighthouse/locales/bg.json +96 -444
- package/front_end/third_party/lighthouse/locales/ca.json +96 -444
- package/front_end/third_party/lighthouse/locales/cs.json +96 -444
- package/front_end/third_party/lighthouse/locales/da.json +96 -444
- package/front_end/third_party/lighthouse/locales/de.json +96 -444
- package/front_end/third_party/lighthouse/locales/el.json +96 -444
- package/front_end/third_party/lighthouse/locales/en-GB.json +96 -444
- package/front_end/third_party/lighthouse/locales/en-US.json +116 -467
- package/front_end/third_party/lighthouse/locales/en-XA.json +93 -441
- package/front_end/third_party/lighthouse/locales/en-XL.json +116 -467
- package/front_end/third_party/lighthouse/locales/es-419.json +96 -444
- package/front_end/third_party/lighthouse/locales/es.json +96 -444
- package/front_end/third_party/lighthouse/locales/fi.json +96 -444
- package/front_end/third_party/lighthouse/locales/fil.json +96 -444
- package/front_end/third_party/lighthouse/locales/fr.json +96 -444
- package/front_end/third_party/lighthouse/locales/he.json +118 -466
- package/front_end/third_party/lighthouse/locales/hi.json +96 -444
- package/front_end/third_party/lighthouse/locales/hr.json +100 -448
- package/front_end/third_party/lighthouse/locales/hu.json +96 -444
- package/front_end/third_party/lighthouse/locales/id.json +96 -444
- package/front_end/third_party/lighthouse/locales/it.json +96 -444
- package/front_end/third_party/lighthouse/locales/ja.json +96 -444
- package/front_end/third_party/lighthouse/locales/ko.json +97 -445
- package/front_end/third_party/lighthouse/locales/lt.json +96 -444
- package/front_end/third_party/lighthouse/locales/lv.json +97 -445
- package/front_end/third_party/lighthouse/locales/nl.json +96 -444
- package/front_end/third_party/lighthouse/locales/no.json +96 -444
- package/front_end/third_party/lighthouse/locales/pl.json +96 -444
- package/front_end/third_party/lighthouse/locales/pt-PT.json +96 -444
- package/front_end/third_party/lighthouse/locales/pt.json +97 -445
- package/front_end/third_party/lighthouse/locales/ro.json +97 -445
- package/front_end/third_party/lighthouse/locales/ru.json +96 -444
- package/front_end/third_party/lighthouse/locales/sk.json +96 -444
- package/front_end/third_party/lighthouse/locales/sl.json +96 -444
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +96 -444
- package/front_end/third_party/lighthouse/locales/sr.json +96 -444
- package/front_end/third_party/lighthouse/locales/sv.json +96 -444
- package/front_end/third_party/lighthouse/locales/ta.json +96 -444
- package/front_end/third_party/lighthouse/locales/te.json +97 -445
- package/front_end/third_party/lighthouse/locales/th.json +96 -444
- package/front_end/third_party/lighthouse/locales/tr.json +96 -444
- package/front_end/third_party/lighthouse/locales/uk.json +96 -444
- package/front_end/third_party/lighthouse/locales/vi.json +96 -444
- package/front_end/third_party/lighthouse/locales/zh-HK.json +96 -444
- package/front_end/third_party/lighthouse/locales/zh-TW.json +97 -445
- package/front_end/third_party/lighthouse/locales/zh.json +96 -444
- package/front_end/third_party/lighthouse/report/bundle.d.ts +8 -14
- package/front_end/third_party/lighthouse/report/bundle.js +10 -49
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/third_party/web-vitals/README.chromium +5 -8
- package/front_end/third_party/web-vitals/package/README.md +191 -152
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.js +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +45 -26
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +3 -3
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +10 -10
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +307 -206
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +69 -49
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/index.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/index.js +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +33 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +111 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +4 -0
- package/front_end/third_party/web-vitals/package/dist/modules/{attribution/deprecated.js → lib/LCPEntryManager.js} +6 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.d.ts +6 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js +44 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js +5 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +9 -12
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +52 -33
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +0 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.d.ts +6 -0
- package/front_end/third_party/web-vitals/package/dist/modules/{deprecated.js → lib/initUnique.js} +11 -4
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +3 -6
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +6 -6
- package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.d.ts → whenIdleOrHidden.d.ts} +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.js → whenIdleOrHidden.js} +10 -8
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +17 -35
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +3 -5
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +9 -7
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +27 -19
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +33 -26
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +2 -4
- package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +6 -5
- package/front_end/third_party/web-vitals/package/dist/modules/types/cls.d.ts +5 -3
- package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +80 -33
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +6 -2
- package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +28 -4
- package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
- package/front_end/third_party/web-vitals/package/package.json +4 -10
- package/front_end/third_party/web-vitals/package/src/attribution/index.ts +0 -1
- package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +58 -33
- package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +4 -4
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +382 -258
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +96 -69
- package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +3 -3
- package/front_end/third_party/web-vitals/package/src/index.ts +0 -1
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +146 -0
- package/front_end/third_party/web-vitals/package/src/{attribution/deprecated.ts → lib/LCPEntryManager.ts} +6 -9
- package/front_end/third_party/web-vitals/package/src/lib/LayoutShiftManager.ts +50 -0
- package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getNavigationEntry.ts +5 -8
- package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +12 -12
- package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +57 -35
- package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +2 -2
- package/front_end/third_party/web-vitals/package/src/{deprecated.ts → lib/initUnique.ts} +14 -8
- package/front_end/third_party/web-vitals/package/src/lib/observe.ts +3 -11
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +12 -6
- package/front_end/third_party/web-vitals/package/src/lib/{whenIdle.ts → whenIdleOrHidden.ts} +10 -8
- package/front_end/third_party/web-vitals/package/src/onCLS.ts +17 -38
- package/front_end/third_party/web-vitals/package/src/onFCP.ts +3 -6
- package/front_end/third_party/web-vitals/package/src/onINP.ts +33 -28
- package/front_end/third_party/web-vitals/package/src/onLCP.ts +36 -29
- package/front_end/third_party/web-vitals/package/src/onTTFB.ts +2 -5
- package/front_end/third_party/web-vitals/package/src/types/base.ts +5 -5
- package/front_end/third_party/web-vitals/package/src/types/cls.ts +5 -3
- package/front_end/third_party/web-vitals/package/src/types/inp.ts +88 -33
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +6 -2
- package/front_end/third_party/web-vitals/package/src/types.ts +47 -4
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +75 -0
- package/front_end/third_party/web-vitals/rebuild.sh +32 -18
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +5 -10
- package/front_end/third_party/web-vitals/web-vitals.ts +0 -2
- package/front_end/ui/components/docs/console_insight/basic.ts +3 -2
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +2 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +0 -2
- package/front_end/ui/legacy/InspectorView.ts +2 -0
- package/front_end/ui/legacy/ListWidget.ts +2 -2
- package/front_end/ui/legacy/SplitWidget.ts +2 -0
- package/front_end/ui/legacy/TabbedPane.ts +1 -0
- package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -0
- package/front_end/ui/legacy/UIUtils.ts +8 -19
- package/front_end/ui/legacy/ViewManager.ts +1 -0
- package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +7 -20
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -0
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +1 -0
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +25 -0
- package/mcp/README.md +7 -0
- package/mcp/mcp.ts +8 -0
- package/package.json +1 -1
- package/front_end/models/live-metrics/web-vitals-injected/OnEachInteraction.ts +0 -34
- package/front_end/third_party/web-vitals/package/attribution.d.ts +0 -16
- package/front_end/third_party/web-vitals/package/attribution.js +0 -18
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/deprecated.d.ts +0 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.d.ts +0 -11
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.js +0 -46
- package/front_end/third_party/web-vitals/package/dist/modules/deprecated.d.ts +0 -5
- package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.d.ts +0 -31
- package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.js +0 -107
- package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.js +0 -22
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.d.ts +0 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.js +0 -147
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.js +0 -25
- package/front_end/third_party/web-vitals/package/dist/modules/onFID.d.ts +0 -13
- package/front_end/third_party/web-vitals/package/dist/modules/onFID.js +0 -70
- package/front_end/third_party/web-vitals/package/dist/modules/types/fid.d.ts +0 -46
- package/front_end/third_party/web-vitals/package/dist/modules/types/fid.js +0 -16
- package/front_end/third_party/web-vitals/package/src/attribution/onFID.ts +0 -62
- package/front_end/third_party/web-vitals/package/src/lib/interactions.ts +0 -139
- package/front_end/third_party/web-vitals/package/src/lib/onHidden.ts +0 -23
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/firstInputPolyfill.ts +0 -174
- package/front_end/third_party/web-vitals/package/src/onFID.ts +0 -105
- package/front_end/third_party/web-vitals/package/src/types/fid.ts +0 -65
- package/front_end/ui/components/text_editor/textEditor.css +0 -18
- package/front_end/ui/legacy/inlineButton.css +0 -22
- /package/front_end/entrypoints/{rehydrated_devtools_app/rehydrated_devtools_app.ts → trace_app/trace_app.ts} +0 -0
- /package/front_end/{models/persistence → panels/settings}/editFileSystemView.css +0 -0
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
// Copyright 2015 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
+
/* eslint-disable rulesdir/no-lit-render-outside-of-view */
|
|
4
5
|
/* eslint-disable rulesdir/no-imperative-dom-api */
|
|
5
6
|
|
|
6
7
|
import '../../ui/legacy/legacy.js';
|
|
8
|
+
import '../../ui/components/tooltips/tooltips.js';
|
|
7
9
|
|
|
8
10
|
import type * as Common from '../../core/common/common.js';
|
|
9
11
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
10
12
|
import * as Platform from '../../core/platform/platform.js';
|
|
13
|
+
import * as Root from '../../core/root/root.js';
|
|
11
14
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
12
15
|
import * as Logs from '../../models/logs/logs.js';
|
|
13
16
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
14
17
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
18
|
+
import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
15
19
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
16
20
|
|
|
17
21
|
import blockedURLsPaneStyles from './blockedURLsPane.css.js';
|
|
18
22
|
|
|
23
|
+
const {ref} = Directives;
|
|
24
|
+
|
|
19
25
|
const UIStrings = {
|
|
20
26
|
/**
|
|
21
27
|
* @description Text to enable blocking of network requests
|
|
@@ -47,6 +53,10 @@ const UIStrings = {
|
|
|
47
53
|
* @description Text in Blocked URLs Pane of the Network panel
|
|
48
54
|
*/
|
|
49
55
|
textPatternToBlockMatching: 'Text pattern to block matching requests; use * for wildcard',
|
|
56
|
+
/**
|
|
57
|
+
* @description Text in Blocked URLs Pane of the Network panel
|
|
58
|
+
*/
|
|
59
|
+
textPatternToBlockMatchingURLPatterns: 'Text pattern to block matching requests; use URLPattern syntax.',
|
|
50
60
|
/**
|
|
51
61
|
* @description Error text for empty list widget input in Request Blocking tool
|
|
52
62
|
*/
|
|
@@ -55,6 +65,19 @@ const UIStrings = {
|
|
|
55
65
|
* @description Error text for duplicate list widget input in Request Blocking tool
|
|
56
66
|
*/
|
|
57
67
|
patternAlreadyExists: 'Pattern already exists.',
|
|
68
|
+
/**
|
|
69
|
+
* @description Tooltip message when a pattern failed to parse as a URLPattern
|
|
70
|
+
*/
|
|
71
|
+
patternFailedToParse: 'This pattern failed to parse as a URLPattern',
|
|
72
|
+
/**
|
|
73
|
+
* @description Tooltip message when a pattern failed to parse as a URLPattern because it contains RegExp groups
|
|
74
|
+
*/
|
|
75
|
+
patternFailedWithRegExpGroups: 'RegExp groups are not allowed',
|
|
76
|
+
/**
|
|
77
|
+
* @description Tooltip message when a pattern was converted to a URLPattern
|
|
78
|
+
* @example {example.com} PH1
|
|
79
|
+
*/
|
|
80
|
+
patternWasUpgraded: 'This pattern was upgraded from "{PH1}"',
|
|
58
81
|
/**
|
|
59
82
|
* @description Message to be announced for a when list item is removed from list widget
|
|
60
83
|
*/
|
|
@@ -69,46 +92,94 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
69
92
|
|
|
70
93
|
const NETWORK_REQUEST_BLOCKING_EXPLANATION_URL =
|
|
71
94
|
'https://developer.chrome.com/docs/devtools/network-request-blocking' as Platform.DevToolsPath.UrlString;
|
|
95
|
+
const PATTERN_API_DOCS_URL =
|
|
96
|
+
'https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API' as Platform.DevToolsPath.UrlString;
|
|
97
|
+
|
|
98
|
+
const {bindToAction} = UI.UIUtils;
|
|
99
|
+
|
|
100
|
+
interface ViewInput {
|
|
101
|
+
list: UI.ListWidget.ListWidget<SDK.NetworkManager.RequestCondition>;
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
toggleEnabled: () => void;
|
|
104
|
+
addPattern: () => void;
|
|
105
|
+
}
|
|
106
|
+
type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
107
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
108
|
+
render(
|
|
109
|
+
// clang-format off
|
|
110
|
+
html`
|
|
111
|
+
<style>${blockedURLsPaneStyles}</style>
|
|
112
|
+
<devtools-toolbar jslog=${VisualLogging.toolbar()}>
|
|
113
|
+
<devtools-checkbox
|
|
114
|
+
?checked=${input.enabled}
|
|
115
|
+
@click=${input.toggleEnabled}
|
|
116
|
+
.jslogContext=${'network.enable-request-blocking'}>
|
|
117
|
+
${i18nString(UIStrings.enableNetworkRequestBlocking)}
|
|
118
|
+
</devtools-checkbox>
|
|
119
|
+
<div class="toolbar-divider"></div>
|
|
120
|
+
<devtools-button ${bindToAction('network.add-network-request-blocking-pattern')}></devtools-button>
|
|
121
|
+
<devtools-button ${bindToAction('network.remove-all-network-request-blocking-patterns')}></devtools-button>
|
|
122
|
+
</devtools-toolbar>
|
|
123
|
+
<div class=empty-state ${ref(e => input.list.setEmptyPlaceholder(e ?? null))}>
|
|
124
|
+
<span class=empty-state-header>${i18nString(UIStrings.noNetworkRequestsBlocked)}</span>
|
|
125
|
+
<div class=empty-state-description>
|
|
126
|
+
<span>${i18nString(UIStrings.addPatternToBlock, {PH1: i18nString(UIStrings.addPattern)})}</span>
|
|
127
|
+
<x-link
|
|
128
|
+
href=${NETWORK_REQUEST_BLOCKING_EXPLANATION_URL}
|
|
129
|
+
tabindex=0
|
|
130
|
+
class=devtools-link
|
|
131
|
+
jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('learn-more')}>
|
|
132
|
+
${i18nString(UIStrings.learnMore)}
|
|
133
|
+
</x-link>
|
|
134
|
+
</div>
|
|
135
|
+
<devtools-button
|
|
136
|
+
@click=${input.addPattern}
|
|
137
|
+
class=add-button
|
|
138
|
+
.jslogContext=${'network.add-network-request-blocking-pattern'}
|
|
139
|
+
aria-label=${i18nString(UIStrings.addNetworkRequestBlockingPattern)}
|
|
140
|
+
.variant=${Buttons.Button.Variant.TONAL}>
|
|
141
|
+
${i18nString(UIStrings.addPattern)}
|
|
142
|
+
</devtools-button>
|
|
143
|
+
</div>
|
|
144
|
+
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(UI.Widget.VBox)}>${input.list.element}</devtools-widget>
|
|
145
|
+
`,
|
|
146
|
+
// clang-format on
|
|
147
|
+
target);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
function learnMore(): LitTemplate {
|
|
151
|
+
return html`<x-link
|
|
152
|
+
href=${NETWORK_REQUEST_BLOCKING_EXPLANATION_URL}
|
|
153
|
+
tabindex=0
|
|
154
|
+
class=devtools-link
|
|
155
|
+
jslog=${VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context('learn-more')}>
|
|
156
|
+
${i18nString(UIStrings.learnMore)}
|
|
157
|
+
</x-link>`;
|
|
158
|
+
}
|
|
72
159
|
|
|
73
160
|
export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
74
|
-
UI.ListWidget.Delegate<SDK.NetworkManager.
|
|
161
|
+
UI.ListWidget.Delegate<SDK.NetworkManager.RequestCondition> {
|
|
75
162
|
private manager: SDK.NetworkManager.MultitargetNetworkManager;
|
|
76
|
-
private readonly
|
|
77
|
-
private
|
|
78
|
-
private
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
super({
|
|
163
|
+
private readonly list: UI.ListWidget.ListWidget<SDK.NetworkManager.RequestCondition>;
|
|
164
|
+
private editor: UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>|null;
|
|
165
|
+
private blockedCountForUrl: Map<Platform.DevToolsPath.UrlString, number>;
|
|
166
|
+
#view: View;
|
|
167
|
+
|
|
168
|
+
constructor(target?: HTMLElement, view = DEFAULT_VIEW) {
|
|
169
|
+
super(target, {
|
|
84
170
|
jslog: `${VisualLogging.panel('network.blocked-urls').track({resize: true})}`,
|
|
85
171
|
useShadowDom: true,
|
|
86
172
|
});
|
|
87
|
-
this
|
|
173
|
+
this.#view = view;
|
|
88
174
|
|
|
89
175
|
this.manager = SDK.NetworkManager.MultitargetNetworkManager.instance();
|
|
90
176
|
this.manager.addEventListener(
|
|
91
177
|
SDK.NetworkManager.MultitargetNetworkManager.Events.BLOCKED_PATTERNS_CHANGED, this.update, this);
|
|
92
178
|
|
|
93
|
-
this.toolbar = this.contentElement.createChild('devtools-toolbar');
|
|
94
|
-
this.enabledCheckbox = new UI.Toolbar.ToolbarCheckbox(
|
|
95
|
-
i18nString(UIStrings.enableNetworkRequestBlocking), undefined, this.toggleEnabled.bind(this),
|
|
96
|
-
'network.enable-request-blocking');
|
|
97
|
-
this.toolbar.appendToolbarItem(this.enabledCheckbox);
|
|
98
|
-
this.toolbar.appendSeparator();
|
|
99
|
-
this.toolbar.appendToolbarItem(
|
|
100
|
-
UI.Toolbar.Toolbar.createActionButton('network.add-network-request-blocking-pattern'));
|
|
101
|
-
this.toolbar.appendToolbarItem(
|
|
102
|
-
UI.Toolbar.Toolbar.createActionButton('network.remove-all-network-request-blocking-patterns'));
|
|
103
|
-
this.toolbar.setAttribute('jslog', `${VisualLogging.toolbar()}`);
|
|
104
|
-
|
|
105
179
|
this.list = new UI.ListWidget.ListWidget(this);
|
|
106
180
|
this.list.registerRequiredCSS(blockedURLsPaneStyles);
|
|
107
181
|
this.list.element.classList.add('blocked-urls');
|
|
108
182
|
|
|
109
|
-
this.list.setEmptyPlaceholder(this.createEmptyPlaceholder());
|
|
110
|
-
this.list.show(this.contentElement);
|
|
111
|
-
|
|
112
183
|
this.editor = null;
|
|
113
184
|
|
|
114
185
|
this.blockedCountForUrl = new Map();
|
|
@@ -120,118 +191,177 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
120
191
|
Logs.NetworkLog.NetworkLog.instance().addEventListener(Logs.NetworkLog.Events.Reset, this.onNetworkLogReset, this);
|
|
121
192
|
}
|
|
122
193
|
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const addButton = UI.UIUtils.createTextButton(i18nString(UIStrings.addPattern), this.addPattern.bind(this), {
|
|
135
|
-
className: 'add-button',
|
|
136
|
-
jslogContext: 'network.add-network-request-blocking-pattern',
|
|
137
|
-
variant: Buttons.Button.Variant.TONAL,
|
|
138
|
-
});
|
|
139
|
-
UI.ARIAUtils.setLabel(addButton, i18nString(UIStrings.addNetworkRequestBlockingPattern));
|
|
140
|
-
placeholder.appendChild(addButton);
|
|
141
|
-
return placeholder;
|
|
194
|
+
override performUpdate(): void {
|
|
195
|
+
const enabled = this.manager.blockingEnabled();
|
|
196
|
+
this.list.element.classList.toggle('blocking-disabled', !enabled && Boolean(this.manager.requestConditions.count));
|
|
197
|
+
|
|
198
|
+
const input: ViewInput = {
|
|
199
|
+
addPattern: this.addPattern.bind(this),
|
|
200
|
+
toggleEnabled: this.toggleEnabled.bind(this),
|
|
201
|
+
enabled,
|
|
202
|
+
list: this.list,
|
|
203
|
+
};
|
|
204
|
+
this.#view(input, {}, this.contentElement);
|
|
142
205
|
}
|
|
143
206
|
|
|
144
207
|
addPattern(): void {
|
|
145
208
|
this.manager.setBlockingEnabled(true);
|
|
146
|
-
this.list.addNewItem(
|
|
209
|
+
this.list.addNewItem(
|
|
210
|
+
0, new SDK.NetworkManager.RequestCondition({url: Platform.DevToolsPath.EmptyUrlString, enabled: true}));
|
|
147
211
|
}
|
|
148
212
|
|
|
149
213
|
removeAllPatterns(): void {
|
|
150
|
-
this.manager.
|
|
214
|
+
this.manager.requestConditions.clear();
|
|
151
215
|
}
|
|
152
216
|
|
|
153
|
-
renderItem(
|
|
154
|
-
const count = this.blockedRequestsCount(
|
|
217
|
+
renderItem(condition: SDK.NetworkManager.RequestCondition, editable: boolean, index: number): Element {
|
|
218
|
+
const count = this.blockedRequestsCount(condition);
|
|
155
219
|
const element = document.createElement('div');
|
|
156
220
|
element.classList.add('blocked-url');
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
221
|
+
const toggle = (e: Event): void => {
|
|
222
|
+
if (editable) {
|
|
223
|
+
e.consume(true);
|
|
224
|
+
condition.enabled = !condition.enabled;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const {enabled, originalOrUpgradedURLPattern, constructorStringOrWildcardURL, wildcardURL} = condition;
|
|
229
|
+
|
|
230
|
+
if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
|
|
231
|
+
render(
|
|
232
|
+
// clang-format off
|
|
233
|
+
html`
|
|
234
|
+
<input class=blocked-url-checkbox
|
|
235
|
+
@click=${toggle}
|
|
236
|
+
type=checkbox
|
|
237
|
+
?checked=${enabled}
|
|
238
|
+
?disabled=${!editable || !originalOrUpgradedURLPattern}
|
|
239
|
+
.jslog=${VisualLogging.toggle().track({ change: true })}>
|
|
240
|
+
${originalOrUpgradedURLPattern ? html`
|
|
241
|
+
<devtools-tooltip variant=rich jslogcontext=url-pattern id=url-pattern-${index}>
|
|
242
|
+
<div>hash: ${originalOrUpgradedURLPattern.hash}</div>
|
|
243
|
+
<div>hostname: ${originalOrUpgradedURLPattern.hostname}</div>
|
|
244
|
+
<div>password: ${originalOrUpgradedURLPattern.password}</div>
|
|
245
|
+
<div>pathname: ${originalOrUpgradedURLPattern.pathname}</div>
|
|
246
|
+
<div>port: ${originalOrUpgradedURLPattern.port}</div>
|
|
247
|
+
<div>protocol: ${originalOrUpgradedURLPattern.protocol}</div>
|
|
248
|
+
<div>search: ${originalOrUpgradedURLPattern.search}</div>
|
|
249
|
+
<div>username: ${originalOrUpgradedURLPattern.username}</div>
|
|
250
|
+
<hr />
|
|
251
|
+
${learnMore()}
|
|
252
|
+
</devtools-tooltip>` : nothing}
|
|
253
|
+
${wildcardURL ? html`
|
|
254
|
+
<devtools-icon name=warning-filled class="small warning" aria-details=url-pattern-warning-${index}>
|
|
255
|
+
</devtools-icon>
|
|
256
|
+
<devtools-tooltip variant=rich jslogcontext=url-pattern-warning id=url-pattern-warning-${index}>
|
|
257
|
+
${i18nString(UIStrings.patternWasUpgraded, {PH1: wildcardURL})}
|
|
258
|
+
</devtools-tooltip>
|
|
259
|
+
`: nothing}
|
|
260
|
+
${!originalOrUpgradedURLPattern ? html`
|
|
261
|
+
<devtools-icon name=cross-circle-filled class=small aria-details=url-pattern-error-${index}>
|
|
262
|
+
</devtools-icon>
|
|
263
|
+
<devtools-tooltip variant=rich jslogcontext=url-pattern-warning id=url-pattern-error-${index}>
|
|
264
|
+
${SDK.NetworkManager.RequestURLPattern.isValidPattern(constructorStringOrWildcardURL) ===
|
|
265
|
+
SDK.NetworkManager.RequestURLPatternValidity.HAS_REGEXP_GROUPS
|
|
266
|
+
? i18nString(UIStrings.patternFailedWithRegExpGroups)
|
|
267
|
+
: i18nString(UIStrings.patternFailedToParse)}
|
|
268
|
+
${learnMore()}
|
|
269
|
+
</devtools-tooltip>`: nothing}
|
|
270
|
+
<div @click=${toggle} class=blocked-url-label aria-details=url-pattern-${index}>${constructorStringOrWildcardURL}</div>
|
|
271
|
+
<div class=blocked-url-count>${i18nString(UIStrings.dBlocked, {PH1: count})}</div>`,
|
|
272
|
+
// clang-format on
|
|
273
|
+
element);
|
|
274
|
+
} else {
|
|
275
|
+
render(
|
|
276
|
+
// clang-format off
|
|
277
|
+
html`
|
|
278
|
+
<input class=blocked-url-checkbox
|
|
279
|
+
@click=${toggle}
|
|
280
|
+
type=checkbox
|
|
281
|
+
?checked=${condition.enabled}
|
|
282
|
+
?disabled=${!editable}
|
|
283
|
+
.jslog=${VisualLogging.toggle().track({ change: true })}>
|
|
284
|
+
<div @click=${toggle} class=blocked-url-label>${wildcardURL}</div>
|
|
285
|
+
<div class=blocked-url-count>${i18nString(UIStrings.dBlocked, {PH1: count})}</div>`,
|
|
286
|
+
// clang-format on
|
|
287
|
+
element);
|
|
167
288
|
}
|
|
168
289
|
return element;
|
|
169
290
|
}
|
|
170
291
|
|
|
171
|
-
private togglePattern(pattern: SDK.NetworkManager.BlockedPattern, event: Event): void {
|
|
172
|
-
event.consume(true);
|
|
173
|
-
const patterns = this.manager.blockedPatterns();
|
|
174
|
-
patterns.splice(patterns.indexOf(pattern), 1, {enabled: !pattern.enabled, url: pattern.url});
|
|
175
|
-
this.manager.setBlockedPatterns(patterns);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
292
|
private toggleEnabled(): void {
|
|
179
293
|
this.manager.setBlockingEnabled(!this.manager.blockingEnabled());
|
|
180
294
|
this.update();
|
|
181
295
|
}
|
|
182
296
|
|
|
183
|
-
removeItemRequested(
|
|
184
|
-
|
|
185
|
-
patterns.splice(index, 1);
|
|
186
|
-
this.manager.setBlockedPatterns(patterns);
|
|
297
|
+
removeItemRequested(condition: SDK.NetworkManager.RequestCondition): void {
|
|
298
|
+
this.manager.requestConditions.delete(condition);
|
|
187
299
|
UI.ARIAUtils.LiveAnnouncer.alert(UIStrings.itemDeleted);
|
|
188
300
|
}
|
|
189
301
|
|
|
190
|
-
beginEdit(pattern: SDK.NetworkManager.
|
|
302
|
+
beginEdit(pattern: SDK.NetworkManager.RequestCondition): UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition> {
|
|
191
303
|
this.editor = this.createEditor();
|
|
192
|
-
this.editor.control('url').value =
|
|
304
|
+
this.editor.control('url').value = Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled ?
|
|
305
|
+
pattern.constructorStringOrWildcardURL :
|
|
306
|
+
pattern.wildcardURL ?? '';
|
|
193
307
|
return this.editor;
|
|
194
308
|
}
|
|
195
309
|
|
|
196
310
|
commitEdit(
|
|
197
|
-
item: SDK.NetworkManager.
|
|
311
|
+
item: SDK.NetworkManager.RequestCondition, editor: UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>,
|
|
198
312
|
isNew: boolean): void {
|
|
199
|
-
const
|
|
200
|
-
const
|
|
313
|
+
const constructorString = editor.control('url').value as SDK.NetworkManager.URLPatternConstructorString;
|
|
314
|
+
const pattern = Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled ?
|
|
315
|
+
SDK.NetworkManager.RequestURLPattern.create(constructorString) :
|
|
316
|
+
constructorString;
|
|
317
|
+
if (!pattern) {
|
|
318
|
+
throw new Error('Failed to parse pattern');
|
|
319
|
+
}
|
|
320
|
+
item.pattern = pattern;
|
|
201
321
|
if (isNew) {
|
|
202
|
-
|
|
203
|
-
} else {
|
|
204
|
-
patterns.splice(patterns.indexOf(item), 1, {enabled: true, url});
|
|
322
|
+
this.manager.requestConditions.add(item);
|
|
205
323
|
}
|
|
206
|
-
|
|
207
|
-
this.manager.setBlockedPatterns(patterns);
|
|
208
324
|
}
|
|
209
325
|
|
|
210
|
-
private createEditor(): UI.ListWidget.Editor<SDK.NetworkManager.
|
|
326
|
+
private createEditor(): UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition> {
|
|
211
327
|
if (this.editor) {
|
|
212
328
|
return this.editor;
|
|
213
329
|
}
|
|
214
330
|
|
|
215
|
-
const editor = new UI.ListWidget.Editor<SDK.NetworkManager.
|
|
331
|
+
const editor = new UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>();
|
|
216
332
|
const content = editor.contentElement();
|
|
217
333
|
const titles = content.createChild('div', 'blocked-url-edit-row');
|
|
218
|
-
titles.createChild('div')
|
|
334
|
+
const label = titles.createChild('div');
|
|
335
|
+
if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
|
|
336
|
+
label.textContent = i18nString(UIStrings.textPatternToBlockMatchingURLPatterns);
|
|
337
|
+
label.append(UI.XLink.XLink.create(
|
|
338
|
+
PATTERN_API_DOCS_URL, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more'));
|
|
339
|
+
} else {
|
|
340
|
+
label.textContent = i18nString(UIStrings.textPatternToBlockMatching);
|
|
341
|
+
}
|
|
219
342
|
const fields = content.createChild('div', 'blocked-url-edit-row');
|
|
220
|
-
const validator =
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
343
|
+
const validator =
|
|
344
|
+
(_item: SDK.NetworkManager.RequestCondition, _index: number, input: UI.ListWidget.EditorControl): {
|
|
345
|
+
valid: boolean,
|
|
346
|
+
errorMessage: Common.UIString.LocalizedString|undefined,
|
|
347
|
+
} => {
|
|
348
|
+
if (!input.value) {
|
|
349
|
+
return {errorMessage: i18nString(UIStrings.patternInputCannotBeEmpty), valid: false};
|
|
350
|
+
}
|
|
351
|
+
if (this.manager.requestConditions.has(input.value)) {
|
|
352
|
+
return {errorMessage: i18nString(UIStrings.patternAlreadyExists), valid: false};
|
|
353
|
+
}
|
|
354
|
+
if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
|
|
355
|
+
const isValid = SDK.NetworkManager.RequestURLPattern.isValidPattern(input.value);
|
|
356
|
+
switch (isValid) {
|
|
357
|
+
case SDK.NetworkManager.RequestURLPatternValidity.FAILED_TO_PARSE:
|
|
358
|
+
return {errorMessage: i18nString(UIStrings.patternFailedToParse), valid: false};
|
|
359
|
+
case SDK.NetworkManager.RequestURLPatternValidity.HAS_REGEXP_GROUPS:
|
|
360
|
+
return {errorMessage: i18nString(UIStrings.patternFailedWithRegExpGroups), valid: false};
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return {valid: true, errorMessage: undefined};
|
|
364
|
+
};
|
|
235
365
|
const urlInput = editor.createInput('url', 'text', '', validator);
|
|
236
366
|
fields.createChild('div', 'blocked-url-edit-value').appendChild(urlInput);
|
|
237
367
|
return editor;
|
|
@@ -239,23 +369,22 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
239
369
|
|
|
240
370
|
update(): void {
|
|
241
371
|
const enabled = this.manager.blockingEnabled();
|
|
242
|
-
this.list.element.classList.toggle('blocking-disabled', !enabled && Boolean(this.manager.blockedPatterns().length));
|
|
243
|
-
|
|
244
|
-
this.enabledCheckbox.setChecked(enabled);
|
|
245
372
|
this.list.clear();
|
|
246
|
-
for (const pattern of this.manager.
|
|
247
|
-
|
|
373
|
+
for (const pattern of this.manager.requestConditions.conditions) {
|
|
374
|
+
if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled || pattern.wildcardURL) {
|
|
375
|
+
this.list.appendItem(pattern, enabled);
|
|
376
|
+
}
|
|
248
377
|
}
|
|
378
|
+
this.requestUpdate();
|
|
249
379
|
}
|
|
250
380
|
|
|
251
|
-
private blockedRequestsCount(
|
|
252
|
-
if (!url) {
|
|
253
|
-
return 0;
|
|
254
|
-
}
|
|
255
|
-
|
|
381
|
+
private blockedRequestsCount(condition: SDK.NetworkManager.RequestCondition): number {
|
|
256
382
|
let result = 0;
|
|
257
383
|
for (const blockedUrl of this.blockedCountForUrl.keys()) {
|
|
258
|
-
|
|
384
|
+
const match = Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled ?
|
|
385
|
+
condition.originalOrUpgradedURLPattern?.test(blockedUrl) :
|
|
386
|
+
(condition.wildcardURL && this.matches(condition.wildcardURL, blockedUrl));
|
|
387
|
+
if (match) {
|
|
259
388
|
result += (this.blockedCountForUrl.get(blockedUrl) as number);
|
|
260
389
|
}
|
|
261
390
|
}
|
|
@@ -268,6 +268,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
override willHide(): void {
|
|
271
|
+
super.willHide();
|
|
271
272
|
this.#request.removeEventListener(
|
|
272
273
|
SDK.NetworkRequest.Events.REQUEST_HEADERS_CHANGED, this.requestHeadersChanged, this);
|
|
273
274
|
this.#request.removeEventListener(
|
|
@@ -1390,6 +1390,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1390
1390
|
}
|
|
1391
1391
|
|
|
1392
1392
|
override willHide(): void {
|
|
1393
|
+
super.willHide();
|
|
1393
1394
|
this.columnsInternal.willHide();
|
|
1394
1395
|
}
|
|
1395
1396
|
|
|
@@ -1847,23 +1848,24 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1847
1848
|
if (request) {
|
|
1848
1849
|
const maxBlockedURLLength = 20;
|
|
1849
1850
|
const manager = SDK.NetworkManager.MultitargetNetworkManager.instance();
|
|
1850
|
-
let patterns = manager.blockedPatterns();
|
|
1851
1851
|
|
|
1852
1852
|
function addBlockedURL(url: string): void {
|
|
1853
|
-
|
|
1854
|
-
|
|
1853
|
+
manager.requestConditions.add(
|
|
1854
|
+
new SDK.NetworkManager.RequestCondition({enabled: true, url: url as Platform.DevToolsPath.UrlString}));
|
|
1855
1855
|
manager.setBlockingEnabled(true);
|
|
1856
1856
|
void UI.ViewManager.ViewManager.instance().showView('network.blocked-urls');
|
|
1857
1857
|
}
|
|
1858
1858
|
|
|
1859
1859
|
function removeBlockedURL(url: string): void {
|
|
1860
|
-
|
|
1861
|
-
|
|
1860
|
+
const entry = manager.requestConditions.findCondition(url);
|
|
1861
|
+
if (entry) {
|
|
1862
|
+
manager.requestConditions.delete(entry);
|
|
1863
|
+
}
|
|
1862
1864
|
void UI.ViewManager.ViewManager.instance().showView('network.blocked-urls');
|
|
1863
1865
|
}
|
|
1864
1866
|
|
|
1865
1867
|
const urlWithoutScheme = request.parsedURL.urlWithoutScheme();
|
|
1866
|
-
if (urlWithoutScheme && !
|
|
1868
|
+
if (urlWithoutScheme && !manager.requestConditions.has(urlWithoutScheme)) {
|
|
1867
1869
|
contextMenu.debugSection().appendItem(
|
|
1868
1870
|
i18nString(UIStrings.blockRequestUrl), addBlockedURL.bind(null, urlWithoutScheme),
|
|
1869
1871
|
{jslogContext: 'block-request-url'});
|
|
@@ -1875,7 +1877,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1875
1877
|
}
|
|
1876
1878
|
|
|
1877
1879
|
const domain = request.parsedURL.domain();
|
|
1878
|
-
if (domain && !
|
|
1880
|
+
if (domain && !manager.requestConditions.has(domain)) {
|
|
1879
1881
|
contextMenu.debugSection().appendItem(
|
|
1880
1882
|
i18nString(UIStrings.blockRequestDomain), addBlockedURL.bind(null, domain),
|
|
1881
1883
|
{jslogContext: 'block-request-domain'});
|
|
@@ -317,6 +317,7 @@ export class RequestCookiesView extends UI.Widget.Widget {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
override willHide(): void {
|
|
320
|
+
super.willHide();
|
|
320
321
|
this.request.removeEventListener(
|
|
321
322
|
SDK.NetworkRequest.Events.REQUEST_HEADERS_CHANGED, this.refreshRequestCookiesView, this);
|
|
322
323
|
this.request.removeEventListener(
|
|
@@ -634,6 +634,7 @@ export class RequestTimingView extends UI.Widget.VBox {
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
override wasShown(): void {
|
|
637
|
+
super.wasShown();
|
|
637
638
|
this.request.addEventListener(SDK.NetworkRequest.Events.TIMING_CHANGED, this.refresh, this);
|
|
638
639
|
this.request.addEventListener(SDK.NetworkRequest.Events.FINISHED_LOADING, this.refresh, this);
|
|
639
640
|
this.calculator.addEventListener(NetworkTimeCalculator.Events.BOUNDARIES_CHANGED, this.boundaryChanged, this);
|
|
@@ -641,6 +642,7 @@ export class RequestTimingView extends UI.Widget.VBox {
|
|
|
641
642
|
}
|
|
642
643
|
|
|
643
644
|
override willHide(): void {
|
|
645
|
+
super.willHide();
|
|
644
646
|
this.request.removeEventListener(SDK.NetworkRequest.Events.TIMING_CHANGED, this.refresh, this);
|
|
645
647
|
this.request.removeEventListener(SDK.NetworkRequest.Events.FINISHED_LOADING, this.refresh, this);
|
|
646
648
|
this.calculator.removeEventListener(NetworkTimeCalculator.Events.BOUNDARIES_CHANGED, this.boundaryChanged, this);
|
|
@@ -79,6 +79,7 @@ export class ResourceDirectSocketChunkView extends ResourceChunkView<SDK.Network
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
override willHide(): void {
|
|
82
|
+
super.willHide();
|
|
82
83
|
this.request.removeEventListener(
|
|
83
84
|
SDK.NetworkRequest.Events.DIRECTSOCKET_CHUNK_ADDED, this.onDirectSocketChunkAdded, this);
|
|
84
85
|
}
|
|
@@ -120,6 +120,7 @@ export class ResourceWebSocketFrameView extends ResourceChunkView<SDK.NetworkReq
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
override willHide(): void {
|
|
123
|
+
super.willHide();
|
|
123
124
|
this.request.removeEventListener(SDK.NetworkRequest.Events.WEBSOCKET_FRAME_ADDED, this.onWebSocketFrameAdded, this);
|
|
124
125
|
}
|
|
125
126
|
|
|
@@ -127,6 +127,7 @@ export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableCom
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
override wasShown(): void {
|
|
130
|
+
super.wasShown();
|
|
130
131
|
this.#request.addEventListener(SDK.NetworkRequest.Events.REMOTE_ADDRESS_CHANGED, this.#refreshHeadersView, this);
|
|
131
132
|
this.#request.addEventListener(SDK.NetworkRequest.Events.FINISHED_LOADING, this.#refreshHeadersView, this);
|
|
132
133
|
this.#request.addEventListener(SDK.NetworkRequest.Events.REQUEST_HEADERS_CHANGED, this.#refreshHeadersView, this);
|
|
@@ -137,6 +138,7 @@ export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableCom
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
override willHide(): void {
|
|
141
|
+
super.willHide();
|
|
140
142
|
this.#request.removeEventListener(SDK.NetworkRequest.Events.REMOTE_ADDRESS_CHANGED, this.#refreshHeadersView, this);
|
|
141
143
|
this.#request.removeEventListener(SDK.NetworkRequest.Events.FINISHED_LOADING, this.#refreshHeadersView, this);
|
|
142
144
|
this.#request.removeEventListener(
|