chrome-devtools-frontend 1.0.1522145 → 1.0.1524741
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 +1 -0
- package/docs/README.md +1 -0
- package/docs/policy/README.md +1 -0
- package/docs/policy/console-policy.md +144 -0
- package/docs/policy/images/console-policy1.png +0 -0
- package/docs/policy/images/console-policy2.png +0 -0
- package/docs/policy/images/console-policy3.png +0 -0
- package/docs/ui_engineering.md +98 -0
- package/front_end/Tests.js +1 -1
- package/front_end/core/common/Color.ts +13 -9
- package/front_end/core/common/ColorConverter.ts +9 -7
- package/front_end/core/common/Gzip.ts +1 -1
- package/front_end/core/common/MapWithDefault.ts +5 -3
- package/front_end/core/common/ResourceType.ts +0 -12
- package/front_end/core/common/ReturnToPanel.ts +6 -4
- package/front_end/core/common/Trie.ts +4 -2
- package/front_end/core/host/AidaClient.ts +3 -3
- package/front_end/core/host/GdpClient.ts +7 -5
- package/front_end/core/host/InspectorFrontendHostAPI.ts +7 -5
- package/front_end/core/host/Platform.ts +5 -3
- package/front_end/core/host/UserMetrics.ts +6 -4
- package/front_end/core/platform/ArrayUtilities.ts +1 -1
- package/front_end/core/platform/StringUtilities.ts +34 -31
- package/front_end/core/root/Runtime.ts +1 -1
- package/front_end/core/sdk/CSSMetadata.ts +6 -4
- package/front_end/core/sdk/CSSPropertyParser.ts +17 -13
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +19 -13
- package/front_end/core/sdk/ChildTargetManager.ts +35 -0
- package/front_end/core/sdk/DOMModel.ts +1 -1
- package/front_end/core/sdk/EnhancedTracesParser.ts +13 -6
- package/front_end/core/sdk/EventBreakpointsModel.ts +4 -2
- package/front_end/core/sdk/HttpReasonPhraseStrings.ts +4 -2
- package/front_end/core/sdk/NetworkManager.ts +8 -48
- package/front_end/core/sdk/NetworkRequest.ts +0 -28
- package/front_end/core/sdk/PageResourceLoader.ts +1 -1
- package/front_end/core/sdk/PreloadingModel.ts +22 -18
- package/front_end/core/sdk/RehydratingConnection.ts +1 -1
- package/front_end/core/sdk/RehydratingObject.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +1 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +2 -0
- package/front_end/core/sdk/ScreenCaptureModel.ts +24 -20
- package/front_end/core/sdk/Target.ts +7 -1
- package/front_end/core/sdk/TraceObject.ts +2 -2
- package/front_end/entrypoints/formatter_worker/Substitute.ts +6 -4
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -16
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -1
- package/front_end/entrypoints/main/MainImpl.ts +6 -4
- package/front_end/generated/Deprecation.ts +4 -4
- package/front_end/generated/InspectorBackendCommands.js +2 -2
- package/front_end/generated/protocol-mapping.d.ts +3 -2
- package/front_end/generated/protocol-proxy-api.d.ts +3 -1
- package/front_end/generated/protocol.ts +7 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +600 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +83 -222
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +23 -0
- package/front_end/models/ai_assistance/performance/AIContext.ts +19 -4
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +4 -2
- package/front_end/models/autofill_manager/AutofillManager.ts +4 -2
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +1 -1
- package/front_end/models/crux-manager/CrUXManager.ts +1 -1
- package/front_end/models/extensions/HostUrlPattern.ts +13 -5
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +1 -1
- package/front_end/models/issues_manager/CookieIssue.ts +2 -2
- package/front_end/models/issues_manager/MarkdownIssueDescription.ts +1 -1
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +20 -0
- package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +9 -1
- package/front_end/models/network_time_calculator/Calculator.ts +4 -2
- package/front_end/models/network_time_calculator/RequestTimeRanges.ts +6 -4
- package/front_end/models/source_map_scopes/NamesResolver.ts +7 -5
- package/front_end/models/text_utils/ContentProvider.ts +6 -4
- package/front_end/models/trace/LanternComputationData.ts +1 -0
- package/front_end/models/trace/extras/TraceTree.ts +1 -1
- package/front_end/models/trace/handlers/FramesHandler.ts +7 -5
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +13 -7
- package/front_end/models/trace/handlers/MetaHandler.ts +16 -14
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +30 -8
- package/front_end/models/trace/handlers/helpers.ts +1 -1
- package/front_end/models/trace/handlers/types.ts +23 -19
- package/front_end/models/trace/helpers/Timing.ts +4 -2
- package/front_end/models/trace/helpers/Trace.ts +8 -4
- package/front_end/models/trace/insights/DocumentLatency.ts +10 -11
- package/front_end/models/trace/insights/INPBreakdown.ts +13 -2
- package/front_end/models/trace/insights/LCPBreakdown.ts +14 -2
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -2
- package/front_end/models/trace/types/File.ts +12 -8
- package/front_end/models/trace/types/Timing.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +43 -28
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
- package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +12 -10
- package/front_end/panels/application/KeyValueStorageItemsView.ts +31 -33
- package/front_end/panels/application/components/InterestGroupAccessGrid.ts +6 -11
- package/front_end/panels/application/components/OriginTrialTreeView.ts +7 -5
- package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -0
- package/front_end/panels/application/components/ReportsGrid.ts +4 -10
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -13
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -7
- package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +3 -10
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -2
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +7 -5
- package/front_end/panels/changes/ChangesSidebar.ts +97 -95
- package/front_end/panels/changes/changesSidebar.css +3 -0
- package/front_end/panels/console/ConsoleView.ts +2 -2
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +22 -35
- package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +12 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +9 -5
- package/front_end/panels/elements/ElementsTreeOutline.ts +11 -8
- package/front_end/panels/elements/PropertyRenderer.ts +19 -15
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -4
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +4 -2
- package/front_end/panels/elements/components/AdornerManager.ts +5 -3
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +6 -4
- package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -44
- package/front_end/panels/network/NetworkLogView.ts +6 -4
- package/front_end/panels/network/RequestPreviewView.ts +0 -7
- package/front_end/panels/network/components/RequestHeadersView.ts +0 -6
- package/front_end/panels/network/components/components.ts +0 -2
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +4 -2
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +40 -48
- package/front_end/panels/search/SearchResultsPane.ts +2 -3
- package/front_end/panels/security/IPProtectionView.ts +1 -1
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +4 -0
- package/front_end/panels/settings/emulation/utils/StructuredHeaders.ts +45 -37
- package/front_end/panels/sources/BreakpointsViewUtils.ts +11 -9
- package/front_end/panels/sources/DebuggerPlugin.ts +8 -4
- package/front_end/panels/sources/SourcesPanel.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +4 -2
- package/front_end/panels/timeline/CountersGraph.ts +12 -5
- package/front_end/panels/timeline/EasterEgg.d.ts +5 -3
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +8 -6
- package/front_end/panels/timeline/ModificationsManager.ts +5 -3
- package/front_end/panels/timeline/ThreadAppender.ts +7 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -8
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +17 -0
- package/front_end/panels/timeline/TimelinePanel.ts +15 -8
- package/front_end/panels/timeline/TimelineSelection.ts +4 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +17 -6
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +6 -4
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +21 -9
- package/front_end/panels/timeline/components/Utils.ts +1 -1
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -3
- package/front_end/panels/timeline/timelineDetailsView.css +5 -0
- package/front_end/panels/timeline/utils/Helpers.ts +1 -1
- package/front_end/panels/utils/utils.ts +1 -7
- package/front_end/services/trace_bounds/TraceBounds.ts +4 -2
- package/front_end/services/tracing/PerformanceTracing.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/package.json +3 -2
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts +8 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js +8 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +28 -30
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +27 -29
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +34 -38
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +34 -38
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js +12 -14
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +92 -108
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +33 -39
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +14 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +12 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +24 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +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 +3 -0
- 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/PredefinedNetworkConditions.d.ts +13 -22
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts +6 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js +6 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +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/node/BrowserLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +6 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts +5 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +5 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +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/es5-iife/puppeteer-core-browser.d.ts +188 -224
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +140 -166
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts +8 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js +8 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +28 -30
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +27 -29
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +34 -38
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +34 -38
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js +12 -14
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +92 -108
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +33 -39
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +15 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +12 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +24 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
- 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 +3 -0
- 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/PredefinedNetworkConditions.d.ts +13 -22
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts +6 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js +6 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +6 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts +5 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +5 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.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/types.d.ts +188 -224
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +8 -10
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +27 -29
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +34 -38
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +17 -14
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +92 -108
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +5 -3
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +28 -3
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +16 -7
- package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +28 -2
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/PredefinedNetworkConditions.ts +13 -22
- package/front_end/third_party/puppeteer/package/src/common/Device.ts +6 -8
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +6 -3
- package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +5 -7
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/ui/components/chrome_link/ChromeLink.ts +4 -2
- package/front_end/ui/components/dialogs/Dialog.ts +13 -9
- package/front_end/ui/components/highlighting/HighlightElement.ts +77 -0
- package/front_end/ui/components/highlighting/HighlightManager.ts +37 -0
- package/front_end/ui/components/highlighting/highlighting.ts +2 -0
- package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +5 -3
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -3
- package/front_end/ui/components/menus/SelectMenu.ts +6 -4
- package/front_end/ui/components/survey_link/SurveyLink.ts +4 -2
- package/front_end/ui/components/text_editor/config.ts +10 -6
- package/front_end/ui/components/text_editor/javascript.ts +8 -4
- package/front_end/ui/components/tooltips/Tooltip.ts +13 -4
- package/front_end/ui/legacy/ForwardedInputEventHandler.ts +4 -2
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/SettingsUI.ts +1 -5
- package/front_end/ui/legacy/Treeoutline.ts +12 -33
- package/front_end/ui/legacy/UIUtils.ts +19 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +12 -10
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +30 -32
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +25 -25
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +4 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -2
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -6
- package/front_end/ui/legacy/components/perf_ui/PieChart.ts +6 -4
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +22 -16
- package/front_end/ui/legacy/components/source_frame/xmlView.css +0 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +6 -4
- package/front_end/ui/visual_logging/Debugging.ts +10 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -3
- package/inspector_overlay/common.ts +5 -3
- package/inspector_overlay/highlight_grid_common.ts +1 -1
- package/package.json +1 -1
- package/front_end/Images/src/bundle.svg +0 -3
- package/front_end/panels/network/components/WebBundleInfoView.css +0 -27
- package/front_end/panels/network/components/WebBundleInfoView.ts +0 -95
|
@@ -7,6 +7,7 @@ import * as i18n from '../../../core/i18n/i18n.js';
|
|
|
7
7
|
import * as Platform from '../../../core/platform/platform.js';
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
9
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
|
+
import type * as Protocol from '../../../generated/protocol.js';
|
|
10
11
|
import {ChangeManager} from '../ChangeManager.js';
|
|
11
12
|
import {debugLog} from '../debug.js';
|
|
12
13
|
import {EvaluateAction, formatError, SideEffectError} from '../EvaluateAction.js';
|
|
@@ -228,10 +229,6 @@ export class NodeContext extends ConversationContext<SDK.DOMModel.DOMNode> {
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
type Relation = 'currentElement'|'parentElement';
|
|
232
|
-
|
|
233
|
-
const enableDedicatedStyleFunctions = false;
|
|
234
|
-
|
|
235
232
|
/**
|
|
236
233
|
* One agent instance handles one conversation. Create a new agent
|
|
237
234
|
* instance for a new conversation.
|
|
@@ -289,107 +286,57 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
|
|
|
289
286
|
this,
|
|
290
287
|
);
|
|
291
288
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
description: 'A computed style property name to retrieve. For example, \'background-color\'.'
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
displayInfoFromArgs: params => {
|
|
329
|
-
return {
|
|
330
|
-
title: 'Reading computed styles',
|
|
331
|
-
thought: params.thought,
|
|
332
|
-
action: `getComputedStyles(${JSON.stringify(params.relations)}, ${JSON.stringify(params.properties)})`,
|
|
333
|
-
};
|
|
334
|
-
},
|
|
335
|
-
handler: async (
|
|
336
|
-
params,
|
|
337
|
-
options,
|
|
338
|
-
) => {
|
|
339
|
-
return await this.getComputedStyles(params.relations, params.properties, options);
|
|
340
|
-
},
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
this.declareFunction<{
|
|
344
|
-
relations: Relation[],
|
|
345
|
-
properties: string[],
|
|
346
|
-
thought: string,
|
|
347
|
-
}>('getAuthoredStyles', {
|
|
348
|
-
description: 'Call this function to get the styles as specified by the page author.',
|
|
349
|
-
parameters: {
|
|
350
|
-
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
351
|
-
description: '',
|
|
352
|
-
nullable: false,
|
|
353
|
-
properties: {
|
|
354
|
-
thought: {
|
|
289
|
+
this.declareFunction<{
|
|
290
|
+
elements: string[],
|
|
291
|
+
styleProperties: string[],
|
|
292
|
+
explanation: string,
|
|
293
|
+
}>('getStyles', {
|
|
294
|
+
description:
|
|
295
|
+
`Get computed and source styles for one or multiple elements on the inspected page for multiple elements at once by uid.
|
|
296
|
+
|
|
297
|
+
**CRITICAL** Use selectors to refer to elements in the text output. Do not use uids.
|
|
298
|
+
**CRITICAL** Always provide the explanation argument to explain what and why you query.`,
|
|
299
|
+
parameters: {
|
|
300
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
301
|
+
description: '',
|
|
302
|
+
nullable: false,
|
|
303
|
+
properties: {
|
|
304
|
+
explanation: {
|
|
305
|
+
type: Host.AidaClient.ParametersTypes.STRING,
|
|
306
|
+
description: 'Explain why you want to get styles',
|
|
307
|
+
nullable: false,
|
|
308
|
+
},
|
|
309
|
+
elements: {
|
|
310
|
+
type: Host.AidaClient.ParametersTypes.ARRAY,
|
|
311
|
+
description: 'A list of element uids to get data for',
|
|
312
|
+
items: {type: Host.AidaClient.ParametersTypes.STRING, description: `An element uid.`},
|
|
313
|
+
nullable: false,
|
|
314
|
+
},
|
|
315
|
+
styleProperties: {
|
|
316
|
+
type: Host.AidaClient.ParametersTypes.ARRAY,
|
|
317
|
+
description: 'One or more CSS style property names to fetch.',
|
|
318
|
+
nullable: false,
|
|
319
|
+
items: {
|
|
355
320
|
type: Host.AidaClient.ParametersTypes.STRING,
|
|
356
|
-
description: '
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
},
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
displayInfoFromArgs: params => {
|
|
379
|
-
return {
|
|
380
|
-
title: 'Reading authored styles',
|
|
381
|
-
thought: params.thought,
|
|
382
|
-
action: `getAuthoredStyles(${JSON.stringify(params.relations)}, ${JSON.stringify(params.properties)})`,
|
|
383
|
-
};
|
|
384
|
-
},
|
|
385
|
-
handler: async (
|
|
386
|
-
params,
|
|
387
|
-
options,
|
|
388
|
-
) => {
|
|
389
|
-
return await this.getAuthoredStyles(params.relations, params.properties, options);
|
|
390
|
-
},
|
|
391
|
-
});
|
|
392
|
-
}
|
|
321
|
+
description: 'A CSS style property name to retrieve. For example, \'background-color\'.'
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
displayInfoFromArgs: params => {
|
|
327
|
+
return {
|
|
328
|
+
title: 'Reading computed and source styles',
|
|
329
|
+
thought: params.explanation,
|
|
330
|
+
action: `getStyles(${JSON.stringify(params.elements)}, ${JSON.stringify(params.styleProperties)})`,
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
handler: async (
|
|
334
|
+
params,
|
|
335
|
+
options,
|
|
336
|
+
) => {
|
|
337
|
+
return await this.getStyles(params.elements, params.styleProperties, options);
|
|
338
|
+
},
|
|
339
|
+
});
|
|
393
340
|
|
|
394
341
|
this.declareFunction<{
|
|
395
342
|
title: string,
|
|
@@ -413,28 +360,10 @@ Call this function to gather additional information or modify the page state. Ca
|
|
|
413
360
|
|
|
414
361
|
* To return data, define a top-level \`data\` variable and populate it with data you want to get. Only JSON-serializable objects can be assigned to \`data\`.
|
|
415
362
|
* If you modify styles on an element, ALWAYS call the pre-defined global \`async setElementStyles(el: Element, styles: object)\` function. This function is an internal mechanism for you and should never be presented as a command/advice to the user.
|
|
416
|
-
* Use \`window.getComputedStyle\` to gather **computed** styles and make sure that you take the distinction between authored styles and computed styles into account.
|
|
417
363
|
* **CRITICAL** Only get styles that might be relevant to the user request.
|
|
418
|
-
* **CRITICAL** Call \`window.getComputedStyle\` only once per element and store results into a local variable. Never try to return all the styles of the element in \`data\`.
|
|
419
364
|
* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.
|
|
420
365
|
* **CRITICAL** Consider that \`data\` variable from the previous function calls are not available in a new function call.
|
|
421
366
|
|
|
422
|
-
For example, the code to return basic styles:
|
|
423
|
-
|
|
424
|
-
\`\`\`
|
|
425
|
-
const styles = window.getComputedStyle($0);
|
|
426
|
-
const data = {
|
|
427
|
-
display: styles['display'],
|
|
428
|
-
visibility: styles['visibility'],
|
|
429
|
-
position: styles['position'],
|
|
430
|
-
left: styles['right'],
|
|
431
|
-
top: styles['top'],
|
|
432
|
-
width: styles['width'],
|
|
433
|
-
height: styles['height'],
|
|
434
|
-
zIndex: styles['z-index']
|
|
435
|
-
};
|
|
436
|
-
\`\`\`
|
|
437
|
-
|
|
438
367
|
For example, the code to change element styles:
|
|
439
368
|
|
|
440
369
|
\`\`\`
|
|
@@ -443,59 +372,10 @@ await setElementStyles($0, {
|
|
|
443
372
|
});
|
|
444
373
|
\`\`\`
|
|
445
374
|
|
|
446
|
-
For example, the code to get
|
|
447
|
-
|
|
448
|
-
\`\`\`
|
|
449
|
-
const styles = window.getComputedStyle($0);
|
|
450
|
-
const parentStyles = window.getComputedStyle($0.parentElement);
|
|
451
|
-
const data = {
|
|
452
|
-
currentElementStyles: {
|
|
453
|
-
display: styles['display'],
|
|
454
|
-
visibility: styles['visibility'],
|
|
455
|
-
position: styles['position'],
|
|
456
|
-
left: styles['right'],
|
|
457
|
-
top: styles['top'],
|
|
458
|
-
width: styles['width'],
|
|
459
|
-
height: styles['height'],
|
|
460
|
-
zIndex: styles['z-index'],
|
|
461
|
-
},
|
|
462
|
-
parentElementStyles: {
|
|
463
|
-
display: parentStyles['display'],
|
|
464
|
-
visibility: parentStyles['visibility'],
|
|
465
|
-
position: parentStyles['position'],
|
|
466
|
-
left: parentStyles['right'],
|
|
467
|
-
top: parentStyles['top'],
|
|
468
|
-
width: parentStyles['width'],
|
|
469
|
-
height: parentStyles['height'],
|
|
470
|
-
zIndex: parentStyles['z-index'],
|
|
471
|
-
},
|
|
472
|
-
};
|
|
473
|
-
\`\`\`
|
|
474
|
-
|
|
475
|
-
For example, the code to get check siblings and overlapping elements:
|
|
375
|
+
For example, the code to get overlapping elements:
|
|
476
376
|
|
|
477
377
|
\`\`\`
|
|
478
|
-
const computedStyles = window.getComputedStyle($0);
|
|
479
|
-
const parentComputedStyles = window.getComputedStyle($0.parentElement);
|
|
480
378
|
const data = {
|
|
481
|
-
numberOfChildren: $0.children.length,
|
|
482
|
-
numberOfSiblings: $0.parentElement.children.length,
|
|
483
|
-
hasPreviousSibling: !!$0.previousElementSibling,
|
|
484
|
-
hasNextSibling: !!$0.nextElementSibling,
|
|
485
|
-
elementStyles: {
|
|
486
|
-
display: computedStyles['display'],
|
|
487
|
-
visibility: computedStyles['visibility'],
|
|
488
|
-
position: computedStyles['position'],
|
|
489
|
-
clipPath: computedStyles['clip-path'],
|
|
490
|
-
zIndex: computedStyles['z-index']
|
|
491
|
-
},
|
|
492
|
-
parentStyles: {
|
|
493
|
-
display: parentComputedStyles['display'],
|
|
494
|
-
visibility: parentComputedStyles['visibility'],
|
|
495
|
-
position: parentComputedStyles['position'],
|
|
496
|
-
clipPath: parentComputedStyles['clip-path'],
|
|
497
|
-
zIndex: parentComputedStyles['z-index']
|
|
498
|
-
},
|
|
499
379
|
overlappingElements: Array.from(document.querySelectorAll('*'))
|
|
500
380
|
.filter(el => {
|
|
501
381
|
const rect = el.getBoundingClientRect();
|
|
@@ -611,7 +491,8 @@ const data = {
|
|
|
611
491
|
}
|
|
612
492
|
|
|
613
493
|
static async describeElement(element: SDK.DOMModel.DOMNode): Promise<string> {
|
|
614
|
-
let output = `*
|
|
494
|
+
let output = `* Element's uid is ${element.backendNodeId()}.
|
|
495
|
+
* Its selector is \`${element.simpleSelector()}\``;
|
|
615
496
|
const childNodes = await element.getChildNodesPromise();
|
|
616
497
|
if (childNodes) {
|
|
617
498
|
const textChildNodes = childNodes.filter(childNode => childNode.nodeType() === Node.TEXT_NODE);
|
|
@@ -625,7 +506,7 @@ const data = {
|
|
|
625
506
|
break;
|
|
626
507
|
default:
|
|
627
508
|
output += `\n* It has ${elementChildNodes.length} child element nodes: ${
|
|
628
|
-
elementChildNodes.map(node => `\`${node.simpleSelector()}
|
|
509
|
+
elementChildNodes.map(node => `\`${node.simpleSelector()}\` (uid=${node.backendNodeId()})`).join(', ')}`;
|
|
629
510
|
}
|
|
630
511
|
|
|
631
512
|
switch (textChildNodes.length) {
|
|
@@ -641,14 +522,16 @@ const data = {
|
|
|
641
522
|
}
|
|
642
523
|
|
|
643
524
|
if (element.nextSibling) {
|
|
644
|
-
const elementOrNodeElementNodeText =
|
|
645
|
-
element.nextSibling.
|
|
525
|
+
const elementOrNodeElementNodeText = element.nextSibling.nodeType() === Node.ELEMENT_NODE ?
|
|
526
|
+
`an element (uid=${element.nextSibling.backendNodeId()})` :
|
|
527
|
+
'a non element';
|
|
646
528
|
output += `\n* It has a next sibling and it is ${elementOrNodeElementNodeText} node`;
|
|
647
529
|
}
|
|
648
530
|
|
|
649
531
|
if (element.previousSibling) {
|
|
650
|
-
const elementOrNodeElementNodeText =
|
|
651
|
-
element.previousSibling.
|
|
532
|
+
const elementOrNodeElementNodeText = element.previousSibling.nodeType() === Node.ELEMENT_NODE ?
|
|
533
|
+
`an element (uid=${element.previousSibling.backendNodeId()})` :
|
|
534
|
+
'a non element';
|
|
652
535
|
output += `\n* It has a previous sibling and it is ${elementOrNodeElementNodeText} node`;
|
|
653
536
|
}
|
|
654
537
|
|
|
@@ -659,7 +542,7 @@ const data = {
|
|
|
659
542
|
const parentNode = element.parentNode;
|
|
660
543
|
if (parentNode) {
|
|
661
544
|
const parentChildrenNodes = await parentNode.getChildNodesPromise();
|
|
662
|
-
output += `\n* Its parent's selector is \`${parentNode.simpleSelector()}
|
|
545
|
+
output += `\n* Its parent's selector is \`${parentNode.simpleSelector()}\` (uid=${parentNode.backendNodeId()})`;
|
|
663
546
|
const elementOrNodeElementNodeText = parentNode.nodeType() === Node.ELEMENT_NODE ? 'an element' : 'a non element';
|
|
664
547
|
output += `\n* Its parent is ${elementOrNodeElementNodeText} node`;
|
|
665
548
|
if (parentNode.isShadowRoot()) {
|
|
@@ -676,7 +559,8 @@ const data = {
|
|
|
676
559
|
break;
|
|
677
560
|
default:
|
|
678
561
|
output += `\n* Its parent has ${childElementNodes.length} child element nodes: ${
|
|
679
|
-
childElementNodes.map(node => `\`${node.simpleSelector()}
|
|
562
|
+
childElementNodes.map(node => `\`${node.simpleSelector()}\` (uid=${node.backendNodeId()})`)
|
|
563
|
+
.join(', ')}`;
|
|
680
564
|
break;
|
|
681
565
|
}
|
|
682
566
|
|
|
@@ -702,58 +586,35 @@ const data = {
|
|
|
702
586
|
return this.context?.getItem() ?? null;
|
|
703
587
|
}
|
|
704
588
|
|
|
705
|
-
async
|
|
589
|
+
async getStyles(elements: string[], properties: string[], _options?: {
|
|
706
590
|
signal?: AbortSignal,
|
|
707
591
|
approved?: boolean,
|
|
708
592
|
}): Promise<FunctionCallHandlerResult<unknown>> {
|
|
709
|
-
const result:
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
593
|
+
const result:
|
|
594
|
+
Record<string, {computed: Record<string, string|undefined>, authored: Record<string, string|undefined>}> = {};
|
|
595
|
+
for (const uid of elements) {
|
|
596
|
+
result[uid] = {computed: {}, authored: {}};
|
|
597
|
+
debugLog(`Action to execute: uid=${uid}`);
|
|
598
|
+
const selectedNode = this.#getSelectedNode();
|
|
714
599
|
if (!selectedNode) {
|
|
715
600
|
return {error: 'Error: Could not find the currently selected element.'};
|
|
716
601
|
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
if (!
|
|
721
|
-
return {error: 'Error: Could not find the
|
|
602
|
+
const node = new SDK.DOMModel.DeferredDOMNode(
|
|
603
|
+
selectedNode.domModel().target(), Number(uid) as unknown as Protocol.DOM.BackendNodeId);
|
|
604
|
+
const resolved = await node.resolvePromise();
|
|
605
|
+
if (!resolved) {
|
|
606
|
+
return {error: 'Error: Could not find the element with uid=' + uid};
|
|
722
607
|
}
|
|
723
|
-
const styles = await
|
|
608
|
+
const styles = await resolved.domModel().cssModel().getComputedStyle(resolved.id);
|
|
724
609
|
if (!styles) {
|
|
725
610
|
return {error: 'Error: Could not get computed styles.'};
|
|
726
611
|
}
|
|
727
|
-
|
|
728
|
-
result[relation][prop] = styles.get(prop);
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
return {
|
|
732
|
-
result: JSON.stringify(result, null, 2),
|
|
733
|
-
};
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
async getAuthoredStyles(relations: Relation[], properties: string[], _options?: {
|
|
737
|
-
signal?: AbortSignal,
|
|
738
|
-
approved?: boolean,
|
|
739
|
-
}): Promise<FunctionCallHandlerResult<unknown>> {
|
|
740
|
-
const result: Record<string, Record<string, string|undefined>|undefined> = {};
|
|
741
|
-
for (const relation of relations) {
|
|
742
|
-
result[relation] = {};
|
|
743
|
-
debugLog(`Action to execute: ${relation}`);
|
|
744
|
-
let selectedNode = this.#getSelectedNode();
|
|
745
|
-
if (!selectedNode) {
|
|
746
|
-
return {error: 'Error: Could not find the currently selected element.'};
|
|
747
|
-
}
|
|
748
|
-
if (relation === 'parentElement') {
|
|
749
|
-
selectedNode = selectedNode.parentNode;
|
|
750
|
-
}
|
|
751
|
-
if (!selectedNode) {
|
|
752
|
-
return {error: 'Error: Could not find the parent element.'};
|
|
753
|
-
}
|
|
754
|
-
const matchedStyles = await selectedNode.domModel().cssModel().getMatchedStyles(selectedNode.id);
|
|
612
|
+
const matchedStyles = await resolved.domModel().cssModel().getMatchedStyles(resolved.id);
|
|
755
613
|
if (!matchedStyles) {
|
|
756
|
-
return {error: 'Error: Could not get
|
|
614
|
+
return {error: 'Error: Could not get authored styles.'};
|
|
615
|
+
}
|
|
616
|
+
for (const prop of properties) {
|
|
617
|
+
result[uid].computed[prop] = styles.get(prop);
|
|
757
618
|
}
|
|
758
619
|
for (const style of matchedStyles.nodeStyles()) {
|
|
759
620
|
for (const property of style.allProperties()) {
|
|
@@ -762,7 +623,7 @@ const data = {
|
|
|
762
623
|
}
|
|
763
624
|
const state = matchedStyles.propertyState(property);
|
|
764
625
|
if (state === SDK.CSSMatchedStyles.PropertyState.ACTIVE) {
|
|
765
|
-
result[
|
|
626
|
+
result[uid].authored[property.name] = property.value;
|
|
766
627
|
}
|
|
767
628
|
}
|
|
768
629
|
}
|
package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt
CHANGED
|
@@ -731,6 +731,29 @@ Available insights:
|
|
|
731
731
|
example question: Which third parties are having the largest impact on my page performance?
|
|
732
732
|
=== end content
|
|
733
733
|
|
|
734
|
+
Title: PerformanceTraceFormatter formatTraceSummary includes INP insight when there is no navigation
|
|
735
|
+
Content:
|
|
736
|
+
URL: https://b2607f8b04800100000289cb1c0a82ba72253000000000000000001.proxy.googlers.com/long-interaction/index.html?x=35
|
|
737
|
+
Bounds: {min: 337943614456, max: 337947260898}
|
|
738
|
+
CPU throttling: none
|
|
739
|
+
Network throttling: none
|
|
740
|
+
Metrics (lab / observed):
|
|
741
|
+
- INP: 139 ms, event: (eventKey: s-3347, ts: 337944870984)
|
|
742
|
+
- CLS: 0.00
|
|
743
|
+
Metrics (field / real users): n/a – no data for this page in CrUX
|
|
744
|
+
Available insights:
|
|
745
|
+
- insight name: INPBreakdown
|
|
746
|
+
description: Start investigating with the longest subpart. [Delays can be minimized](https://web.dev/articles/optimize-inp#optimize_interactions). To reduce processing duration, [optimize the main-thread costs](https://web.dev/articles/optimize-long-tasks), often JS.
|
|
747
|
+
relevant trace bounds: {min: 337944870984, max: 337945010222}
|
|
748
|
+
example question: Suggest fixes for my longest interaction
|
|
749
|
+
example question: Why is a large INP score problematic?
|
|
750
|
+
example question: What's the biggest contributor to my longest interaction?
|
|
751
|
+
- insight name: ThirdParties
|
|
752
|
+
description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/) to prioritize your page's content.
|
|
753
|
+
relevant trace bounds: {min: 337944792445, max: 337944809570}
|
|
754
|
+
example question: Which third parties are having the largest impact on my page performance?
|
|
755
|
+
=== end content
|
|
756
|
+
|
|
734
757
|
Title: PerformanceTraceFormatter formatNetworkRequests formats network requests that have redirects
|
|
735
758
|
Content:
|
|
736
759
|
## Network request: http://localhost:3000/redirect3
|
|
@@ -16,11 +16,26 @@ interface AgentFocusData {
|
|
|
16
16
|
insight: Trace.Insights.Types.InsightModel|null;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Gets the first, most relevant InsightSet to use, following the logic of:
|
|
21
|
+
* 1. If there is only one InsightSet, use that.
|
|
22
|
+
* 2. If there are more, prefer the first we find that has a navigation associated with it.
|
|
23
|
+
* 3. If none with a navigation are found, fallback to the first one.
|
|
24
|
+
* 4. Otherwise, return null.
|
|
25
|
+
*
|
|
26
|
+
* TODO(cjamcl): we should just give the agent the entire insight set, and give
|
|
27
|
+
* summary detail about all of them + the ability to query each.
|
|
28
|
+
*/
|
|
19
29
|
function getFirstInsightSet(insights: Trace.Insights.Types.TraceInsightSets): Trace.Insights.Types.InsightSet|null {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
const insightSets = Array.from(insights.values());
|
|
31
|
+
if (insightSets.length === 0) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
if (insightSets.length === 1) {
|
|
35
|
+
return insightSets[0];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return insightSets.filter(set => set.navigation).at(0) ?? insightSets.at(0) ?? null;
|
|
24
39
|
}
|
|
25
40
|
|
|
26
41
|
export class AgentFocus {
|
|
@@ -12,8 +12,10 @@ import {debugLog} from './debug.js';
|
|
|
12
12
|
export const DELAY_BEFORE_SHOWING_RESPONSE_MS = 500;
|
|
13
13
|
export const AIDA_REQUEST_DEBOUNCE_TIMEOUT_MS = 200;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* TODO(b/404796739): Remove these definitions of AgentOptions and RequestOptions and
|
|
17
|
+
* use the existing ones which are used for AI assistance panel agents.
|
|
18
|
+
**/
|
|
17
19
|
interface AgentOptions {
|
|
18
20
|
aidaClient: Host.AidaClient.AidaClient;
|
|
19
21
|
serverSideLoggingEnabled?: boolean;
|
|
@@ -102,8 +102,10 @@ export class AutofillManager extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
/**
|
|
106
|
+
* A Match describes how the value of a filled field corresponds to a substring
|
|
107
|
+
* of address from startIndex to endIndex.
|
|
108
|
+
**/
|
|
107
109
|
export interface Match {
|
|
108
110
|
startIndex: number;
|
|
109
111
|
endIndex: number;
|
|
@@ -552,7 +552,7 @@ export class CPUProfileDataModel extends ProfileTreeModel {
|
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
|
|
555
|
-
|
|
555
|
+
/** Format used by profiles coming from traces. **/
|
|
556
556
|
export type ExtendedProfileNode = Protocol.Profiler.ProfileNode&{parent?: number};
|
|
557
557
|
export type ExtendedProfile = Protocol.Profiler.Profile&{
|
|
558
558
|
nodes: Protocol.Profiler.ProfileNode[] | ExtendedProfileNode[],
|
|
@@ -103,7 +103,7 @@ export interface ConfigSetting {
|
|
|
103
103
|
|
|
104
104
|
let cruxManagerInstance: CrUXManager;
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
/** TODO: Potentially support `TABLET`. Tablet field data will always be `null` until then. **/
|
|
107
107
|
export const DEVICE_SCOPE_LIST: DeviceScope[] = ['ALL', 'DESKTOP', 'PHONE'];
|
|
108
108
|
|
|
109
109
|
const pageScopeList: PageScope[] = ['origin', 'url'];
|
|
@@ -82,7 +82,7 @@ function parseHostAndPort(pattern: string, scheme: string): {host: string, port:
|
|
|
82
82
|
return undefined;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
// The URL constructor strips off the default port for the scheme, even if it was given
|
|
85
|
+
// The URL constructor strips off the default port for the scheme, even if it was given explicitly
|
|
86
86
|
const httpPort = defaultPort('http');
|
|
87
87
|
if (!httpPort) {
|
|
88
88
|
return undefined;
|
|
@@ -100,8 +100,15 @@ function parseHostAndPort(pattern: string, scheme: string): {host: string, port:
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
/**
|
|
104
|
+
* HostUrlPatterns define permissions in for extensions in the form of "<protocol>://<sub-domain>.example.com:<port>/".
|
|
105
|
+
* Where the respected parts can be patters like "*".
|
|
106
|
+
* Since these aren't valid {@link Common.ParsedURL.ParsedURL}
|
|
107
|
+
* can't handle them and we need a separate implementation.
|
|
108
|
+
*
|
|
109
|
+
* More information in the Chromium code base -
|
|
110
|
+
* {@link https://crsrc.org/c/chrome/browser/extensions/extension_management_internal.h;l=137 | here}.
|
|
111
|
+
*/
|
|
105
112
|
export class HostUrlPattern {
|
|
106
113
|
static parse(pattern: string): HostUrlPattern|undefined {
|
|
107
114
|
if (pattern === '<all_urls>') {
|
|
@@ -122,8 +129,9 @@ export class HostUrlPattern {
|
|
|
122
129
|
return new HostUrlPattern({scheme, host, port, matchesAll: false});
|
|
123
130
|
}
|
|
124
131
|
|
|
125
|
-
private constructor(readonly pattern: {
|
|
126
|
-
|
|
132
|
+
private constructor(readonly pattern: {
|
|
133
|
+
matchesAll: true,
|
|
134
|
+
}|{readonly scheme: string, readonly host: string, readonly port: string, matchesAll: false}) {
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
get scheme(): string {
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/CookieDeprecationMetadataIssue.ts', UIStrings);
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
/** TODO(b/305738703): Move this issue into a warning on CookieIssue. **/
|
|
22
22
|
export class CookieDeprecationMetadataIssue extends Issue {
|
|
23
23
|
readonly #issueDetails: Protocol.Audits.CookieDeprecationMetadataIssueDetails;
|
|
24
24
|
|
|
@@ -44,14 +44,14 @@ const UIStrings = {
|
|
|
44
44
|
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/CookieIssue.ts', UIStrings);
|
|
45
45
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
/** The enum string values need to match the IssueExpanded enum values in UserMetrics.ts. **/
|
|
48
48
|
export const enum CookieIssueSubCategory {
|
|
49
49
|
GENERIC_COOKIE = 'GenericCookie',
|
|
50
50
|
SAME_SITE_COOKIE = 'SameSiteCookie',
|
|
51
51
|
THIRD_PARTY_PHASEOUT_COOKIE = 'ThirdPartyPhaseoutCookie',
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
/** Enum to show cookie status from the security panel's third-party cookie report tool **/
|
|
55
55
|
export const enum CookieStatus {
|
|
56
56
|
BLOCKED = 0,
|
|
57
57
|
ALLOWED = 1,
|
|
@@ -129,7 +129,7 @@ export function substitutePlaceholders(markdown: string, substitutions?: Map<str
|
|
|
129
129
|
return result;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
/** Ensure that all provided placeholders match the naming pattern. **/
|
|
133
133
|
function validatePlaceholders(placeholders: Set<string>): void {
|
|
134
134
|
const invalidPlaceholders = [...placeholders].filter(placeholder => !validPlaceholderNamePattern.test(placeholder));
|
|
135
135
|
if (invalidPlaceholders.length > 0) {
|
|
@@ -34,8 +34,10 @@ export const enum IssueCode {
|
|
|
34
34
|
WRITE_ERROR_INSUFFICIENT_RESOURCES = 'SharedDictionaryIssue::WriteErrorInsufficientResources',
|
|
35
35
|
WRITE_ERROR_INVALID_MATCH_FIELD = 'SharedDictionaryIssue::WriteErrorInvalidMatchField',
|
|
36
36
|
WRITE_ERROR_INVALID_STRUCTURED_HEADER = 'SharedDictionaryIssue::WriteErrorInvalidStructuredHeader',
|
|
37
|
+
WRITE_ERROR_INVALID_TTL_FIELD = 'SharedDictionaryIssue::WriteErrorInvalidTTLField',
|
|
37
38
|
WRITE_ERROR_NAVIGATION_REQUEST = 'SharedDictionaryIssue::WriteErrorNavigationRequest',
|
|
38
39
|
WRITE_ERROR_NO_MATCH_FIELD = 'SharedDictionaryIssue::WriteErrorNoMatchField',
|
|
40
|
+
WRITE_ERROR_NON_INTEGER_TTL_FIELD = 'SharedDictionaryIssue::WriteErrorNonIntegerTTLField',
|
|
39
41
|
WRITE_ERROR_NON_LIST_MATCH_DEST_FIELD = 'SharedDictionaryIssue::WriteErrorNonListMatchDestField',
|
|
40
42
|
WRITE_ERROR_NON_SECURE_CONTEXT = 'SharedDictionaryIssue::WriteErrorNonSecureContext',
|
|
41
43
|
WRITE_ERROR_NON_STRING_ID_FIELD = 'SharedDictionaryIssue::WriteErrorNonStringIdField',
|
|
@@ -73,10 +75,14 @@ function getIssueCode(details: Protocol.Audits.SharedDictionaryIssueDetails): Is
|
|
|
73
75
|
return IssueCode.WRITE_ERROR_INVALID_MATCH_FIELD;
|
|
74
76
|
case Protocol.Audits.SharedDictionaryError.WriteErrorInvalidStructuredHeader:
|
|
75
77
|
return IssueCode.WRITE_ERROR_INVALID_STRUCTURED_HEADER;
|
|
78
|
+
case Protocol.Audits.SharedDictionaryError.WriteErrorInvalidTTLField:
|
|
79
|
+
return IssueCode.WRITE_ERROR_INVALID_TTL_FIELD;
|
|
76
80
|
case Protocol.Audits.SharedDictionaryError.WriteErrorNavigationRequest:
|
|
77
81
|
return IssueCode.WRITE_ERROR_NAVIGATION_REQUEST;
|
|
78
82
|
case Protocol.Audits.SharedDictionaryError.WriteErrorNoMatchField:
|
|
79
83
|
return IssueCode.WRITE_ERROR_NO_MATCH_FIELD;
|
|
84
|
+
case Protocol.Audits.SharedDictionaryError.WriteErrorNonIntegerTTLField:
|
|
85
|
+
return IssueCode.WRITE_ERROR_NON_INTEGER_TTL_FIELD;
|
|
80
86
|
case Protocol.Audits.SharedDictionaryError.WriteErrorNonListMatchDestField:
|
|
81
87
|
return IssueCode.WRITE_ERROR_NON_LIST_MATCH_DEST_FIELD;
|
|
82
88
|
case Protocol.Audits.SharedDictionaryError.WriteErrorNonSecureContext:
|
|
@@ -243,6 +249,13 @@ const issueDescriptions = new Map<Protocol.Audits.SharedDictionaryError, LazyMar
|
|
|
243
249
|
links: specLinks,
|
|
244
250
|
},
|
|
245
251
|
],
|
|
252
|
+
[
|
|
253
|
+
Protocol.Audits.SharedDictionaryError.WriteErrorInvalidTTLField,
|
|
254
|
+
{
|
|
255
|
+
file: 'sharedDictionaryWriteErrorInvalidTTLField.md',
|
|
256
|
+
links: specLinks,
|
|
257
|
+
},
|
|
258
|
+
],
|
|
246
259
|
[
|
|
247
260
|
Protocol.Audits.SharedDictionaryError.WriteErrorNavigationRequest,
|
|
248
261
|
{
|
|
@@ -257,6 +270,13 @@ const issueDescriptions = new Map<Protocol.Audits.SharedDictionaryError, LazyMar
|
|
|
257
270
|
links: specLinks,
|
|
258
271
|
},
|
|
259
272
|
],
|
|
273
|
+
[
|
|
274
|
+
Protocol.Audits.SharedDictionaryError.WriteErrorNonIntegerTTLField,
|
|
275
|
+
{
|
|
276
|
+
file: 'sharedDictionaryWriteErrorNonIntegerTTLField.md',
|
|
277
|
+
links: specLinks,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
260
280
|
[
|
|
261
281
|
Protocol.Audits.SharedDictionaryError.WriteErrorNonListMatchDestField,
|
|
262
282
|
{
|
package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidTTLField.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# The `ttl` field of the `Use-As-Dictionary` HTTP response header must be a positive integer
|