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
|
@@ -245,7 +245,7 @@ export class BidiPage extends Page {
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
override async setBypassCSP(enabled: boolean): Promise<void> {
|
|
248
|
-
// TODO: handle CDP-specific cases such as
|
|
248
|
+
// TODO: handle CDP-specific cases such as MPArch.
|
|
249
249
|
await this._client().send('Page.setBypassCSP', {enabled});
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -626,7 +626,7 @@ export class BidiPage extends Page {
|
|
|
626
626
|
);
|
|
627
627
|
return;
|
|
628
628
|
}
|
|
629
|
-
// TODO: handle CDP-specific cases such as
|
|
629
|
+
// TODO: handle CDP-specific cases such as MPArch.
|
|
630
630
|
await this._client().send('Network.setCacheDisabled', {
|
|
631
631
|
cacheDisabled: !enabled,
|
|
632
632
|
});
|
|
@@ -711,11 +711,20 @@ export class BidiPage extends Page {
|
|
|
711
711
|
return [...this.#workers];
|
|
712
712
|
}
|
|
713
713
|
|
|
714
|
-
|
|
714
|
+
get isNetworkInterceptionEnabled(): boolean {
|
|
715
|
+
return (
|
|
716
|
+
Boolean(this.#requestInterception) ||
|
|
717
|
+
Boolean(this.#extraHeadersInterception) ||
|
|
718
|
+
Boolean(this.#authInterception) ||
|
|
719
|
+
Boolean(this.#userAgentInterception)
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
#requestInterception?: string;
|
|
715
724
|
override async setRequestInterception(enable: boolean): Promise<void> {
|
|
716
|
-
this.#
|
|
725
|
+
this.#requestInterception = await this.#toggleInterception(
|
|
717
726
|
[Bidi.Network.InterceptPhase.BeforeRequestSent],
|
|
718
|
-
this.#
|
|
727
|
+
this.#requestInterception,
|
|
719
728
|
enable,
|
|
720
729
|
);
|
|
721
730
|
}
|
|
@@ -1054,7 +1063,7 @@ export function bidiToPuppeteerCookie(
|
|
|
1054
1063
|
): Cookie {
|
|
1055
1064
|
const partitionKey = bidiCookie[CDP_SPECIFIC_PREFIX + 'partitionKey'];
|
|
1056
1065
|
|
|
1057
|
-
function
|
|
1066
|
+
function getPartitionKey(): {partitionKey?: Cookie['partitionKey']} {
|
|
1058
1067
|
if (typeof partitionKey === 'string') {
|
|
1059
1068
|
return {partitionKey};
|
|
1060
1069
|
}
|
|
@@ -1096,7 +1105,7 @@ export function bidiToPuppeteerCookie(
|
|
|
1096
1105
|
'partitionKeyOpaque',
|
|
1097
1106
|
'priority',
|
|
1098
1107
|
),
|
|
1099
|
-
...
|
|
1108
|
+
...getPartitionKey(),
|
|
1100
1109
|
};
|
|
1101
1110
|
}
|
|
1102
1111
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type * as Bidi from 'webdriver-bidi-protocol';
|
|
8
8
|
|
|
9
9
|
import type {BrowserContextOptions} from '../../api/Browser.js';
|
|
10
|
+
import {UnsupportedOperation} from '../../common/Errors.js';
|
|
10
11
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
|
11
12
|
import {inertIfDisposed, throwIfDisposed} from '../../util/decorators.js';
|
|
12
13
|
import {DisposableStack, disposeSymbol} from '../../util/disposable.js';
|
|
@@ -232,11 +233,36 @@ export class Browser extends EventEmitter<{
|
|
|
232
233
|
noProxy: options.proxyBypassList,
|
|
233
234
|
};
|
|
234
235
|
const {
|
|
235
|
-
result: {userContext
|
|
236
|
+
result: {userContext},
|
|
236
237
|
} = await this.session.send('browser.createUserContext', {
|
|
237
238
|
proxy: proxyConfig,
|
|
238
239
|
});
|
|
239
|
-
|
|
240
|
+
if (options.downloadBehavior?.policy === 'allowAndName') {
|
|
241
|
+
throw new UnsupportedOperation(
|
|
242
|
+
'`allowAndName` is not supported in WebDriver BiDi',
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
if (options.downloadBehavior?.policy === 'allow') {
|
|
246
|
+
if (options.downloadBehavior.downloadPath === undefined) {
|
|
247
|
+
throw new UnsupportedOperation(
|
|
248
|
+
'`downloadPath` is required in `allow` download behavior',
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
await this.session.send('browser.setDownloadBehavior', {
|
|
252
|
+
downloadBehavior: {
|
|
253
|
+
type: 'allowed',
|
|
254
|
+
destinationFolder: options.downloadBehavior.downloadPath,
|
|
255
|
+
},
|
|
256
|
+
userContexts: [userContext],
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
if (options.downloadBehavior?.policy === 'deny') {
|
|
260
|
+
await this.session.send('browser.setDownloadBehavior', {
|
|
261
|
+
downloadBehavior: {type: 'denied'},
|
|
262
|
+
userContexts: [userContext],
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return this.#createUserContext(userContext);
|
|
240
266
|
}
|
|
241
267
|
|
|
242
268
|
@throwIfDisposed<Browser>(browser => {
|
|
@@ -14,28 +14,19 @@ import type {NetworkConditions} from './NetworkManager.js';
|
|
|
14
14
|
*
|
|
15
15
|
* ```ts
|
|
16
16
|
* import {PredefinedNetworkConditions} from 'puppeteer';
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* ); // alias to Fast 3G.
|
|
31
|
-
* await page.goto('https://www.google.com');
|
|
32
|
-
* await page.emulateNetworkConditions(
|
|
33
|
-
* PredefinedNetworkConditions['Fast 4G'],
|
|
34
|
-
* );
|
|
35
|
-
* await page.goto('https://www.google.com');
|
|
36
|
-
* // other actions...
|
|
37
|
-
* await browser.close();
|
|
38
|
-
* })();
|
|
17
|
+
* const browser = await puppeteer.launch();
|
|
18
|
+
* const page = await browser.newPage();
|
|
19
|
+
* await page.emulateNetworkConditions(PredefinedNetworkConditions['Slow 3G']);
|
|
20
|
+
* await page.goto('https://www.google.com');
|
|
21
|
+
* await page.emulateNetworkConditions(PredefinedNetworkConditions['Fast 3G']);
|
|
22
|
+
* await page.goto('https://www.google.com');
|
|
23
|
+
* // alias to Fast 3G.
|
|
24
|
+
* await page.emulateNetworkConditions(PredefinedNetworkConditions['Slow 4G']);
|
|
25
|
+
* await page.goto('https://www.google.com');
|
|
26
|
+
* await page.emulateNetworkConditions(PredefinedNetworkConditions['Fast 4G']);
|
|
27
|
+
* await page.goto('https://www.google.com');
|
|
28
|
+
* // other actions...
|
|
29
|
+
* await browser.close();
|
|
39
30
|
* ```
|
|
40
31
|
*
|
|
41
32
|
* @public
|
|
@@ -1738,14 +1738,12 @@ for (const device of knownDevices) {
|
|
|
1738
1738
|
* import {KnownDevices} from 'puppeteer';
|
|
1739
1739
|
* const iPhone = KnownDevices['iPhone 15 Pro'];
|
|
1740
1740
|
*
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1743
|
-
*
|
|
1744
|
-
*
|
|
1745
|
-
*
|
|
1746
|
-
*
|
|
1747
|
-
* await browser.close();
|
|
1748
|
-
* })();
|
|
1741
|
+
* const browser = await puppeteer.launch();
|
|
1742
|
+
* const page = await browser.newPage();
|
|
1743
|
+
* await page.emulate(iPhone);
|
|
1744
|
+
* await page.goto('https://www.google.com');
|
|
1745
|
+
* // other actions...
|
|
1746
|
+
* await browser.close();
|
|
1749
1747
|
* ```
|
|
1750
1748
|
*
|
|
1751
1749
|
* @public
|
|
@@ -372,7 +372,7 @@ export abstract class BrowserLauncher {
|
|
|
372
372
|
*/
|
|
373
373
|
protected async createBiDiOverCdpBrowser(
|
|
374
374
|
browserProcess: ReturnType<typeof launch>,
|
|
375
|
-
|
|
375
|
+
cdpConnection: Connection,
|
|
376
376
|
closeCallback: BrowserCloseCallback,
|
|
377
377
|
opts: {
|
|
378
378
|
defaultViewport: Viewport | null;
|
|
@@ -380,11 +380,14 @@ export abstract class BrowserLauncher {
|
|
|
380
380
|
networkEnabled: boolean;
|
|
381
381
|
},
|
|
382
382
|
): Promise<Browser> {
|
|
383
|
+
const bidiOnly = process.env['PUPPETEER_WEBDRIVER_BIDI_ONLY'] === 'true';
|
|
383
384
|
const BiDi = await import(/* webpackIgnore: true */ '../bidi/bidi.js');
|
|
384
|
-
const bidiConnection = await BiDi.connectBidiOverCdp(
|
|
385
|
+
const bidiConnection = await BiDi.connectBidiOverCdp(cdpConnection);
|
|
385
386
|
return await BiDi.BidiBrowser.create({
|
|
386
387
|
connection: bidiConnection,
|
|
387
|
-
|
|
388
|
+
// Do not provide CDP connection to Browser, if BiDi-only mode is enabled. This
|
|
389
|
+
// would restrict Browser to use only BiDi endpoint.
|
|
390
|
+
cdpConnection: bidiOnly ? undefined : cdpConnection,
|
|
388
391
|
closeCallback,
|
|
389
392
|
process: browserProcess.nodeProcess,
|
|
390
393
|
defaultViewport: opts.defaultViewport,
|
|
@@ -44,13 +44,11 @@ import type {ChromeReleaseChannel, LaunchOptions} from './LaunchOptions.js';
|
|
|
44
44
|
* ```ts
|
|
45
45
|
* import puppeteer from 'puppeteer';
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* await browser.close();
|
|
53
|
-
* })();
|
|
47
|
+
* const browser = await puppeteer.launch();
|
|
48
|
+
* const page = await browser.newPage();
|
|
49
|
+
* await page.goto('https://www.google.com');
|
|
50
|
+
* // other actions...
|
|
51
|
+
* await browser.close();
|
|
54
52
|
* ```
|
|
55
53
|
*
|
|
56
54
|
* Once you have created a `page` you have access to a large API to interact
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
11
|
-
chrome: '
|
|
12
|
-
'chrome-headless-shell': '
|
|
13
|
-
firefox: 'stable_143.0.
|
|
11
|
+
chrome: '141.0.7390.54',
|
|
12
|
+
'chrome-headless-shell': '141.0.7390.54',
|
|
13
|
+
firefox: 'stable_143.0.3',
|
|
14
14
|
});
|
|
@@ -19,8 +19,10 @@ declare global {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Use this component to render links to 'chrome://...'-URLs
|
|
24
|
+
* (for which regular <x-link>s do not work).
|
|
25
|
+
**/
|
|
24
26
|
export class ChromeLink extends HTMLElement {
|
|
25
27
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
26
28
|
#href = '';
|
|
@@ -29,9 +29,11 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
29
29
|
|
|
30
30
|
const IS_DIALOG_SUPPORTED = 'HTMLDialogElement' in globalThis;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Height in pixels of the dialog's connector. The connector is represented as
|
|
34
|
+
* as a diamond and the height corresponds to half the height of the diamond.
|
|
35
|
+
* (the visible height is only half of the diamond).
|
|
36
|
+
**/
|
|
35
37
|
export const CONNECTOR_HEIGHT = 10;
|
|
36
38
|
const CONNECTOR_WIDTH = 2 * CONNECTOR_HEIGHT;
|
|
37
39
|
|
|
@@ -41,12 +43,14 @@ const DIALOG_ANIMATION_OFFSET = 20;
|
|
|
41
43
|
export const DIALOG_SIDE_PADDING = 5;
|
|
42
44
|
export const DIALOG_VERTICAL_PADDING = 3;
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
/**
|
|
47
|
+
* If the content of the dialog cannot be completely shown because otherwise
|
|
48
|
+
* the dialog would overflow the window, the dialog's max width and height are
|
|
49
|
+
* set such that the dialog remains inside the visible bounds. In this cases
|
|
50
|
+
* some extra, determined by this constant, is added so that the dialog's borders
|
|
51
|
+
* remain clearly visible. This constant accounts for the padding of the dialog's
|
|
52
|
+
* content (20 px) and a 5px gap left on each extreme of the dialog from the viewport.
|
|
53
|
+
**/
|
|
50
54
|
export const DIALOG_PADDING_FROM_WINDOW = 3 * CONNECTOR_HEIGHT;
|
|
51
55
|
interface DialogData {
|
|
52
56
|
/**
|
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import * as LinearMemoryInspectorComponents from '../../../../panels/linear_memory_inspector/components/components.js';
|
|
6
6
|
import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
7
|
+
import * as UI from '../../../legacy/legacy.js';
|
|
8
|
+
import * as Lit from '../../../lit/lit.js';
|
|
7
9
|
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
10
|
|
|
9
11
|
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
12
|
await FrontendHelpers.initializeGlobalVars();
|
|
11
13
|
|
|
14
|
+
const {render, html} = Lit;
|
|
15
|
+
const {widgetConfig} = UI.Widget;
|
|
16
|
+
|
|
12
17
|
const array = [];
|
|
13
18
|
const string = 'Hello this is a string from the memory buffer!';
|
|
14
19
|
|
|
@@ -21,12 +26,19 @@ for (let i = -1000; i < 1000; ++i) {
|
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
const memory = new Uint8Array(array);
|
|
24
|
-
|
|
25
|
-
document.getElementById('container')
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
|
|
30
|
+
const container = document.getElementById('container');
|
|
31
|
+
if (container) {
|
|
32
|
+
render(
|
|
33
|
+
html`
|
|
34
|
+
<devtools-widget .widgetConfig=${
|
|
35
|
+
widgetConfig(LinearMemoryInspectorComponents.LinearMemoryInspector.LinearMemoryInspector, {
|
|
36
|
+
memory,
|
|
37
|
+
address: 0,
|
|
38
|
+
memoryOffset: 0,
|
|
39
|
+
outerMemoryLength: memory.length,
|
|
40
|
+
})}>
|
|
41
|
+
</devtools-widget>
|
|
42
|
+
`,
|
|
43
|
+
container);
|
|
44
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Copyright 2025 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as TextUtils from '../../../models/text_utils/text_utils.js';
|
|
6
|
+
|
|
7
|
+
import {HighlightManager} from './HighlightManager.js';
|
|
8
|
+
|
|
9
|
+
export class HighlightElement extends HTMLElement {
|
|
10
|
+
static readonly observedAttributes = ['ranges', 'current-range'];
|
|
11
|
+
#ranges: TextUtils.TextRange.SourceRange[] = [];
|
|
12
|
+
#currentRange: TextUtils.TextRange.SourceRange|undefined;
|
|
13
|
+
|
|
14
|
+
attributeChangedCallback(name: string, oldValue: string|null, newValue: string|null): void {
|
|
15
|
+
if (oldValue === newValue) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
switch (name) {
|
|
19
|
+
case 'ranges':
|
|
20
|
+
this.#ranges = parseRanges(newValue);
|
|
21
|
+
break;
|
|
22
|
+
case 'current-range':
|
|
23
|
+
this.#currentRange = parseRanges(newValue)[0];
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
HighlightManager.instance().set(this, this.#ranges, this.#currentRange);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function parseRanges(value: string|null): TextUtils.TextRange.SourceRange[] {
|
|
31
|
+
if (!value) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
const ranges = value.split(' ')
|
|
35
|
+
.filter(rangeString => {
|
|
36
|
+
const parts = rangeString.split(',');
|
|
37
|
+
// A valid range string must have exactly two parts.
|
|
38
|
+
if (parts.length !== 2) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
// Both parts must be convertible to valid numbers.
|
|
42
|
+
const num1 = Number(parts[0]);
|
|
43
|
+
const num2 = Number(parts[1]);
|
|
44
|
+
return !isNaN(num1) && !isNaN(num2);
|
|
45
|
+
})
|
|
46
|
+
.map(rangeString => {
|
|
47
|
+
const parts = rangeString.split(',').map(part => Number(part));
|
|
48
|
+
return new TextUtils.TextRange.SourceRange(parts[0], parts[1]);
|
|
49
|
+
});
|
|
50
|
+
return sortAndMergeRanges(ranges);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function sortAndMergeRanges(ranges: TextUtils.TextRange.SourceRange[]): TextUtils.TextRange.SourceRange[] {
|
|
54
|
+
// Sort by start position.
|
|
55
|
+
ranges.sort((a, b) => a.offset - b.offset);
|
|
56
|
+
|
|
57
|
+
if (ranges.length === 0) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Merge overlapping ranges.
|
|
62
|
+
const merged = [ranges[0]];
|
|
63
|
+
for (let i = 1; i < ranges.length; i++) {
|
|
64
|
+
const last = merged[merged.length - 1];
|
|
65
|
+
const current = ranges[i];
|
|
66
|
+
if (current.offset <= last.offset + last.length) {
|
|
67
|
+
const newEnd = Math.max(last.offset + last.length, current.offset + current.length);
|
|
68
|
+
const newLength = newEnd - last.offset;
|
|
69
|
+
merged[merged.length - 1] = new TextUtils.TextRange.SourceRange(last.offset, newLength);
|
|
70
|
+
} else {
|
|
71
|
+
merged.push(current);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return merged;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
customElements.define('devtools-highlight', HighlightElement);
|
|
@@ -10,7 +10,15 @@ export class RangeWalker {
|
|
|
10
10
|
#eof: boolean;
|
|
11
11
|
|
|
12
12
|
constructor(readonly root: Node) {
|
|
13
|
-
|
|
13
|
+
const nodeFilter = {
|
|
14
|
+
acceptNode(node: Node): number {
|
|
15
|
+
if (['STYLE', 'SCRIPT'].includes(node.parentNode?.nodeName ?? '')) {
|
|
16
|
+
return NodeFilter.FILTER_REJECT;
|
|
17
|
+
}
|
|
18
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
this.#treeWalker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, nodeFilter);
|
|
14
22
|
this.#eof = !this.#treeWalker.firstChild();
|
|
15
23
|
}
|
|
16
24
|
|
|
@@ -57,15 +65,34 @@ export class RangeWalker {
|
|
|
57
65
|
range.setEnd(endNode, offsetInEndNode);
|
|
58
66
|
return range;
|
|
59
67
|
}
|
|
68
|
+
|
|
69
|
+
goToTextNode(node: Text): void {
|
|
70
|
+
while (this.#treeWalker.currentNode !== node) {
|
|
71
|
+
if (!this.#next()) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get offset(): number {
|
|
78
|
+
return this.#offset;
|
|
79
|
+
}
|
|
60
80
|
}
|
|
61
81
|
|
|
62
82
|
export const HIGHLIGHT_REGISTRY = 'highlighted-search-result';
|
|
63
83
|
export const CURRENT_HIGHLIGHT_REGISTRY = 'current-search-result';
|
|
64
84
|
|
|
85
|
+
interface HighlightState {
|
|
86
|
+
activeRanges: Range[];
|
|
87
|
+
ranges: TextUtils.TextRange.SourceRange[];
|
|
88
|
+
currentRange: TextUtils.TextRange.SourceRange|undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
65
91
|
let highlightManagerInstance: HighlightManager;
|
|
66
92
|
export class HighlightManager {
|
|
67
93
|
#highlights = new Highlight();
|
|
68
94
|
#currentHighlights = new Highlight();
|
|
95
|
+
#stateByNode = new WeakMap<Node, HighlightState>();
|
|
69
96
|
|
|
70
97
|
constructor() {
|
|
71
98
|
CSS.highlights.set(HIGHLIGHT_REGISTRY, this.#highlights);
|
|
@@ -119,4 +146,34 @@ export class HighlightManager {
|
|
|
119
146
|
}
|
|
120
147
|
return ranges;
|
|
121
148
|
}
|
|
149
|
+
|
|
150
|
+
#getOrCreateState(node: Node): HighlightState {
|
|
151
|
+
let state = this.#stateByNode.get(node);
|
|
152
|
+
if (!state) {
|
|
153
|
+
state = {
|
|
154
|
+
activeRanges: [],
|
|
155
|
+
ranges: [],
|
|
156
|
+
currentRange: undefined,
|
|
157
|
+
};
|
|
158
|
+
this.#stateByNode.set(node, state);
|
|
159
|
+
}
|
|
160
|
+
return state;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
apply(node: Node): void {
|
|
164
|
+
const state = this.#getOrCreateState(node);
|
|
165
|
+
this.removeHighlights(state.activeRanges);
|
|
166
|
+
state.activeRanges = this.highlightOrderedTextRanges(node, state.ranges);
|
|
167
|
+
if (state.currentRange) {
|
|
168
|
+
state.activeRanges.push(...this.highlightOrderedTextRanges(node, [state.currentRange], /* isCurrent=*/ true));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
set(element: Node, ranges: TextUtils.TextRange.SourceRange[],
|
|
173
|
+
currentRange: TextUtils.TextRange.SourceRange|undefined): void {
|
|
174
|
+
const state = this.#getOrCreateState(element);
|
|
175
|
+
state.ranges = ranges;
|
|
176
|
+
state.currentRange = currentRange;
|
|
177
|
+
this.apply(element);
|
|
178
|
+
}
|
|
122
179
|
}
|
|
@@ -32,9 +32,11 @@ export interface ImageData {
|
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
/**
|
|
36
|
+
* NOTE: This is only exported for tests, and it should not be
|
|
37
|
+
* imported in any component, instead add image data in map and
|
|
38
|
+
* use getMarkdownImage to get the appropriate image data.
|
|
39
|
+
**/
|
|
38
40
|
export const markdownImages = new Map<string, ImageData>([]);
|
|
39
41
|
|
|
40
42
|
export const getMarkdownImage = (key: string): ImageData => {
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
* Find more information about web development at [Learn more](exampleLink)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* This is only exported for tests, and it should not be
|
|
14
|
+
* imported in any component, instead add link in map and
|
|
15
|
+
* use getMarkdownLink to get the appropriate link.
|
|
16
|
+
**/
|
|
15
17
|
export const markdownLinks = new Map<string, string>([
|
|
16
18
|
['issuesContrastWCAG21AA', 'https://www.w3.org/TR/WCAG21/#contrast-minimum'],
|
|
17
19
|
['issuesContrastWCAG21AAA', 'https://www.w3.org/TR/WCAG21/#contrast-enhanced'],
|
|
@@ -463,9 +463,11 @@ export class SelectMenuButtonTriggerEvent extends Event {
|
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
466
|
+
/**
|
|
467
|
+
* Exported artifacts used in this component and that belong to the Menu are
|
|
468
|
+
* renamed to only make reference to the SelectMenu. This way, the Menu API
|
|
469
|
+
* doesn't have to be used in SelectMenu usages and the SelectMenu implementation
|
|
470
|
+
* can remain transparent to its users.
|
|
471
|
+
**/
|
|
470
472
|
export type SelectMenuItemValue = MenuItemValue;
|
|
471
473
|
export {MenuGroup as SelectMenuGroup};
|
|
@@ -48,8 +48,10 @@ const enum State {
|
|
|
48
48
|
DONT_SHOW_LINK = 'DontShowLink',
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
/**
|
|
52
|
+
* A link to a survey. The link is rendered asynchronously because we need to first check if
|
|
53
|
+
* canShowSurvey succeeds.
|
|
54
|
+
**/
|
|
53
55
|
export class SurveyLink extends HTMLElement {
|
|
54
56
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
55
57
|
#trigger = '';
|
|
@@ -86,9 +86,11 @@ export const tabMovesFocus = DynamicSetting.bool('text-editor-tab-moves-focus',
|
|
|
86
86
|
|
|
87
87
|
const disableConservativeCompletion = CM.StateEffect.define();
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
/**
|
|
90
|
+
* When enabled, this suppresses the behavior of showCompletionHint
|
|
91
|
+
* and accepting of completions with Enter until the user selects a
|
|
92
|
+
* completion beyond the initially selected one. Used in the console.
|
|
93
|
+
**/
|
|
92
94
|
export const conservativeCompletion = CM.StateField.define<boolean>({
|
|
93
95
|
create() {
|
|
94
96
|
return true;
|
|
@@ -123,9 +125,11 @@ function acceptCompletionIfAtEndOfLine(view: CM.EditorView): boolean {
|
|
|
123
125
|
return false;
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
/**
|
|
129
|
+
* This is a wrapper around CodeMirror's own moveCompletionSelection command, which
|
|
130
|
+
* selects the first selection if the state of the selection is conservative, and
|
|
131
|
+
* otherwise behaves as normal.
|
|
132
|
+
**/
|
|
129
133
|
function moveCompletionSelectionIfNotConservative(
|
|
130
134
|
forward: boolean, by: 'option'|'page' = 'option'): ((view: CM.EditorView) => boolean) {
|
|
131
135
|
return view => {
|
|
@@ -268,8 +268,10 @@ const maxCacheAge = 30_000;
|
|
|
268
268
|
|
|
269
269
|
let cacheInstance: PropertyCache|null = null;
|
|
270
270
|
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
/**
|
|
272
|
+
* Store recent collections of property completions. The empty string
|
|
273
|
+
* is used to store the set of global bindings.
|
|
274
|
+
**/
|
|
273
275
|
class PropertyCache {
|
|
274
276
|
readonly #cache = new Map<string, Promise<CompletionSet>>();
|
|
275
277
|
|
|
@@ -713,8 +715,10 @@ async function prototypesFromObject(object: SDK.RemoteObject.RemoteObject): Prom
|
|
|
713
715
|
}, []) ?? [];
|
|
714
716
|
}
|
|
715
717
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
+
/**
|
|
719
|
+
* Given a function object that is probably a bound function, try to
|
|
720
|
+
* retrieve the argument list from its target function.
|
|
721
|
+
**/
|
|
718
722
|
async function getArgumentsForBoundFunction(object: SDK.RemoteObject.RemoteObject): Promise<string[][]|null> {
|
|
719
723
|
const {internalProperties} = await object.getOwnProperties(false);
|
|
720
724
|
if (!internalProperties) {
|