chrome-devtools-frontend 1.0.1522585 → 1.0.1525561
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/policy/slow-close.md +22 -19
- package/docs/ui_engineering.md +22 -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/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/{models/source_map_scopes → core/sdk}/ScopeTreeCache.ts +8 -7
- 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/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +7 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +15 -12
- 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/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 +55 -14
- 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/formatter/FormatterWorkerPool.ts +1 -1
- 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 +8 -0
- 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 +8 -8
- package/front_end/models/source_map_scopes/source_map_scopes.ts +0 -2
- package/front_end/models/text_utils/ContentProvider.ts +6 -4
- 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 +20 -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 +1 -1
- 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 +37 -23
- 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 +105 -96
- package/front_end/panels/changes/ChangesView.ts +69 -69
- package/front_end/panels/changes/CombinedDiffView.ts +1 -1
- package/front_end/panels/changes/changesSidebar.css +3 -0
- package/front_end/panels/changes/changesView.css +4 -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/lighthouse/LighthouseController.ts +5 -0
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +43 -46
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +260 -157
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +28 -21
- 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 +12 -19
- 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/TimelinePanel.ts +10 -8
- package/front_end/panels/timeline/TimelineSelection.ts +4 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -3
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +6 -4
- 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/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/docs/linear_memory_inspector/basic.ts +21 -9
- package/front_end/ui/components/highlighting/HighlightElement.ts +77 -0
- package/front_end/ui/components/highlighting/HighlightManager.ts +58 -1
- 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 +22 -5
- 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/StreamingContentHexView.ts +18 -20
- 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
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
Title: StylingAgent describeElement should describe an element with no children, siblings, or parent
|
|
2
2
|
Content:
|
|
3
|
+
* Element's uid is 99.
|
|
3
4
|
* Its selector is `div#myElement`
|
|
4
5
|
=== end content
|
|
5
6
|
|
|
6
7
|
Title: StylingAgent describeElement should describe an element with child element and text nodes
|
|
7
8
|
Content:
|
|
9
|
+
* Element's uid is 99.
|
|
8
10
|
* Its selector is `div#parentElement`
|
|
9
|
-
* It has 2 child element nodes: `span.child1
|
|
11
|
+
* It has 2 child element nodes: `span.child1` (uid=undefined), `span.child2` (uid=undefined)
|
|
10
12
|
* It only has 1 child text node
|
|
11
13
|
=== end content
|
|
12
14
|
|
|
13
15
|
Title: StylingAgent describeElement should describe an element with siblings and a parent
|
|
14
16
|
Content:
|
|
17
|
+
* Element's uid is 99.
|
|
15
18
|
* Its selector is `div#parentElement`
|
|
16
|
-
* It has a next sibling and it is an element node
|
|
19
|
+
* It has a next sibling and it is an element (uid=undefined) node
|
|
17
20
|
* It has a previous sibling and it is a non element node
|
|
18
|
-
* Its parent's selector is `div#grandparentElement`
|
|
21
|
+
* Its parent's selector is `div#grandparentElement` (uid=undefined)
|
|
19
22
|
* Its parent is a non element node
|
|
20
23
|
* Its parent has only 1 child element node
|
|
21
24
|
* Its parent has only 1 child text node
|
|
@@ -52,6 +55,40 @@ Content:
|
|
|
52
55
|
}
|
|
53
56
|
],
|
|
54
57
|
"function_declarations": [
|
|
58
|
+
{
|
|
59
|
+
"name": "getStyles",
|
|
60
|
+
"description": "Get computed and source styles for one or multiple elements on the inspected page for multiple elements at once by uid.\n\n**CRITICAL** Use selectors to refer to elements in the text output. Do not use uids.\n**CRITICAL** Always provide the explanation argument to explain what and why you query.",
|
|
61
|
+
"parameters": {
|
|
62
|
+
"type": 6,
|
|
63
|
+
"description": "",
|
|
64
|
+
"nullable": false,
|
|
65
|
+
"properties": {
|
|
66
|
+
"explanation": {
|
|
67
|
+
"type": 1,
|
|
68
|
+
"description": "Explain why you want to get styles",
|
|
69
|
+
"nullable": false
|
|
70
|
+
},
|
|
71
|
+
"elements": {
|
|
72
|
+
"type": 5,
|
|
73
|
+
"description": "A list of element uids to get data for",
|
|
74
|
+
"items": {
|
|
75
|
+
"type": 1,
|
|
76
|
+
"description": "An element uid."
|
|
77
|
+
},
|
|
78
|
+
"nullable": false
|
|
79
|
+
},
|
|
80
|
+
"styleProperties": {
|
|
81
|
+
"type": 5,
|
|
82
|
+
"description": "One or more CSS style property names to fetch.",
|
|
83
|
+
"nullable": false,
|
|
84
|
+
"items": {
|
|
85
|
+
"type": 1,
|
|
86
|
+
"description": "A CSS style property name to retrieve. For example, 'background-color'."
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
55
92
|
{
|
|
56
93
|
"name": "executeJavaScript",
|
|
57
94
|
"description": "This function allows you to run JavaScript code on the inspected page to access the element styles and page content.\nCall this function to gather additional information or modify the page state. Call this function enough times to investigate the user request.",
|
|
@@ -62,7 +99,7 @@ Content:
|
|
|
62
99
|
"properties": {
|
|
63
100
|
"code": {
|
|
64
101
|
"type": 1,
|
|
65
|
-
"description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* 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`.\n* 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.\n*
|
|
102
|
+
"description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* 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`.\n* 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.\n* **CRITICAL** Only get styles that might be relevant to the user request.\n* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.\n* **CRITICAL** Consider that `data` variable from the previous function calls are not available in a new function call.\n\nFor example, the code to change element styles:\n\n```\nawait setElementStyles($0, {\n color: 'blue',\n});\n```\n\nFor example, the code to get overlapping elements:\n\n```\nconst data = {\n overlappingElements: Array.from(document.querySelectorAll('*'))\n .filter(el => {\n const rect = el.getBoundingClientRect();\n const popupRect = $0.getBoundingClientRect();\n return (\n el !== $0 &&\n rect.left < popupRect.right &&\n rect.right > popupRect.left &&\n rect.top < popupRect.bottom &&\n rect.bottom > popupRect.top\n );\n })\n .map(el => ({\n tagName: el.tagName,\n id: el.id,\n className: el.className,\n zIndex: window.getComputedStyle(el)['z-index']\n }))\n};\n```\n"
|
|
66
103
|
},
|
|
67
104
|
"thought": {
|
|
68
105
|
"type": 1,
|
|
@@ -153,7 +190,7 @@ Content:
|
|
|
153
190
|
"details": [
|
|
154
191
|
{
|
|
155
192
|
"title": "Data used",
|
|
156
|
-
"text": "* Its selector is `undefined`"
|
|
193
|
+
"text": "* Element's uid is 99.\n* Its selector is `undefined`"
|
|
157
194
|
}
|
|
158
195
|
]
|
|
159
196
|
},
|
|
@@ -174,7 +211,7 @@ Content:
|
|
|
174
211
|
{
|
|
175
212
|
"parts": [
|
|
176
213
|
{
|
|
177
|
-
"text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
214
|
+
"text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
178
215
|
}
|
|
179
216
|
],
|
|
180
217
|
"role": 1
|
|
@@ -194,13 +231,13 @@ Title: StylingAgent run correctly handles historical_contexts in AIDA requests
|
|
|
194
231
|
Content:
|
|
195
232
|
[
|
|
196
233
|
{
|
|
197
|
-
"text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
234
|
+
"text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
198
235
|
},
|
|
199
236
|
[
|
|
200
237
|
{
|
|
201
238
|
"parts": [
|
|
202
239
|
{
|
|
203
|
-
"text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
240
|
+
"text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
204
241
|
}
|
|
205
242
|
],
|
|
206
243
|
"role": 1
|
|
@@ -237,7 +274,7 @@ Content:
|
|
|
237
274
|
"details": [
|
|
238
275
|
{
|
|
239
276
|
"title": "Data used",
|
|
240
|
-
"text": "* Its selector is `undefined`"
|
|
277
|
+
"text": "* Element's uid is 99.\n* Its selector is `undefined`"
|
|
241
278
|
}
|
|
242
279
|
]
|
|
243
280
|
},
|
|
@@ -266,7 +303,7 @@ Content:
|
|
|
266
303
|
"details": [
|
|
267
304
|
{
|
|
268
305
|
"title": "Data used",
|
|
269
|
-
"text": "* Its selector is `undefined`"
|
|
306
|
+
"text": "* Element's uid is 99.\n* Its selector is `undefined`"
|
|
270
307
|
}
|
|
271
308
|
]
|
|
272
309
|
},
|
|
@@ -298,7 +335,7 @@ Content:
|
|
|
298
335
|
"details": [
|
|
299
336
|
{
|
|
300
337
|
"title": "Data used",
|
|
301
|
-
"text": "* Its selector is `undefined`"
|
|
338
|
+
"text": "* Element's uid is 99.\n* Its selector is `undefined`"
|
|
302
339
|
}
|
|
303
340
|
]
|
|
304
341
|
},
|
|
@@ -327,7 +364,7 @@ Content:
|
|
|
327
364
|
"details": [
|
|
328
365
|
{
|
|
329
366
|
"title": "Data used",
|
|
330
|
-
"text": "* Its selector is `undefined`"
|
|
367
|
+
"text": "* Element's uid is 99.\n* Its selector is `undefined`"
|
|
331
368
|
}
|
|
332
369
|
]
|
|
333
370
|
},
|
|
@@ -354,7 +391,7 @@ Content:
|
|
|
354
391
|
"details": [
|
|
355
392
|
{
|
|
356
393
|
"title": "Data used",
|
|
357
|
-
"text": "* Its selector is `undefined`"
|
|
394
|
+
"text": "* Element's uid is 99.\n* Its selector is `undefined`"
|
|
358
395
|
}
|
|
359
396
|
]
|
|
360
397
|
},
|
|
@@ -388,7 +425,7 @@ Content:
|
|
|
388
425
|
{
|
|
389
426
|
"parts": [
|
|
390
427
|
{
|
|
391
|
-
"text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
428
|
+
"text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
|
|
392
429
|
}
|
|
393
430
|
],
|
|
394
431
|
"role": 1
|
|
@@ -492,6 +529,7 @@ Title: StylingAgent enhanceQuery does not add multimodal input evaluation prompt
|
|
|
492
529
|
Content:
|
|
493
530
|
# Inspected element
|
|
494
531
|
|
|
532
|
+
* Element's uid is 99.
|
|
495
533
|
* Its selector is `div#myElement`
|
|
496
534
|
|
|
497
535
|
# User request
|
|
@@ -503,6 +541,7 @@ Title: StylingAgent enhanceQuery does not add multimodal input evaluation prompt
|
|
|
503
541
|
Content:
|
|
504
542
|
# Inspected element
|
|
505
543
|
|
|
544
|
+
* Element's uid is 99.
|
|
506
545
|
* Its selector is `div#myElement`
|
|
507
546
|
|
|
508
547
|
# User request
|
|
@@ -528,6 +567,7 @@ In case query is related to the image, ALWAYS first use image evaluation to get
|
|
|
528
567
|
|
|
529
568
|
# Inspected element
|
|
530
569
|
|
|
570
|
+
* Element's uid is 99.
|
|
531
571
|
* Its selector is `div#myElement`
|
|
532
572
|
|
|
533
573
|
# User request
|
|
@@ -551,6 +591,7 @@ In case query is related to the image, ALWAYS first use image evaluation to get
|
|
|
551
591
|
|
|
552
592
|
# Inspected element
|
|
553
593
|
|
|
594
|
+
* Element's uid is 99.
|
|
554
595
|
* Its selector is `div#myElement`
|
|
555
596
|
|
|
556
597
|
# User request
|
|
@@ -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
|