chrome-devtools-frontend 1.0.1532884 → 1.0.1534251
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/eslint.config.mjs +89 -133
- package/front_end/Images/src/justify-content-stretch.svg +4 -0
- package/front_end/core/host/InspectorFrontendHost.ts +7 -3
- package/front_end/core/host/InspectorFrontendHostAPI.ts +32 -29
- package/front_end/core/host/UserMetrics.ts +2 -5
- package/front_end/core/i18n/i18nImpl.ts +1 -1
- package/front_end/core/protocol_client/CDPConnection.ts +39 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +4 -24
- package/front_end/core/root/Runtime.ts +0 -2
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +19 -9
- package/front_end/core/sdk/NetworkManager.ts +85 -62
- package/front_end/core/sdk/NetworkRequest.ts +7 -0
- package/front_end/devtools_compatibility.js +948 -1598
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +1 -1
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +4 -9
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +1 -1
- package/front_end/entrypoints/node_app/node_app.ts +2 -2
- package/front_end/generated/InspectorBackendCommands.js +0 -4
- package/front_end/generated/protocol-mapping.d.ts +3 -18
- package/front_end/generated/protocol-proxy-api.d.ts +0 -22
- package/front_end/generated/protocol.ts +0 -74
- package/front_end/global_typings/global_defs.d.ts +16 -0
- package/front_end/models/ai_assistance/BuiltInAi.ts +0 -17
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +9 -7
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatterBounds.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/injected.ts +1 -1
- package/front_end/models/ai_assistance/performance/AIContext.ts +11 -28
- package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
- package/front_end/models/extensions/ExtensionAPI.ts +1 -1
- package/front_end/models/extensions/extensions.ts +0 -6
- package/front_end/models/formatter/FormatterWorkerPool.ts +1 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +1 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
- package/front_end/models/stack_trace/StackTraceModel.ts +1 -1
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +1 -1
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -1
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +0 -12
- package/front_end/panels/ai_assistance/PatchWidget.ts +1 -1
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -37
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +2 -2
- package/front_end/panels/application/AppManifestView.ts +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -1
- package/front_end/panels/application/BackgroundServiceView.ts +13 -4
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/DOMStorageItemsView.ts +1 -1
- package/front_end/panels/application/ExtensionStorageItemsView.ts +1 -1
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/InterestGroupStorageView.ts +1 -1
- package/front_end/panels/application/OpenedWindowDetailsView.ts +3 -3
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +1 -1
- package/front_end/panels/application/SharedStorageEventsView.ts +1 -1
- package/front_end/panels/application/StorageView.ts +1 -1
- package/front_end/panels/application/components/BackForwardCacheView.ts +1 -1
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +1 -1
- package/front_end/panels/application/components/FrameDetailsView.ts +1 -1
- package/front_end/panels/application/components/InterestGroupAccessGrid.ts +2 -2
- package/front_end/panels/application/components/OriginTrialTreeView.ts +2 -2
- package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +1 -1
- package/front_end/panels/application/components/StackTrace.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +1 -1
- package/front_end/panels/application/preloading/PreloadingView.ts +3 -3
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -2
- package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +1 -1
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/changes/CombinedDiffView.ts +1 -1
- package/front_end/{models/extensions → panels/common}/ExtensionPanel.ts +8 -12
- package/front_end/{models/extensions → panels/common}/ExtensionServer.ts +242 -180
- package/front_end/{models/extensions → panels/common}/ExtensionView.ts +0 -4
- package/front_end/panels/common/FreDialog.ts +1 -1
- package/front_end/panels/common/PersistenceUtils.ts +1 -1
- package/front_end/panels/common/common.ts +4 -1
- package/front_end/panels/console/ConsoleContextSelector.ts +1 -1
- package/front_end/panels/console/ConsoleFormat.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +74 -58
- package/front_end/panels/console/ConsolePanel.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsolePrompt.ts +1 -1
- package/front_end/panels/console/ConsoleSidebar.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +6 -4
- package/front_end/panels/console/ConsoleViewport.ts +1 -1
- package/front_end/panels/console/consoleInsightTeaser.css +4 -0
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/elements/AccessibilityTreeView.ts +1 -1
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +7 -7
- package/front_end/panels/elements/ElementsSidebarPane.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/MetricsSidebarPane.ts +1 -1
- package/front_end/panels/elements/PropertyRenderer.ts +1 -1
- package/front_end/panels/elements/ShortcutTreeElement.ts +1 -1
- package/front_end/panels/elements/StyleEditorWidget.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +48 -10
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/TopLayerContainer.ts +1 -1
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +1 -1
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +13 -13
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +1 -1
- package/front_end/panels/elements/components/CSSPropertyIconResolver.ts +1 -0
- package/front_end/panels/elements/components/CSSQuery.ts +1 -2
- package/front_end/panels/elements/components/CSSVariableValueView.ts +1 -1
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +1 -1
- package/front_end/panels/elements/components/ComputedStyleTrace.ts +1 -1
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +2 -2
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
- package/front_end/panels/elements/components/QueryContainer.ts +2 -2
- package/front_end/panels/elements/components/StylePropertyEditor.ts +66 -1
- package/front_end/panels/emulation/AdvancedApp.ts +1 -1
- package/front_end/panels/emulation/DeviceModeToolbar.ts +1 -1
- package/front_end/panels/emulation/DeviceModeView.ts +1 -1
- package/front_end/panels/emulation/DeviceModeWrapper.ts +1 -1
- package/front_end/panels/emulation/MediaQueryInspector.ts +1 -1
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +2 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +1 -1
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +1 -1
- package/front_end/panels/issues/AffectedCookiesView.ts +1 -1
- package/front_end/panels/issues/AffectedDescendantsWithinSelectElementView.ts +1 -1
- package/front_end/panels/issues/AffectedDirectivesView.ts +1 -1
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +1 -1
- package/front_end/panels/issues/AffectedElementsView.ts +1 -1
- package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +1 -1
- package/front_end/panels/issues/AffectedHeavyAdView.ts +1 -1
- package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +1 -1
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +1 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +1 -1
- package/front_end/panels/issues/AffectedSourcesView.ts +1 -1
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +1 -1
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +1 -1
- package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -1
- package/front_end/panels/issues/GenericIssueDetailsView.ts +1 -1
- package/front_end/panels/issues/IssueKindView.ts +1 -1
- package/front_end/panels/issues/IssueView.ts +1 -1
- package/front_end/panels/issues/IssuesPane.ts +1 -1
- package/front_end/panels/issues/components/ElementsPanelLink.ts +1 -1
- package/front_end/panels/issues/components/HideIssuesMenu.ts +1 -1
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +1 -1
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +1 -1
- package/front_end/panels/layer_viewer/TransformController.ts +1 -1
- package/front_end/panels/layers/LayerPaintProfilerView.ts +1 -1
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +207 -139
- package/front_end/panels/lighthouse/LighthousePanel.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseStartView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseTimespanView.ts +1 -1
- package/front_end/panels/lighthouse/RadioSetting.ts +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +1 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -2
- package/front_end/panels/media/EventDisplayTable.ts +1 -1
- package/front_end/panels/media/EventTimelineView.ts +1 -1
- package/front_end/panels/media/MainView.ts +1 -1
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/media/PlayerMessagesView.ts +1 -1
- package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
- package/front_end/panels/media/TickingFlameChart.ts +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/network/BinaryResourceView.ts +1 -1
- package/front_end/panels/network/EventSourceMessagesView.ts +1 -1
- package/front_end/panels/network/NetworkConfigView.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +21 -2
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +2 -2
- package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +1 -1
- package/front_end/panels/network/NetworkOverview.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +4 -4
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +29 -5
- package/front_end/panels/network/RequestCookiesView.ts +1 -1
- package/front_end/panels/network/RequestInitiatorView.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +3 -4
- package/front_end/panels/network/RequestPreviewView.ts +1 -1
- package/front_end/panels/network/RequestTimingView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -1
- package/front_end/panels/network/SignedExchangeInfoView.ts +1 -1
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +1 -1
- package/front_end/panels/network/components/EditableSpan.ts +1 -1
- package/front_end/panels/network/components/HeaderSectionRow.ts +1 -1
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
- package/front_end/panels/network/components/RequestHeadersView.ts +1 -1
- package/front_end/panels/network/components/RequestTrustTokensView.ts +1 -1
- package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
- package/front_end/panels/network/network-meta.ts +2 -2
- package/front_end/panels/network/networkLogView.css +24 -0
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +1 -1
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -1
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/HeapTimelineOverview.ts +1 -1
- package/front_end/panels/profiler/IsolateSelector.ts +1 -1
- package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfileDataGrid.ts +1 -1
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +1 -1
- package/front_end/panels/profiler/ProfileLauncherView.ts +1 -1
- package/front_end/panels/profiler/ProfileSidebarTreeElement.ts +1 -1
- package/front_end/panels/profiler/ProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -1
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/recorder/components/CreateRecordingView.ts +1 -1
- package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/recorder/components/ReplaySection.ts +1 -1
- package/front_end/panels/recorder/components/SelectButton.ts +1 -1
- package/front_end/panels/recorder/components/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/extensions/ExtensionManager.ts +1 -1
- package/front_end/panels/recorder/models/ScreenshotUtils.ts +1 -1
- package/front_end/panels/screencast/ScreencastApp.ts +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +1 -1
- package/front_end/panels/security/CookieControlsView.ts +1 -1
- package/front_end/panels/security/CookieReportView.ts +1 -1
- package/front_end/panels/security/IPProtectionView.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +2 -2
- package/front_end/panels/security/SecurityPanelSidebar.ts +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/sensors/SensorsView.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +2 -2
- package/front_end/panels/settings/components/SyncSection.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +1 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +1 -1
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/panels/sources/CoveragePlugin.ts +1 -1
- package/front_end/panels/sources/DebuggerPausedMessage.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/OpenFileQuickOpen.ts +1 -1
- package/front_end/panels/sources/PersistenceActions.ts +1 -1
- package/front_end/panels/sources/ProfilePlugin.ts +3 -2
- package/front_end/panels/sources/ResourceOriginPlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/SourcesNavigator.ts +1 -1
- package/front_end/panels/sources/SourcesPanel.ts +7 -7
- package/front_end/panels/sources/SourcesView.ts +1 -1
- package/front_end/panels/sources/TabbedEditorContainer.ts +4 -5
- package/front_end/panels/sources/ThreadsSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/timeline/CLSLinkifier.ts +1 -1
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +1 -1
- package/front_end/panels/timeline/CountersGraph.ts +1 -1
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/StatusDialog.ts +1 -1
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/TimelineController.ts +3 -3
- package/front_end/panels/timeline/TimelineDetailsView.ts +1 -1
- package/front_end/panels/timeline/TimelineEventOverview.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelineHistoryManager.ts +1 -1
- package/front_end/panels/timeline/TimelineLayersView.ts +1 -1
- package/front_end/panels/timeline/TimelineMiniMap.ts +1 -1
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +1 -1
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +1 -1
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +4 -4
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +1 -1
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +1 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +1 -1
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +2 -2
- package/front_end/panels/timeline/components/InteractionBreakdown.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +6 -6
- package/front_end/panels/timeline/components/MetricCard.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +3 -3
- package/front_end/panels/timeline/components/OriginMap.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +1 -1
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +1 -1
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +1 -1
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/panels/timeline/components/TimelineSummary.ts +1 -1
- package/front_end/panels/timeline/components/Utils.ts +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +5 -6
- package/front_end/panels/timeline/components/insights/Checklist.ts +1 -1
- package/front_end/panels/timeline/components/insights/EventRef.ts +1 -1
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +2 -2
- package/front_end/panels/timeline/components/insights/NodeLink.ts +1 -1
- package/front_end/panels/timeline/components/insights/Table.ts +1 -1
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +1 -1
- package/front_end/panels/utils/utils.ts +25 -5
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +474 -472
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +1 -1
- 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.js +4 -4
- 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/bidi/core/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +10 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +1 -1
- 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.js +4 -4
- 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/cdp/Accessibility.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +4 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/tsconfig.compatibility.json +8 -0
- package/front_end/tsconfig.json +3 -1
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/cards/Card.ts +1 -1
- package/front_end/ui/components/chrome_link/ChromeLink.ts +2 -2
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -1
- package/front_end/ui/components/diff_view/DiffView.ts +1 -1
- package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -1
- package/front_end/ui/components/docs/style_property_editor/masonry.html +21 -0
- package/front_end/ui/components/docs/style_property_editor/masonry.ts +50 -0
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -2
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/icon_button/Icon.ts +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +2 -2
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +3 -5
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/SelectMenu.ts +5 -5
- package/front_end/ui/components/node_text/NodeText.ts +1 -2
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/switch/SwitchImpl.ts +3 -3
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaserPlaceholder.ts +1 -1
- package/front_end/ui/components/text_editor/config.ts +1 -1
- package/front_end/ui/components/text_editor/javascript.ts +1 -1
- package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/Dialog.ts +1 -1
- package/front_end/ui/legacy/DropTarget.ts +1 -1
- package/front_end/ui/legacy/FilterBar.ts +1 -1
- package/front_end/ui/legacy/Fragment.ts +1 -1
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/Infobar.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/front_end/ui/legacy/ListControl.ts +1 -1
- package/front_end/ui/legacy/ListWidget.ts +2 -2
- package/front_end/ui/legacy/Panel.ts +1 -1
- package/front_end/ui/legacy/ReportView.ts +1 -1
- package/front_end/ui/legacy/RootView.ts +1 -1
- package/front_end/ui/legacy/SearchableView.ts +1 -1
- package/front_end/ui/legacy/SettingsUI.ts +1 -1
- package/front_end/ui/legacy/SoftContextMenu.ts +1 -1
- package/front_end/ui/legacy/SoftDropDown.ts +1 -1
- package/front_end/ui/legacy/SplitWidget.ts +1 -1
- package/front_end/ui/legacy/SuggestBox.ts +1 -1
- package/front_end/ui/legacy/TabbedPane.ts +1 -1
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +2 -2
- package/front_end/ui/legacy/ViewManager.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -1
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSAngleEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSAngleSwatch.ts +1 -2
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/ColorMixSwatch.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/PieChart.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +1 -1
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +1 -1
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +1 -1
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +1 -1
- package/front_end/ui/lit/i18n-template.ts +1 -1
- package/front_end/ui/visual_logging/Debugging.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -2
- package/mcp/mcp.ts +7 -2
- package/package.json +1 -1
|
@@ -2,1768 +2,1118 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// We want to keep this a IIFE as we want to keep the global scope clean
|
|
6
|
+
// We inject this script via a Classic script
|
|
7
|
+
// https://crsrc.org/c/third_party/blink/renderer/controller/dev_tools_frontend_impl.cc;l=107
|
|
8
|
+
(window => {
|
|
9
|
+
/**
|
|
10
|
+
* A function that tries to check the remotely connected instance
|
|
11
|
+
* major version. You should check against this to provide
|
|
12
|
+
* forward and backwards compatibility.
|
|
13
|
+
*
|
|
14
|
+
* @returns {number|null}
|
|
15
|
+
*/
|
|
16
|
+
function getRemoteMajorVersion() {
|
|
17
|
+
try {
|
|
18
|
+
const remoteVersion = new URLSearchParams(window.location.search).get('remoteVersion');
|
|
19
|
+
if (!remoteVersion) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return parseInt(remoteVersion.split('.')[0], 10);
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
6
27
|
|
|
7
|
-
// DevToolsAPI ----------------------------------------------------------------
|
|
28
|
+
// DevToolsAPI ----------------------------------------------------------------
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {{runtimeAllowedHosts: string[], runtimeBlockedHosts: string[]}} ExtensionHostsPolicy
|
|
31
|
+
* @typedef {{startPage: string, name: string, exposeExperimentalAPIs: boolean, hostsPolicy?: ExtensionHostsPolicy}} ExtensionDescriptor
|
|
32
|
+
*/
|
|
33
|
+
class DevToolsAPIImpl {
|
|
34
|
+
/**
|
|
35
|
+
* @type {string[]}
|
|
36
|
+
*/
|
|
37
|
+
_originsForbiddenForExtensions = [];
|
|
8
38
|
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* @typedef {{startPage: string, name: string, exposeExperimentalAPIs: boolean, hostsPolicy?: ExtensionHostsPolicy}} ExtensionDescriptor
|
|
14
|
-
*/
|
|
15
|
-
const DevToolsAPIImpl = class {
|
|
16
|
-
constructor() {
|
|
39
|
+
/**
|
|
40
|
+
* @type {ExtensionDescriptor[]}
|
|
41
|
+
*/
|
|
42
|
+
_pendingExtensionDescriptors = [];
|
|
17
43
|
/**
|
|
18
44
|
* @type {number}
|
|
19
45
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
46
|
+
_lastCallId = 0;
|
|
22
47
|
/**
|
|
23
|
-
* @type {
|
|
48
|
+
* @type {Record<number, (arg1: object) => void>}
|
|
24
49
|
*/
|
|
25
|
-
|
|
50
|
+
_callbacks = {};
|
|
26
51
|
|
|
27
52
|
/**
|
|
28
|
-
* @type {
|
|
53
|
+
* @type {((param:ExtensionDescriptor)=> void) | null}
|
|
29
54
|
*/
|
|
30
|
-
|
|
55
|
+
_addExtensionCallback = null;
|
|
31
56
|
|
|
32
57
|
/**
|
|
33
|
-
* @type {
|
|
58
|
+
* @type {ReturnType<typeof Promise.withResolvers<string>>}
|
|
34
59
|
*/
|
|
35
|
-
|
|
60
|
+
_initialTargetIdPromiseWithResolver = Promise.withResolvers();
|
|
36
61
|
|
|
37
62
|
/**
|
|
38
|
-
* @
|
|
63
|
+
* @param id
|
|
64
|
+
* @param arg
|
|
39
65
|
*/
|
|
40
|
-
|
|
66
|
+
embedderMessageAck(id, arg) {
|
|
67
|
+
const callback = this._callbacks[id];
|
|
68
|
+
delete this._callbacks[id];
|
|
69
|
+
if (callback) {
|
|
70
|
+
callback(arg);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
41
73
|
|
|
42
74
|
/**
|
|
43
|
-
* @
|
|
75
|
+
* @param method
|
|
76
|
+
* @param args
|
|
77
|
+
* @param callback
|
|
44
78
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const callback = this._callbacks[id];
|
|
56
|
-
delete this._callbacks[id];
|
|
57
|
-
if (callback) {
|
|
58
|
-
callback(arg);
|
|
79
|
+
sendMessageToEmbedder(method, args, callback) {
|
|
80
|
+
const callId = ++this._lastCallId;
|
|
81
|
+
if (callback) {
|
|
82
|
+
this._callbacks[callId] = callback;
|
|
83
|
+
}
|
|
84
|
+
const message = {id: callId, method};
|
|
85
|
+
if (args.length) {
|
|
86
|
+
message.params = args;
|
|
87
|
+
}
|
|
88
|
+
DevToolsHost.sendMessageToEmbedder(JSON.stringify(message));
|
|
59
89
|
}
|
|
60
|
-
}
|
|
61
90
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
91
|
+
/**
|
|
92
|
+
* @typedef {import('./core/host/InspectorFrontendHostAPI.js').Events} Events
|
|
93
|
+
* @typedef {import('./core/host/InspectorFrontendHost.js').InspectorFrontendAPIImplMethods} Methods
|
|
94
|
+
* @param method {`${Events|Methods}`}
|
|
95
|
+
* @param args
|
|
96
|
+
*/
|
|
97
|
+
_dispatchOnInspectorFrontendAPI(method, args) {
|
|
98
|
+
const inspectorFrontendAPI = window.InspectorFrontendAPI;
|
|
99
|
+
if (!inspectorFrontendAPI) {
|
|
100
|
+
// This is the case for device_mode_emulation_frame entrypoint. It's created via `window.open` from
|
|
101
|
+
// the DevTools window, so it shares a context with DevTools but has a separate DevToolsUIBinding and `window` object.
|
|
102
|
+
// We can safely ignore the events since they also arrive on the DevTools `window` object.
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
inspectorFrontendAPI[method].apply(inspectorFrontendAPI, args);
|
|
75
106
|
}
|
|
76
|
-
DevToolsHost.sendMessageToEmbedder(JSON.stringify(message));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @param method
|
|
81
|
-
* @param args
|
|
82
|
-
*/
|
|
83
|
-
_dispatchOnInspectorFrontendAPI(method, args) {
|
|
84
|
-
const inspectorFrontendAPI = /** @type {!Object<string, function()>} */ (window['InspectorFrontendAPI']);
|
|
85
|
-
if (!inspectorFrontendAPI) {
|
|
86
|
-
// This is the case for device_mode_emulation_frame entrypoint. It's created via `window.open` from
|
|
87
|
-
// the DevTools window, so it shares a context with DevTools but has a separate DevToolsUIBinding and `window` object.
|
|
88
|
-
// We can safely ignore the events since they also arrive on the DevTools `window` object.
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
inspectorFrontendAPI[method].apply(inspectorFrontendAPI, args);
|
|
92
|
-
}
|
|
93
107
|
|
|
94
|
-
|
|
108
|
+
// API methods below this line --------------------------------------------
|
|
95
109
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// Support for legacy front-ends (<M41).
|
|
101
|
-
if (window['WebInspector'] && window['WebInspector']['addExtensions']) {
|
|
102
|
-
window['WebInspector']['addExtensions'](extensions);
|
|
110
|
+
/**
|
|
111
|
+
* @param extensions {ExtensionDescriptor[]}
|
|
112
|
+
*/
|
|
113
|
+
addExtensions(extensions) {
|
|
103
114
|
// The addExtensions command is sent as the onload event happens for
|
|
104
115
|
// DevTools front-end. We should buffer this command until the frontend
|
|
105
116
|
// is ready for it.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
117
|
+
if (this._addExtensionCallback) {
|
|
118
|
+
extensions.forEach(this._addExtensionCallback);
|
|
119
|
+
} else {
|
|
120
|
+
this._pendingExtensionDescriptors.push(...extensions);
|
|
121
|
+
}
|
|
110
122
|
}
|
|
111
|
-
}
|
|
112
123
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
/**
|
|
125
|
+
* @param forbiddenOrigins {string[]}
|
|
126
|
+
*/
|
|
127
|
+
setOriginsForbiddenForExtensions(forbiddenOrigins) {
|
|
128
|
+
this._originsForbiddenForExtensions = forbiddenOrigins;
|
|
129
|
+
}
|
|
119
130
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
131
|
+
/**
|
|
132
|
+
* @returns {string[]}
|
|
133
|
+
*/
|
|
134
|
+
getOriginsForbiddenForExtensions() {
|
|
135
|
+
return this._originsForbiddenForExtensions;
|
|
136
|
+
}
|
|
126
137
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
/**
|
|
139
|
+
* @param url {string}
|
|
140
|
+
*/
|
|
141
|
+
appendedToURL(url) {
|
|
142
|
+
this._dispatchOnInspectorFrontendAPI('appendedToURL', [url]);
|
|
143
|
+
}
|
|
133
144
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
145
|
+
/**
|
|
146
|
+
* @param url {string}
|
|
147
|
+
*/
|
|
148
|
+
canceledSaveURL(url) {
|
|
149
|
+
this._dispatchOnInspectorFrontendAPI('canceledSaveURL', [url]);
|
|
150
|
+
}
|
|
140
151
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
152
|
+
contextMenuCleared() {
|
|
153
|
+
this._dispatchOnInspectorFrontendAPI('contextMenuCleared', []);
|
|
154
|
+
}
|
|
144
155
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
156
|
+
/**
|
|
157
|
+
* @param id
|
|
158
|
+
*/
|
|
159
|
+
contextMenuItemSelected(id) {
|
|
160
|
+
this._dispatchOnInspectorFrontendAPI('contextMenuItemSelected', [id]);
|
|
161
|
+
}
|
|
151
162
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
163
|
+
/**
|
|
164
|
+
* @param count {number}
|
|
165
|
+
*/
|
|
166
|
+
deviceCountUpdated(count) {
|
|
167
|
+
this._dispatchOnInspectorFrontendAPI('deviceCountUpdated', [count]);
|
|
168
|
+
}
|
|
158
169
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
170
|
+
/**
|
|
171
|
+
* @param config
|
|
172
|
+
*/
|
|
173
|
+
devicesDiscoveryConfigChanged(config) {
|
|
174
|
+
this._dispatchOnInspectorFrontendAPI('devicesDiscoveryConfigChanged', [config]);
|
|
175
|
+
}
|
|
165
176
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
177
|
+
/**
|
|
178
|
+
* @param status
|
|
179
|
+
*/
|
|
180
|
+
devicesPortForwardingStatusChanged(status) {
|
|
181
|
+
this._dispatchOnInspectorFrontendAPI('devicesPortForwardingStatusChanged', [status]);
|
|
182
|
+
}
|
|
172
183
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
/**
|
|
185
|
+
* @param devices
|
|
186
|
+
*/
|
|
187
|
+
devicesUpdated(devices) {
|
|
188
|
+
this._dispatchOnInspectorFrontendAPI('devicesUpdated', [devices]);
|
|
189
|
+
}
|
|
179
190
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
/**
|
|
192
|
+
* @param message
|
|
193
|
+
*/
|
|
194
|
+
dispatchMessage(message) {
|
|
195
|
+
this._dispatchOnInspectorFrontendAPI('dispatchMessage', [message]);
|
|
196
|
+
}
|
|
186
197
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
198
|
+
/**
|
|
199
|
+
* @param messageChunk
|
|
200
|
+
* @param messageSize
|
|
201
|
+
*/
|
|
202
|
+
dispatchMessageChunk(messageChunk, messageSize) {
|
|
203
|
+
this._dispatchOnInspectorFrontendAPI('dispatchMessageChunk', [messageChunk, messageSize]);
|
|
204
|
+
}
|
|
194
205
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
206
|
+
enterInspectElementMode() {
|
|
207
|
+
this._dispatchOnInspectorFrontendAPI('enterInspectElementMode', []);
|
|
208
|
+
}
|
|
198
209
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
210
|
+
/**
|
|
211
|
+
* @param color
|
|
212
|
+
*/
|
|
213
|
+
eyeDropperPickedColor(color) {
|
|
214
|
+
this._dispatchOnInspectorFrontendAPI('eyeDropperPickedColor', [color]);
|
|
215
|
+
}
|
|
205
216
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
217
|
+
/**
|
|
218
|
+
* @param fileSystems
|
|
219
|
+
*/
|
|
220
|
+
fileSystemsLoaded(fileSystems) {
|
|
221
|
+
this._dispatchOnInspectorFrontendAPI('fileSystemsLoaded', [fileSystems]);
|
|
222
|
+
}
|
|
212
223
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
224
|
+
/**
|
|
225
|
+
* @param fileSystemPath
|
|
226
|
+
*/
|
|
227
|
+
fileSystemRemoved(fileSystemPath) {
|
|
228
|
+
this._dispatchOnInspectorFrontendAPI('fileSystemRemoved', [fileSystemPath]);
|
|
229
|
+
}
|
|
219
230
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
231
|
+
/**
|
|
232
|
+
* @param error
|
|
233
|
+
* @param fileSystem
|
|
234
|
+
*/
|
|
235
|
+
fileSystemAdded(error, fileSystem) {
|
|
236
|
+
this._dispatchOnInspectorFrontendAPI('fileSystemAdded', [error, fileSystem]);
|
|
237
|
+
}
|
|
227
238
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
// Support for legacy front-ends (<M58)
|
|
235
|
-
if (window['InspectorFrontendAPI'] && window['InspectorFrontendAPI']['fileSystemFilesChanged']) {
|
|
236
|
-
this._dispatchOnInspectorFrontendAPI(
|
|
237
|
-
'fileSystemFilesChanged', [changedPaths.concat(addedPaths).concat(removedPaths)]);
|
|
238
|
-
} else {
|
|
239
|
+
/**
|
|
240
|
+
* @param changedPaths
|
|
241
|
+
* @param addedPaths
|
|
242
|
+
* @param removedPaths
|
|
243
|
+
*/
|
|
244
|
+
fileSystemFilesChangedAddedRemoved(changedPaths, addedPaths, removedPaths) {
|
|
239
245
|
this._dispatchOnInspectorFrontendAPI(
|
|
240
246
|
'fileSystemFilesChangedAddedRemoved', [changedPaths, addedPaths, removedPaths]);
|
|
241
247
|
}
|
|
242
|
-
}
|
|
243
248
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
/**
|
|
250
|
+
* @param requestId
|
|
251
|
+
* @param fileSystemPath
|
|
252
|
+
* @param totalWork
|
|
253
|
+
*/
|
|
254
|
+
indexingTotalWorkCalculated(requestId, fileSystemPath, totalWork) {
|
|
255
|
+
this._dispatchOnInspectorFrontendAPI('indexingTotalWorkCalculated', [requestId, fileSystemPath, totalWork]);
|
|
256
|
+
}
|
|
252
257
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
/**
|
|
259
|
+
* @param requestId
|
|
260
|
+
* @param fileSystemPath
|
|
261
|
+
* @param worked
|
|
262
|
+
*/
|
|
263
|
+
indexingWorked(requestId, fileSystemPath, worked) {
|
|
264
|
+
this._dispatchOnInspectorFrontendAPI('indexingWorked', [requestId, fileSystemPath, worked]);
|
|
265
|
+
}
|
|
261
266
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
/**
|
|
268
|
+
* @param requestId
|
|
269
|
+
* @param fileSystemPath
|
|
270
|
+
*/
|
|
271
|
+
indexingDone(requestId, fileSystemPath) {
|
|
272
|
+
this._dispatchOnInspectorFrontendAPI('indexingDone', [requestId, fileSystemPath]);
|
|
273
|
+
}
|
|
269
274
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
/**
|
|
276
|
+
* @param event
|
|
277
|
+
*/
|
|
278
|
+
keyEventUnhandled(event) {
|
|
279
|
+
event.keyIdentifier = keyCodeToKeyIdentifier(event.keyCode);
|
|
280
|
+
this._dispatchOnInspectorFrontendAPI('keyEventUnhandled', [event]);
|
|
281
|
+
}
|
|
277
282
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
283
|
+
/**
|
|
284
|
+
* @param callback {(param: object) => unknown}
|
|
285
|
+
*/
|
|
286
|
+
setAddExtensionCallback(callback) {
|
|
287
|
+
this._addExtensionCallback = callback;
|
|
288
|
+
if (this._pendingExtensionDescriptors.length) {
|
|
289
|
+
this._pendingExtensionDescriptors.forEach(this._addExtensionCallback);
|
|
290
|
+
this._pendingExtensionDescriptors = [];
|
|
291
|
+
}
|
|
286
292
|
}
|
|
287
|
-
}
|
|
288
293
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
/**
|
|
295
|
+
* @param hard {boolean}
|
|
296
|
+
*/
|
|
297
|
+
reloadInspectedPage(hard) {
|
|
298
|
+
this._dispatchOnInspectorFrontendAPI('reloadInspectedPage', [hard]);
|
|
299
|
+
}
|
|
295
300
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
301
|
+
/**
|
|
302
|
+
* @param url
|
|
303
|
+
* @param lineNumber
|
|
304
|
+
* @param columnNumber
|
|
305
|
+
*/
|
|
306
|
+
revealSourceLine(url, lineNumber, columnNumber) {
|
|
307
|
+
this._dispatchOnInspectorFrontendAPI('revealSourceLine', [url, lineNumber, columnNumber]);
|
|
308
|
+
}
|
|
304
309
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
/**
|
|
311
|
+
* @param url
|
|
312
|
+
* @param fileSystemPath
|
|
313
|
+
*/
|
|
314
|
+
savedURL(url, fileSystemPath) {
|
|
315
|
+
this._dispatchOnInspectorFrontendAPI('savedURL', [url, fileSystemPath]);
|
|
316
|
+
}
|
|
312
317
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
318
|
+
/**
|
|
319
|
+
* @param requestId
|
|
320
|
+
* @param fileSystemPath
|
|
321
|
+
* @param files
|
|
322
|
+
*/
|
|
323
|
+
searchCompleted(requestId, fileSystemPath, files) {
|
|
324
|
+
this._dispatchOnInspectorFrontendAPI('searchCompleted', [requestId, fileSystemPath, files]);
|
|
325
|
+
}
|
|
321
326
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
327
|
+
colorThemeChanged() {
|
|
328
|
+
this._dispatchOnInspectorFrontendAPI('colorThemeChanged', []);
|
|
329
|
+
}
|
|
325
330
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
/**
|
|
332
|
+
* @param tabId {string}
|
|
333
|
+
*/
|
|
334
|
+
setInspectedTabId(tabId) {
|
|
335
|
+
this._inspectedTabIdValue = tabId;
|
|
331
336
|
|
|
332
|
-
// Support for legacy front-ends (<M41).
|
|
333
|
-
if (window['WebInspector'] && window['WebInspector']['setInspectedTabId']) {
|
|
334
|
-
window['WebInspector']['setInspectedTabId'](tabId);
|
|
335
|
-
} else {
|
|
336
337
|
this._dispatchOnInspectorFrontendAPI('setInspectedTabId', [tabId]);
|
|
337
338
|
}
|
|
338
|
-
}
|
|
339
339
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* @returns
|
|
349
|
-
*/
|
|
350
|
-
getInspectedTabId() {
|
|
351
|
-
return this._inspectedTabIdValue;
|
|
352
|
-
}
|
|
340
|
+
/**
|
|
341
|
+
* @param targetId {string}
|
|
342
|
+
*/
|
|
343
|
+
setInitialTargetId(targetId) {
|
|
344
|
+
this._initialTargetIdPromiseWithResolver.resolve(targetId);
|
|
345
|
+
}
|
|
353
346
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
347
|
+
/**
|
|
348
|
+
* @returns
|
|
349
|
+
*/
|
|
350
|
+
getInspectedTabId() {
|
|
351
|
+
return this._inspectedTabIdValue;
|
|
352
|
+
}
|
|
360
353
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
354
|
+
/**
|
|
355
|
+
* @param useSoftMenu {boolean}
|
|
356
|
+
*/
|
|
357
|
+
setUseSoftMenu(useSoftMenu) {
|
|
358
|
+
this._dispatchOnInspectorFrontendAPI('setUseSoftMenu', [useSoftMenu]);
|
|
359
|
+
}
|
|
367
360
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
this._dispatchOnInspectorFrontendAPI('streamWrite', [id, encoded ? this._decodeBase64(chunk) : chunk]);
|
|
375
|
-
}
|
|
361
|
+
/**
|
|
362
|
+
* @param panelName {string}
|
|
363
|
+
*/
|
|
364
|
+
showPanel(panelName) {
|
|
365
|
+
this._dispatchOnInspectorFrontendAPI('showPanel', [panelName]);
|
|
366
|
+
}
|
|
376
367
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
if (request.status === 200) {
|
|
386
|
-
return request.responseText;
|
|
387
|
-
}
|
|
388
|
-
console.error('Error while decoding chunk in streamWrite');
|
|
389
|
-
return '';
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
const DevToolsAPI = new DevToolsAPIImpl();
|
|
394
|
-
window.DevToolsAPI = DevToolsAPI;
|
|
395
|
-
|
|
396
|
-
// InspectorFrontendHostImpl --------------------------------------------------
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Enum for recordPerformanceHistogram
|
|
400
|
-
* Warning: There is another definition of this enum in the DevTools code
|
|
401
|
-
* base, keep them in sync:
|
|
402
|
-
* front_end/core/host/InspectorFrontendHostAPI.ts
|
|
403
|
-
* @readonly
|
|
404
|
-
* @enum {string}
|
|
405
|
-
*/
|
|
406
|
-
const EnumeratedHistogram = {
|
|
407
|
-
// LINT.IfChange(EnumeratedHistogram)
|
|
408
|
-
ActionTaken: 'DevTools.ActionTaken',
|
|
409
|
-
DeveloperResourceLoaded: 'DevTools.DeveloperResourceLoaded',
|
|
410
|
-
DeveloperResourceScheme: 'DevTools.DeveloperResourceScheme',
|
|
411
|
-
ExperimentDisabled: 'DevTools.ExperimentDisabled',
|
|
412
|
-
ExperimentDisabledAtLaunch: 'DevTools.ExperimentDisabledAtLaunch',
|
|
413
|
-
ExperimentEnabled: 'DevTools.ExperimentEnabled',
|
|
414
|
-
ExperimentEnabledAtLaunch: 'DevTools.ExperimentEnabledAtLaunch',
|
|
415
|
-
IssueCreated: 'DevTools.IssueCreated',
|
|
416
|
-
IssuesPanelIssueExpanded: 'DevTools.IssuesPanelIssueExpanded',
|
|
417
|
-
IssuesPanelOpenedFrom: 'DevTools.IssuesPanelOpenedFrom',
|
|
418
|
-
IssuesPanelResourceOpened: 'DevTools.IssuesPanelResourceOpened',
|
|
419
|
-
KeybindSetSettingChanged: 'DevTools.KeybindSetSettingChanged',
|
|
420
|
-
KeyboardShortcutFired: 'DevTools.KeyboardShortcutFired',
|
|
421
|
-
Language: 'DevTools.Language',
|
|
422
|
-
LighthouseModeRun: 'DevTools.LighthouseModeRun',
|
|
423
|
-
LighthouseCategoryUsed: 'DevTools.LighthouseCategoryUsed',
|
|
424
|
-
PanelShown: 'DevTools.PanelShown',
|
|
425
|
-
RecordingAssertion: 'DevTools.RecordingAssertion',
|
|
426
|
-
RecordingCodeToggled: 'DevTools.RecordingCodeToggled',
|
|
427
|
-
RecordingCopiedToClipboard: 'DevTools.RecordingCopiedToClipboard',
|
|
428
|
-
RecordingEdited: 'DevTools.RecordingEdited',
|
|
429
|
-
RecordingExported: 'DevTools.RecordingExported',
|
|
430
|
-
RecordingReplayFinished: 'DevTools.RecordingReplayFinished',
|
|
431
|
-
RecordingReplaySpeed: 'DevTools.RecordingReplaySpeed',
|
|
432
|
-
RecordingReplayStarted: 'DevTools.RecordingReplayStarted',
|
|
433
|
-
RecordingToggled: 'DevTools.RecordingToggled',
|
|
434
|
-
SourcesPanelFileDebugged: 'DevTools.SourcesPanelFileDebugged',
|
|
435
|
-
SourcesPanelFileOpened: 'DevTools.SourcesPanelFileOpened',
|
|
436
|
-
NetworkPanelResponsePreviewOpened: 'DevTools.NetworkPanelResponsePreviewOpened',
|
|
437
|
-
TimelineNavigationSettingState: 'DevTools.TimelineNavigationSettingState',
|
|
438
|
-
SyncSetting: 'DevTools.SyncSetting',
|
|
439
|
-
SwatchActivated: 'DevTools.SwatchActivated',
|
|
440
|
-
AnimationPlaybackRateChanged: 'DevTools.AnimationPlaybackRateChanged',
|
|
441
|
-
// LINT.ThenChange(/front_end/core/host/InspectorFrontendHostAPI.ts:EnumeratedHistogram)
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* @implements {InspectorFrontendHostAPI}
|
|
446
|
-
*/
|
|
447
|
-
const InspectorFrontendHostImpl = class {
|
|
448
|
-
/**
|
|
449
|
-
* @returns
|
|
450
|
-
*/
|
|
451
|
-
getSelectionBackgroundColor() {
|
|
452
|
-
return '#6e86ff';
|
|
453
|
-
}
|
|
368
|
+
/**
|
|
369
|
+
* @param id {number}
|
|
370
|
+
* @param chunk {string}
|
|
371
|
+
* @param encoded {boolean}
|
|
372
|
+
*/
|
|
373
|
+
streamWrite(id, chunk, encoded) {
|
|
374
|
+
this._dispatchOnInspectorFrontendAPI('streamWrite', [id, encoded ? this._decodeBase64(chunk) : chunk]);
|
|
375
|
+
}
|
|
454
376
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
377
|
+
/**
|
|
378
|
+
* @param chunk {string}
|
|
379
|
+
* @returns {string}
|
|
380
|
+
*/
|
|
381
|
+
_decodeBase64(chunk) {
|
|
382
|
+
const request = new XMLHttpRequest();
|
|
383
|
+
request.open('GET', 'data:text/plain;base64,' + chunk, false);
|
|
384
|
+
request.send(null);
|
|
385
|
+
if (request.status === 200) {
|
|
386
|
+
return request.responseText;
|
|
387
|
+
}
|
|
388
|
+
console.error('Error while decoding chunk in streamWrite');
|
|
389
|
+
return '';
|
|
390
|
+
}
|
|
460
391
|
}
|
|
461
392
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
393
|
+
const DevToolsAPI = new DevToolsAPIImpl();
|
|
394
|
+
window.DevToolsAPI = DevToolsAPI;
|
|
395
|
+
|
|
396
|
+
// InspectorFrontendHostImpl --------------------------------------------------
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Enum for recordPerformanceHistogram
|
|
400
|
+
* Warning: There is another definition of this enum in the DevTools code
|
|
401
|
+
* base, keep them in sync:
|
|
402
|
+
* front_end/core/host/InspectorFrontendHostAPI.ts
|
|
403
|
+
* @readonly
|
|
404
|
+
* @enum {string}
|
|
405
|
+
*/
|
|
406
|
+
const EnumeratedHistogram = {
|
|
407
|
+
// LINT.IfChange(EnumeratedHistogram)
|
|
408
|
+
ActionTaken: 'DevTools.ActionTaken',
|
|
409
|
+
DeveloperResourceLoaded: 'DevTools.DeveloperResourceLoaded',
|
|
410
|
+
DeveloperResourceScheme: 'DevTools.DeveloperResourceScheme',
|
|
411
|
+
ExperimentDisabled: 'DevTools.ExperimentDisabled',
|
|
412
|
+
ExperimentDisabledAtLaunch: 'DevTools.ExperimentDisabledAtLaunch',
|
|
413
|
+
ExperimentEnabled: 'DevTools.ExperimentEnabled',
|
|
414
|
+
ExperimentEnabledAtLaunch: 'DevTools.ExperimentEnabledAtLaunch',
|
|
415
|
+
IssueCreated: 'DevTools.IssueCreated',
|
|
416
|
+
IssuesPanelIssueExpanded: 'DevTools.IssuesPanelIssueExpanded',
|
|
417
|
+
IssuesPanelOpenedFrom: 'DevTools.IssuesPanelOpenedFrom',
|
|
418
|
+
IssuesPanelResourceOpened: 'DevTools.IssuesPanelResourceOpened',
|
|
419
|
+
KeybindSetSettingChanged: 'DevTools.KeybindSetSettingChanged',
|
|
420
|
+
KeyboardShortcutFired: 'DevTools.KeyboardShortcutFired',
|
|
421
|
+
Language: 'DevTools.Language',
|
|
422
|
+
LighthouseModeRun: 'DevTools.LighthouseModeRun',
|
|
423
|
+
LighthouseCategoryUsed: 'DevTools.LighthouseCategoryUsed',
|
|
424
|
+
PanelShown: 'DevTools.PanelShown',
|
|
425
|
+
RecordingAssertion: 'DevTools.RecordingAssertion',
|
|
426
|
+
RecordingCodeToggled: 'DevTools.RecordingCodeToggled',
|
|
427
|
+
RecordingCopiedToClipboard: 'DevTools.RecordingCopiedToClipboard',
|
|
428
|
+
RecordingEdited: 'DevTools.RecordingEdited',
|
|
429
|
+
RecordingExported: 'DevTools.RecordingExported',
|
|
430
|
+
RecordingReplayFinished: 'DevTools.RecordingReplayFinished',
|
|
431
|
+
RecordingReplaySpeed: 'DevTools.RecordingReplaySpeed',
|
|
432
|
+
RecordingReplayStarted: 'DevTools.RecordingReplayStarted',
|
|
433
|
+
RecordingToggled: 'DevTools.RecordingToggled',
|
|
434
|
+
SourcesPanelFileDebugged: 'DevTools.SourcesPanelFileDebugged',
|
|
435
|
+
SourcesPanelFileOpened: 'DevTools.SourcesPanelFileOpened',
|
|
436
|
+
NetworkPanelResponsePreviewOpened: 'DevTools.NetworkPanelResponsePreviewOpened',
|
|
437
|
+
TimelineNavigationSettingState: 'DevTools.TimelineNavigationSettingState',
|
|
438
|
+
SyncSetting: 'DevTools.SyncSetting',
|
|
439
|
+
SwatchActivated: 'DevTools.SwatchActivated',
|
|
440
|
+
AnimationPlaybackRateChanged: 'DevTools.AnimationPlaybackRateChanged'
|
|
441
|
+
// LINT.ThenChange(/front_end/core/host/InspectorFrontendHostAPI.ts:EnumeratedHistogram)
|
|
442
|
+
};
|
|
468
443
|
|
|
469
444
|
/**
|
|
470
|
-
* @
|
|
445
|
+
* @typedef {import('./core/host/InspectorFrontendHostAPI.js').InspectorFrontendHostAPI} InspectorFrontendHostAPI
|
|
446
|
+
* @implements {InspectorFrontendHostAPI}
|
|
471
447
|
*/
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
448
|
+
class InspectorFrontendHostImpl {
|
|
449
|
+
/**
|
|
450
|
+
* Update inside `front_end/core/host/InspectorFrontendHost.ts:627`
|
|
451
|
+
* @type {any}
|
|
452
|
+
*/
|
|
453
|
+
events;
|
|
475
454
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
return DevToolsHost.platform();
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* @override
|
|
486
|
-
*/
|
|
487
|
-
loadCompleted() {
|
|
488
|
-
DevToolsAPI.sendMessageToEmbedder('loadCompleted', [], null);
|
|
489
|
-
// Support for legacy (<57) frontends.
|
|
490
|
-
if (window.Runtime && window.Runtime.queryParam) {
|
|
491
|
-
const panelToOpen = window.Runtime.queryParam('panel');
|
|
492
|
-
if (panelToOpen) {
|
|
493
|
-
window.DevToolsAPI.showPanel(panelToOpen);
|
|
494
|
-
}
|
|
455
|
+
/**
|
|
456
|
+
* @returns
|
|
457
|
+
*/
|
|
458
|
+
platform() {
|
|
459
|
+
return DevToolsHost.platform();
|
|
495
460
|
}
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* @override
|
|
500
|
-
*/
|
|
501
|
-
bringToFront() {
|
|
502
|
-
DevToolsAPI.sendMessageToEmbedder('bringToFront', [], null);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* @override
|
|
507
|
-
*/
|
|
508
|
-
closeWindow() {
|
|
509
|
-
DevToolsAPI.sendMessageToEmbedder('closeWindow', [], null);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* @override
|
|
514
|
-
* @param isDocked
|
|
515
|
-
* @param callback
|
|
516
|
-
*/
|
|
517
|
-
setIsDocked(isDocked, callback) {
|
|
518
|
-
DevToolsAPI.sendMessageToEmbedder('setIsDocked', [isDocked], callback);
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* @override
|
|
523
|
-
* @param trigger
|
|
524
|
-
* @param callback
|
|
525
|
-
*/
|
|
526
|
-
showSurvey(trigger, callback) {
|
|
527
|
-
DevToolsAPI.sendMessageToEmbedder('showSurvey', [trigger], /** @type {function(?Object)} */ (callback));
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* @override
|
|
532
|
-
* @param trigger
|
|
533
|
-
* @param callback
|
|
534
|
-
*/
|
|
535
|
-
canShowSurvey(trigger, callback) {
|
|
536
|
-
DevToolsAPI.sendMessageToEmbedder('canShowSurvey', [trigger], /** @type {function(?Object)} */ (callback));
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Requests inspected page to be placed atop of the inspector frontend with specified bounds.
|
|
541
|
-
* @override
|
|
542
|
-
* @param bounds
|
|
543
|
-
*/
|
|
544
|
-
setInspectedPageBounds(bounds) {
|
|
545
|
-
DevToolsAPI.sendMessageToEmbedder('setInspectedPageBounds', [bounds], null);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* @override
|
|
550
|
-
*/
|
|
551
|
-
inspectElementCompleted() {
|
|
552
|
-
DevToolsAPI.sendMessageToEmbedder('inspectElementCompleted', [], null);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* @override
|
|
557
|
-
* @param url
|
|
558
|
-
* @param headers
|
|
559
|
-
* @param streamId
|
|
560
|
-
* @param callback
|
|
561
|
-
*/
|
|
562
|
-
loadNetworkResource(url, headers, streamId, callback) {
|
|
563
|
-
DevToolsAPI.sendMessageToEmbedder(
|
|
564
|
-
'loadNetworkResource', [url, headers, streamId], /** @type {function(?Object)} */ (callback));
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* @override
|
|
569
|
-
* @param name
|
|
570
|
-
* @param options
|
|
571
|
-
*/
|
|
572
|
-
registerPreference(name, options) {
|
|
573
|
-
DevToolsAPI.sendMessageToEmbedder('registerPreference', [name, options], null);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* @override
|
|
578
|
-
* @param callback
|
|
579
|
-
*/
|
|
580
|
-
getPreferences(callback) {
|
|
581
|
-
DevToolsAPI.sendMessageToEmbedder('getPreferences', [], /** @type {function(?Object)} */ (callback));
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* @override
|
|
586
|
-
* @param name
|
|
587
|
-
* @param callback
|
|
588
|
-
*/
|
|
589
|
-
getPreference(name, callback) {
|
|
590
|
-
DevToolsAPI.sendMessageToEmbedder('getPreference', [name], /** @type {function(string)} */ (callback));
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* @override
|
|
595
|
-
* @param name
|
|
596
|
-
* @param value
|
|
597
|
-
*/
|
|
598
|
-
setPreference(name, value) {
|
|
599
|
-
DevToolsAPI.sendMessageToEmbedder('setPreference', [name, value], null);
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* @override
|
|
604
|
-
* @param name
|
|
605
|
-
*/
|
|
606
|
-
removePreference(name) {
|
|
607
|
-
DevToolsAPI.sendMessageToEmbedder('removePreference', [name], null);
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* @override
|
|
612
|
-
*/
|
|
613
|
-
clearPreferences() {
|
|
614
|
-
DevToolsAPI.sendMessageToEmbedder('clearPreferences', [], null);
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* @override
|
|
619
|
-
* @param callback
|
|
620
|
-
*/
|
|
621
|
-
getSyncInformation(callback) {
|
|
622
|
-
DevToolsAPI.sendMessageToEmbedder('getSyncInformation', [], callback);
|
|
623
|
-
}
|
|
624
461
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
* @param callback
|
|
628
|
-
*/
|
|
629
|
-
getHostConfig(callback) {
|
|
630
|
-
DevToolsAPI.sendMessageToEmbedder('getHostConfig', [], hostConfig => {
|
|
631
|
-
const majorVersion = getRemoteMajorVersion();
|
|
632
|
-
if (majorVersion && majorVersion < 129 && hostConfig?.aidaAvailability) {
|
|
633
|
-
return callback(this.hostConfigNewToOld(hostConfig));
|
|
634
|
-
}
|
|
635
|
-
return callback(hostConfig);
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* @param newConfig
|
|
641
|
-
*/
|
|
642
|
-
hostConfigNewToOld(newConfig) {
|
|
643
|
-
const devToolsConsoleInsights = {
|
|
644
|
-
enabled: (newConfig.devToolsConsoleInsights?.enabled && newConfig.aidaAvailability?.enabled) ?? false,
|
|
645
|
-
aidaModelId: newConfig.devToolsConsoleInsights?.modelId ?? '',
|
|
646
|
-
aidaTemperature: newConfig.devToolsConsoleInsights?.temperature ?? 0,
|
|
647
|
-
blockedByAge: newConfig.aidaAvailability?.blockedByAge ?? true,
|
|
648
|
-
blockedByEnterprisePolicy: newConfig.aidaAvailability?.blockedByEnterprisePolicy ?? true,
|
|
649
|
-
blockedByFeatureFlag:
|
|
650
|
-
(newConfig.devToolsConsoleInsights?.enabled && newConfig.aidaAvailability?.enabled) ?? false,
|
|
651
|
-
blockedByGeo: newConfig.aidaAvailability?.blockedByGeo ?? true,
|
|
652
|
-
blockedByRollout: false,
|
|
653
|
-
disallowLogging: newConfig.aidaAvailability?.disallowLogging ?? true,
|
|
654
|
-
optIn: false,
|
|
655
|
-
};
|
|
656
|
-
const devToolsFreestylerDogfood = {
|
|
657
|
-
enabled: (newConfig.devToolsFreestyler?.enabled && newConfig.aidaAvailability?.enabled) ?? false,
|
|
658
|
-
aidaModelId: newConfig.devToolsFreestyler?.modelId ?? '',
|
|
659
|
-
aidaTemperature: newConfig.devToolsFreestyler?.temperature ?? 0,
|
|
660
|
-
blockedByAge: newConfig.aidaAvailability?.blockedByAge ?? true,
|
|
661
|
-
blockedByEnterprisePolicy: newConfig.aidaAvailability?.blockedByEnterprisePolicy ?? true,
|
|
662
|
-
blockedByGeo: newConfig.aidaAvailability?.blockedByGeo ?? true,
|
|
663
|
-
};
|
|
664
|
-
return {
|
|
665
|
-
devToolsConsoleInsights,
|
|
666
|
-
devToolsFreestylerDogfood,
|
|
667
|
-
devToolsVeLogging: newConfig.devToolsVeLogging,
|
|
668
|
-
isOffTheRecord: newConfig.isOffTheRecord,
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* @override
|
|
674
|
-
* @param origin
|
|
675
|
-
* @param script
|
|
676
|
-
*/
|
|
677
|
-
setInjectedScriptForOrigin(origin, script) {
|
|
678
|
-
DevToolsAPI.sendMessageToEmbedder('registerExtensionsAPI', [origin, script], null);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* @override
|
|
683
|
-
* @param url
|
|
684
|
-
*/
|
|
685
|
-
inspectedURLChanged(url) {
|
|
686
|
-
DevToolsAPI.sendMessageToEmbedder('inspectedURLChanged', [url], null);
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* @override
|
|
691
|
-
* @param text
|
|
692
|
-
*/
|
|
693
|
-
copyText(text) {
|
|
694
|
-
DevToolsHost.copyText(text);
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* @override
|
|
699
|
-
* @param url
|
|
700
|
-
*/
|
|
701
|
-
openInNewTab(url) {
|
|
702
|
-
DevToolsAPI.sendMessageToEmbedder('openInNewTab', [url], null);
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
/**
|
|
706
|
-
* @override
|
|
707
|
-
* @param query
|
|
708
|
-
*/
|
|
709
|
-
openSearchResultsInNewTab(query) {
|
|
710
|
-
DevToolsAPI.sendMessageToEmbedder('openSearchResultsInNewTab', [query], null);
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* @override
|
|
715
|
-
* @param fileSystemPath
|
|
716
|
-
*/
|
|
717
|
-
showItemInFolder(fileSystemPath) {
|
|
718
|
-
DevToolsAPI.sendMessageToEmbedder('showItemInFolder', [fileSystemPath], null);
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
/**
|
|
722
|
-
* @override
|
|
723
|
-
* @param url
|
|
724
|
-
* @param content
|
|
725
|
-
* @param forceSaveAs
|
|
726
|
-
* @param isBase64
|
|
727
|
-
*/
|
|
728
|
-
save(url, content, forceSaveAs, isBase64) {
|
|
729
|
-
DevToolsAPI.sendMessageToEmbedder('save', [url, content, forceSaveAs, isBase64], null);
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* @override
|
|
734
|
-
* @param url
|
|
735
|
-
* @param content
|
|
736
|
-
*/
|
|
737
|
-
append(url, content) {
|
|
738
|
-
DevToolsAPI.sendMessageToEmbedder('append', [url, content], null);
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* @override
|
|
743
|
-
* @param url
|
|
744
|
-
*/
|
|
745
|
-
close(url) {
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
/**
|
|
749
|
-
* @override
|
|
750
|
-
* @param message
|
|
751
|
-
*/
|
|
752
|
-
sendMessageToBackend(message) {
|
|
753
|
-
DevToolsAPI.sendMessageToEmbedder('dispatchProtocolMessage', [message], null);
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
/**
|
|
757
|
-
* @override
|
|
758
|
-
* @param histogramName
|
|
759
|
-
* @param sample
|
|
760
|
-
* @param min
|
|
761
|
-
* @param exclusiveMax
|
|
762
|
-
* @param bucketSize
|
|
763
|
-
*/
|
|
764
|
-
recordCountHistogram(histogramName, sample, min, exclusiveMax, bucketSize) {
|
|
765
|
-
DevToolsAPI.sendMessageToEmbedder(
|
|
766
|
-
'recordCountHistogram', [histogramName, sample, min, exclusiveMax, bucketSize], null);
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* @override
|
|
771
|
-
* @param actionName
|
|
772
|
-
* @param actionCode
|
|
773
|
-
* @param bucketSize
|
|
774
|
-
*/
|
|
775
|
-
recordEnumeratedHistogram(actionName, actionCode, bucketSize) {
|
|
776
|
-
if (!Object.values(EnumeratedHistogram).includes(actionName)) {
|
|
777
|
-
return;
|
|
462
|
+
loadCompleted() {
|
|
463
|
+
DevToolsAPI.sendMessageToEmbedder('loadCompleted', [], null);
|
|
778
464
|
}
|
|
779
|
-
DevToolsAPI.sendMessageToEmbedder('recordEnumeratedHistogram', [actionName, actionCode, bucketSize], null);
|
|
780
|
-
}
|
|
781
465
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
* @param duration
|
|
786
|
-
*/
|
|
787
|
-
recordPerformanceHistogram(histogramName, duration) {
|
|
788
|
-
DevToolsAPI.sendMessageToEmbedder('recordPerformanceHistogram', [histogramName, duration], null);
|
|
789
|
-
}
|
|
466
|
+
bringToFront() {
|
|
467
|
+
DevToolsAPI.sendMessageToEmbedder('bringToFront', [], null);
|
|
468
|
+
}
|
|
790
469
|
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
*/
|
|
795
|
-
recordNewBadgeUsage(featureName) {
|
|
796
|
-
DevToolsAPI.sendMessageToEmbedder('recordNewBadgeUsage', [featureName], null);
|
|
797
|
-
}
|
|
470
|
+
closeWindow() {
|
|
471
|
+
DevToolsAPI.sendMessageToEmbedder('closeWindow', [], null);
|
|
472
|
+
}
|
|
798
473
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
474
|
+
/**
|
|
475
|
+
* @param isDocked
|
|
476
|
+
* @param callback
|
|
477
|
+
*/
|
|
478
|
+
setIsDocked(isDocked, callback) {
|
|
479
|
+
DevToolsAPI.sendMessageToEmbedder('setIsDocked', [isDocked], callback);
|
|
480
|
+
}
|
|
806
481
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
callback,
|
|
815
|
-
);
|
|
816
|
-
}
|
|
482
|
+
/**
|
|
483
|
+
* @param trigger
|
|
484
|
+
* @param callback {(param: object) => unknown}
|
|
485
|
+
*/
|
|
486
|
+
showSurvey(trigger, callback) {
|
|
487
|
+
DevToolsAPI.sendMessageToEmbedder('showSurvey', [trigger], callback);
|
|
488
|
+
}
|
|
817
489
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
null,
|
|
826
|
-
);
|
|
827
|
-
}
|
|
490
|
+
/**
|
|
491
|
+
* @param trigger
|
|
492
|
+
* @param callback {(param: object) => unknown}
|
|
493
|
+
*/
|
|
494
|
+
canShowSurvey(trigger, callback) {
|
|
495
|
+
DevToolsAPI.sendMessageToEmbedder('canShowSurvey', [trigger], callback);
|
|
496
|
+
}
|
|
828
497
|
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
498
|
+
/**
|
|
499
|
+
* Requests inspected page to be placed atop of the inspector frontend with specified bounds.
|
|
500
|
+
* @param bounds
|
|
501
|
+
*/
|
|
502
|
+
setInspectedPageBounds(bounds) {
|
|
503
|
+
DevToolsAPI.sendMessageToEmbedder('setInspectedPageBounds', [bounds], null);
|
|
504
|
+
}
|
|
835
505
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
*/
|
|
840
|
-
addFileSystem(type) {
|
|
841
|
-
DevToolsAPI.sendMessageToEmbedder('addFileSystem', [type || ''], null);
|
|
842
|
-
}
|
|
506
|
+
inspectElementCompleted() {
|
|
507
|
+
DevToolsAPI.sendMessageToEmbedder('inspectElementCompleted', [], null);
|
|
508
|
+
}
|
|
843
509
|
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
510
|
+
/**
|
|
511
|
+
* @param url
|
|
512
|
+
* @param headers
|
|
513
|
+
* @param streamId
|
|
514
|
+
* @param callback {(param: object) => unknown}
|
|
515
|
+
*/
|
|
516
|
+
loadNetworkResource(url, headers, streamId, callback) {
|
|
517
|
+
DevToolsAPI.sendMessageToEmbedder('loadNetworkResource', [url, headers, streamId], callback);
|
|
518
|
+
}
|
|
851
519
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
return DevToolsHost.isolatedFileSystem(fileSystemId, registeredName);
|
|
860
|
-
}
|
|
520
|
+
/**
|
|
521
|
+
* @param name
|
|
522
|
+
* @param options
|
|
523
|
+
*/
|
|
524
|
+
registerPreference(name, options) {
|
|
525
|
+
DevToolsAPI.sendMessageToEmbedder('registerPreference', [name, options], null);
|
|
526
|
+
}
|
|
861
527
|
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}
|
|
528
|
+
/**
|
|
529
|
+
* @param callback {(param: object) => unknown}
|
|
530
|
+
*/
|
|
531
|
+
getPreferences(callback) {
|
|
532
|
+
DevToolsAPI.sendMessageToEmbedder('getPreferences', [], callback);
|
|
533
|
+
}
|
|
869
534
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
// |excludedFolders| added in M67. For backward compatibility,
|
|
878
|
-
// pass empty array.
|
|
879
|
-
excludedFolders = excludedFolders || '[]';
|
|
880
|
-
DevToolsAPI.sendMessageToEmbedder('indexPath', [requestId, fileSystemPath, excludedFolders], null);
|
|
881
|
-
}
|
|
535
|
+
/**
|
|
536
|
+
* @param name
|
|
537
|
+
* @param callback {(param: object) => unknown}
|
|
538
|
+
*/
|
|
539
|
+
getPreference(name, callback) {
|
|
540
|
+
DevToolsAPI.sendMessageToEmbedder('getPreference', [name], callback);
|
|
541
|
+
}
|
|
882
542
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
543
|
+
/**
|
|
544
|
+
* @param name
|
|
545
|
+
* @param value
|
|
546
|
+
*/
|
|
547
|
+
setPreference(name, value) {
|
|
548
|
+
DevToolsAPI.sendMessageToEmbedder('setPreference', [name, value], null);
|
|
549
|
+
}
|
|
890
550
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
searchInPath(requestId, fileSystemPath, query) {
|
|
898
|
-
DevToolsAPI.sendMessageToEmbedder('searchInPath', [requestId, fileSystemPath, query], null);
|
|
899
|
-
}
|
|
551
|
+
/**
|
|
552
|
+
* @param name
|
|
553
|
+
*/
|
|
554
|
+
removePreference(name) {
|
|
555
|
+
DevToolsAPI.sendMessageToEmbedder('removePreference', [name], null);
|
|
556
|
+
}
|
|
900
557
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
*/
|
|
905
|
-
zoomFactor() {
|
|
906
|
-
return DevToolsHost.zoomFactor();
|
|
907
|
-
}
|
|
558
|
+
clearPreferences() {
|
|
559
|
+
DevToolsAPI.sendMessageToEmbedder('clearPreferences', [], null);
|
|
560
|
+
}
|
|
908
561
|
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
562
|
+
/**
|
|
563
|
+
* @param callback
|
|
564
|
+
*/
|
|
565
|
+
getSyncInformation(callback) {
|
|
566
|
+
DevToolsAPI.sendMessageToEmbedder('getSyncInformation', [], callback);
|
|
567
|
+
}
|
|
915
568
|
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
569
|
+
/**
|
|
570
|
+
* @param callback
|
|
571
|
+
*/
|
|
572
|
+
getHostConfig(callback) {
|
|
573
|
+
DevToolsAPI.sendMessageToEmbedder('getHostConfig', [], hostConfig => {
|
|
574
|
+
const majorVersion = getRemoteMajorVersion();
|
|
575
|
+
if (majorVersion && majorVersion < 129 && hostConfig?.aidaAvailability) {
|
|
576
|
+
return callback(this.hostConfigNewToOld(hostConfig));
|
|
577
|
+
}
|
|
578
|
+
return callback(hostConfig);
|
|
579
|
+
});
|
|
580
|
+
}
|
|
922
581
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
582
|
+
/**
|
|
583
|
+
* @param newConfig
|
|
584
|
+
*/
|
|
585
|
+
hostConfigNewToOld(newConfig) {
|
|
586
|
+
const devToolsConsoleInsights = {
|
|
587
|
+
enabled: (newConfig.devToolsConsoleInsights?.enabled && newConfig.aidaAvailability?.enabled) ?? false,
|
|
588
|
+
aidaModelId: newConfig.devToolsConsoleInsights?.modelId ?? '',
|
|
589
|
+
aidaTemperature: newConfig.devToolsConsoleInsights?.temperature ?? 0,
|
|
590
|
+
blockedByAge: newConfig.aidaAvailability?.blockedByAge ?? true,
|
|
591
|
+
blockedByEnterprisePolicy: newConfig.aidaAvailability?.blockedByEnterprisePolicy ?? true,
|
|
592
|
+
blockedByFeatureFlag:
|
|
593
|
+
(newConfig.devToolsConsoleInsights?.enabled && newConfig.aidaAvailability?.enabled) ?? false,
|
|
594
|
+
blockedByGeo: newConfig.aidaAvailability?.blockedByGeo ?? true,
|
|
595
|
+
blockedByRollout: false,
|
|
596
|
+
disallowLogging: newConfig.aidaAvailability?.disallowLogging ?? true,
|
|
597
|
+
optIn: false
|
|
598
|
+
};
|
|
599
|
+
const devToolsFreestylerDogfood = {
|
|
600
|
+
enabled: (newConfig.devToolsFreestyler?.enabled && newConfig.aidaAvailability?.enabled) ?? false,
|
|
601
|
+
aidaModelId: newConfig.devToolsFreestyler?.modelId ?? '',
|
|
602
|
+
aidaTemperature: newConfig.devToolsFreestyler?.temperature ?? 0,
|
|
603
|
+
blockedByAge: newConfig.aidaAvailability?.blockedByAge ?? true,
|
|
604
|
+
blockedByEnterprisePolicy: newConfig.aidaAvailability?.blockedByEnterprisePolicy ?? true,
|
|
605
|
+
blockedByGeo: newConfig.aidaAvailability?.blockedByGeo ?? true
|
|
606
|
+
};
|
|
607
|
+
return {
|
|
608
|
+
devToolsConsoleInsights,
|
|
609
|
+
devToolsFreestylerDogfood,
|
|
610
|
+
devToolsVeLogging: newConfig.devToolsVeLogging,
|
|
611
|
+
isOffTheRecord: newConfig.isOffTheRecord
|
|
612
|
+
};
|
|
613
|
+
}
|
|
929
614
|
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
615
|
+
/**
|
|
616
|
+
* @param origin
|
|
617
|
+
* @param script
|
|
618
|
+
*/
|
|
619
|
+
setInjectedScriptForOrigin(origin, script) {
|
|
620
|
+
DevToolsAPI.sendMessageToEmbedder('registerExtensionsAPI', [origin, script], null);
|
|
621
|
+
}
|
|
937
622
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
623
|
+
/**
|
|
624
|
+
* @param url
|
|
625
|
+
*/
|
|
626
|
+
inspectedURLChanged(url) {
|
|
627
|
+
DevToolsAPI.sendMessageToEmbedder('inspectedURLChanged', [url], null);
|
|
628
|
+
}
|
|
945
629
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
}
|
|
630
|
+
/**
|
|
631
|
+
* @param text
|
|
632
|
+
*/
|
|
633
|
+
copyText(text) {
|
|
634
|
+
DevToolsHost.copyText(text);
|
|
635
|
+
}
|
|
953
636
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
DevToolsAPI.sendMessageToEmbedder('reattach', [], callback);
|
|
961
|
-
}
|
|
637
|
+
/**
|
|
638
|
+
* @param url
|
|
639
|
+
*/
|
|
640
|
+
openInNewTab(url) {
|
|
641
|
+
DevToolsAPI.sendMessageToEmbedder('openInNewTab', [url], null);
|
|
642
|
+
}
|
|
962
643
|
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
644
|
+
/**
|
|
645
|
+
* @param query
|
|
646
|
+
*/
|
|
647
|
+
openSearchResultsInNewTab(query) {
|
|
648
|
+
DevToolsAPI.sendMessageToEmbedder('openSearchResultsInNewTab', [query], null);
|
|
649
|
+
}
|
|
969
650
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
651
|
+
/**
|
|
652
|
+
* @param fileSystemPath
|
|
653
|
+
*/
|
|
654
|
+
showItemInFolder(fileSystemPath) {
|
|
655
|
+
DevToolsAPI.sendMessageToEmbedder('showItemInFolder', [fileSystemPath], null);
|
|
656
|
+
}
|
|
976
657
|
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
658
|
+
/**
|
|
659
|
+
* @param url
|
|
660
|
+
* @param content
|
|
661
|
+
* @param forceSaveAs
|
|
662
|
+
* @param isBase64
|
|
663
|
+
*/
|
|
664
|
+
save(url, content, forceSaveAs, isBase64) {
|
|
665
|
+
DevToolsAPI.sendMessageToEmbedder('save', [url, content, forceSaveAs, isBase64], null);
|
|
666
|
+
}
|
|
984
667
|
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
[
|
|
993
|
-
config.discoverUsbDevices, config.portForwardingEnabled, JSON.stringify(config.portForwardingConfig),
|
|
994
|
-
config.networkDiscoveryEnabled, JSON.stringify(config.networkDiscoveryConfig)
|
|
995
|
-
],
|
|
996
|
-
null);
|
|
997
|
-
}
|
|
668
|
+
/**
|
|
669
|
+
* @param url
|
|
670
|
+
* @param content
|
|
671
|
+
*/
|
|
672
|
+
append(url, content) {
|
|
673
|
+
DevToolsAPI.sendMessageToEmbedder('append', [url, content], null);
|
|
674
|
+
}
|
|
998
675
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
DevToolsAPI.sendMessageToEmbedder('setDevicesUpdatesEnabled', [enabled], null);
|
|
1005
|
-
}
|
|
676
|
+
/**
|
|
677
|
+
* @param url
|
|
678
|
+
*/
|
|
679
|
+
close(url) {
|
|
680
|
+
}
|
|
1006
681
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
DevToolsAPI.sendMessageToEmbedder('openRemotePage', [browserId, url], null);
|
|
1014
|
-
}
|
|
682
|
+
/**
|
|
683
|
+
* @param message
|
|
684
|
+
*/
|
|
685
|
+
sendMessageToBackend(message) {
|
|
686
|
+
DevToolsAPI.sendMessageToEmbedder('dispatchProtocolMessage', [message], null);
|
|
687
|
+
}
|
|
1015
688
|
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
689
|
+
/**
|
|
690
|
+
* @param histogramName
|
|
691
|
+
* @param sample
|
|
692
|
+
* @param min
|
|
693
|
+
* @param exclusiveMax
|
|
694
|
+
* @param bucketSize
|
|
695
|
+
*/
|
|
696
|
+
recordCountHistogram(histogramName, sample, min, exclusiveMax, bucketSize) {
|
|
697
|
+
DevToolsAPI.sendMessageToEmbedder(
|
|
698
|
+
'recordCountHistogram', [histogramName, sample, min, exclusiveMax, bucketSize], null);
|
|
699
|
+
}
|
|
1022
700
|
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
701
|
+
/**
|
|
702
|
+
* @param actionName
|
|
703
|
+
* @param actionCode
|
|
704
|
+
* @param bucketSize
|
|
705
|
+
*/
|
|
706
|
+
recordEnumeratedHistogram(actionName, actionCode, bucketSize) {
|
|
707
|
+
if (!Object.values(EnumeratedHistogram).includes(actionName)) {
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
DevToolsAPI.sendMessageToEmbedder('recordEnumeratedHistogram', [actionName, actionCode, bucketSize], null);
|
|
711
|
+
}
|
|
1033
712
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
713
|
+
/**
|
|
714
|
+
* @param histogramName
|
|
715
|
+
* @param duration
|
|
716
|
+
*/
|
|
717
|
+
recordPerformanceHistogram(histogramName, duration) {
|
|
718
|
+
DevToolsAPI.sendMessageToEmbedder('recordPerformanceHistogram', [histogramName, duration], null);
|
|
719
|
+
}
|
|
1041
720
|
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
}
|
|
721
|
+
/**
|
|
722
|
+
* @param featureName
|
|
723
|
+
*/
|
|
724
|
+
recordNewBadgeUsage(featureName) {
|
|
725
|
+
DevToolsAPI.sendMessageToEmbedder('recordNewBadgeUsage', [featureName], null);
|
|
726
|
+
}
|
|
1049
727
|
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
}
|
|
728
|
+
/**
|
|
729
|
+
* @param umaName
|
|
730
|
+
*/
|
|
731
|
+
recordUserMetricsAction(umaName) {
|
|
732
|
+
DevToolsAPI.sendMessageToEmbedder('recordUserMetricsAction', [umaName], null);
|
|
733
|
+
}
|
|
1057
734
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
recordResize(resizeEvent) {
|
|
1063
|
-
DevToolsAPI.sendMessageToEmbedder('recordResize', [resizeEvent], null);
|
|
1064
|
-
}
|
|
735
|
+
connectAutomaticFileSystem(fileSystemPath, fileSystemUUID, addIfMissing, callback) {
|
|
736
|
+
DevToolsAPI.sendMessageToEmbedder(
|
|
737
|
+
'connectAutomaticFileSystem', [fileSystemPath, fileSystemUUID, addIfMissing], callback);
|
|
738
|
+
}
|
|
1065
739
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
*/
|
|
1070
|
-
recordClick(clickEvent) {
|
|
1071
|
-
DevToolsAPI.sendMessageToEmbedder('recordClick', [clickEvent], null);
|
|
1072
|
-
}
|
|
740
|
+
disconnectAutomaticFileSystem(fileSystemPath) {
|
|
741
|
+
DevToolsAPI.sendMessageToEmbedder('disconnectAutomaticFileSystem', [fileSystemPath], null);
|
|
742
|
+
}
|
|
1073
743
|
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
*/
|
|
1078
|
-
recordHover(hoverEvent) {
|
|
1079
|
-
DevToolsAPI.sendMessageToEmbedder('recordHover', [hoverEvent], null);
|
|
1080
|
-
}
|
|
744
|
+
requestFileSystems() {
|
|
745
|
+
DevToolsAPI.sendMessageToEmbedder('requestFileSystems', [], null);
|
|
746
|
+
}
|
|
1081
747
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
}
|
|
748
|
+
/**
|
|
749
|
+
* @param type
|
|
750
|
+
*/
|
|
751
|
+
addFileSystem(type) {
|
|
752
|
+
DevToolsAPI.sendMessageToEmbedder('addFileSystem', [type || ''], null);
|
|
753
|
+
}
|
|
1089
754
|
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
}
|
|
755
|
+
/**
|
|
756
|
+
* @param fileSystemPath
|
|
757
|
+
*/
|
|
758
|
+
removeFileSystem(fileSystemPath) {
|
|
759
|
+
DevToolsAPI.sendMessageToEmbedder('removeFileSystem', [fileSystemPath], null);
|
|
760
|
+
}
|
|
1097
761
|
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
762
|
+
/**
|
|
763
|
+
* @param fileSystemId
|
|
764
|
+
* @param registeredName
|
|
765
|
+
* @returns
|
|
766
|
+
*/
|
|
767
|
+
isolatedFileSystem(fileSystemId, registeredName) {
|
|
768
|
+
return DevToolsHost.isolatedFileSystem(fileSystemId, registeredName);
|
|
769
|
+
}
|
|
1105
770
|
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
}
|
|
771
|
+
/**
|
|
772
|
+
* @param fileSystem
|
|
773
|
+
*/
|
|
774
|
+
upgradeDraggedFileSystemPermissions(fileSystem) {
|
|
775
|
+
DevToolsHost.upgradeDraggedFileSystemPermissions(fileSystem);
|
|
776
|
+
}
|
|
1113
777
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
778
|
+
/**
|
|
779
|
+
* @param requestId
|
|
780
|
+
* @param fileSystemPath
|
|
781
|
+
* @param excludedFolders
|
|
782
|
+
*/
|
|
783
|
+
indexPath(requestId, fileSystemPath, excludedFolders) {
|
|
784
|
+
// |excludedFolders| added in M67. For backward compatibility,
|
|
785
|
+
// pass empty array.
|
|
786
|
+
excludedFolders = excludedFolders || '[]';
|
|
787
|
+
DevToolsAPI.sendMessageToEmbedder('indexPath', [requestId, fileSystemPath, excludedFolders], null);
|
|
788
|
+
}
|
|
1121
789
|
|
|
1122
|
-
|
|
790
|
+
/**
|
|
791
|
+
* @param requestId
|
|
792
|
+
*/
|
|
793
|
+
stopIndexing(requestId) {
|
|
794
|
+
DevToolsAPI.sendMessageToEmbedder('stopIndexing', [requestId], null);
|
|
795
|
+
}
|
|
1123
796
|
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
797
|
+
/**
|
|
798
|
+
* @param requestId
|
|
799
|
+
* @param fileSystemPath
|
|
800
|
+
* @param query
|
|
801
|
+
*/
|
|
802
|
+
searchInPath(requestId, fileSystemPath, query) {
|
|
803
|
+
DevToolsAPI.sendMessageToEmbedder('searchInPath', [requestId, fileSystemPath, query], null);
|
|
804
|
+
}
|
|
1131
805
|
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
806
|
+
/**
|
|
807
|
+
* @returns
|
|
808
|
+
*/
|
|
809
|
+
zoomFactor() {
|
|
810
|
+
return DevToolsHost.zoomFactor();
|
|
811
|
+
}
|
|
1138
812
|
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
*/
|
|
1143
|
-
port() {
|
|
1144
|
-
return 'unknown';
|
|
1145
|
-
}
|
|
813
|
+
zoomIn() {
|
|
814
|
+
DevToolsAPI.sendMessageToEmbedder('zoomIn', [], null);
|
|
815
|
+
}
|
|
1146
816
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
*/
|
|
1151
|
-
setZoomFactor(zoomFactor) {
|
|
1152
|
-
}
|
|
817
|
+
zoomOut() {
|
|
818
|
+
DevToolsAPI.sendMessageToEmbedder('zoomOut', [], null);
|
|
819
|
+
}
|
|
1153
820
|
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
sendMessageToEmbedder() {
|
|
1158
|
-
}
|
|
821
|
+
resetZoom() {
|
|
822
|
+
DevToolsAPI.sendMessageToEmbedder('resetZoom', [], null);
|
|
823
|
+
}
|
|
1159
824
|
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
}
|
|
825
|
+
/**
|
|
826
|
+
* @param shortcuts
|
|
827
|
+
*/
|
|
828
|
+
setWhitelistedShortcuts(shortcuts) {
|
|
829
|
+
DevToolsAPI.sendMessageToEmbedder('setWhitelistedShortcuts', [shortcuts], null);
|
|
830
|
+
}
|
|
1167
831
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
}
|
|
832
|
+
/**
|
|
833
|
+
* @param active
|
|
834
|
+
*/
|
|
835
|
+
setEyeDropperActive(active) {
|
|
836
|
+
DevToolsAPI.sendMessageToEmbedder('setEyeDropperActive', [active], null);
|
|
837
|
+
}
|
|
1175
838
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
}
|
|
839
|
+
/**
|
|
840
|
+
* @param certChain
|
|
841
|
+
*/
|
|
842
|
+
showCertificateViewer(certChain) {
|
|
843
|
+
DevToolsAPI.sendMessageToEmbedder('showCertificateViewer', [JSON.stringify(certChain)], null);
|
|
844
|
+
}
|
|
1183
845
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
846
|
+
/**
|
|
847
|
+
* Only needed to run Lighthouse on old devtools.
|
|
848
|
+
* @param callback
|
|
849
|
+
*/
|
|
850
|
+
reattach(callback) {
|
|
851
|
+
DevToolsAPI.sendMessageToEmbedder('reattach', [], callback);
|
|
852
|
+
}
|
|
1191
853
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
initialTargetId() {
|
|
1196
|
-
return DevToolsAPI._initialTargetIdPromise;
|
|
1197
|
-
}
|
|
854
|
+
readyForTest() {
|
|
855
|
+
DevToolsAPI.sendMessageToEmbedder('readyForTest', [], null);
|
|
856
|
+
}
|
|
1198
857
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
* @param cb
|
|
1203
|
-
*/
|
|
1204
|
-
doAidaConversation(request, streamId, cb) {
|
|
1205
|
-
DevToolsAPI.sendMessageToEmbedder('doAidaConversation', [request, streamId], cb);
|
|
1206
|
-
}
|
|
858
|
+
connectionReady() {
|
|
859
|
+
DevToolsAPI.sendMessageToEmbedder('connectionReady', [], null);
|
|
860
|
+
}
|
|
1207
861
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
}
|
|
862
|
+
/**
|
|
863
|
+
* @param value
|
|
864
|
+
*/
|
|
865
|
+
setOpenNewWindowForPopups(value) {
|
|
866
|
+
DevToolsAPI.sendMessageToEmbedder('setOpenNewWindowForPopups', [value], null);
|
|
867
|
+
}
|
|
1215
868
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
869
|
+
/**
|
|
870
|
+
* @param config
|
|
871
|
+
*/
|
|
872
|
+
setDevicesDiscoveryConfig(config) {
|
|
873
|
+
DevToolsAPI.sendMessageToEmbedder(
|
|
874
|
+
'setDevicesDiscoveryConfig',
|
|
875
|
+
[
|
|
876
|
+
config.discoverUsbDevices, config.portForwardingEnabled, JSON.stringify(config.portForwardingConfig),
|
|
877
|
+
config.networkDiscoveryEnabled, JSON.stringify(config.networkDiscoveryConfig)
|
|
878
|
+
],
|
|
879
|
+
null);
|
|
880
|
+
}
|
|
1223
881
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
}
|
|
1231
|
-
};
|
|
1232
|
-
|
|
1233
|
-
window.InspectorFrontendHost = new InspectorFrontendHostImpl();
|
|
1234
|
-
|
|
1235
|
-
// DevToolsApp ---------------------------------------------------------------
|
|
1236
|
-
|
|
1237
|
-
function installObjectObserve() {
|
|
1238
|
-
/** @type {!Array<string>} */
|
|
1239
|
-
const properties = [
|
|
1240
|
-
'advancedSearchConfig',
|
|
1241
|
-
'auditsPanelSplitViewState',
|
|
1242
|
-
'auditsSidebarWidth',
|
|
1243
|
-
'blockedURLs',
|
|
1244
|
-
'breakpoints',
|
|
1245
|
-
'cacheDisabled',
|
|
1246
|
-
'colorFormat',
|
|
1247
|
-
'consoleHistory',
|
|
1248
|
-
'consoleTimestampsEnabled',
|
|
1249
|
-
'cpuProfilerView',
|
|
1250
|
-
'cssSourceMapsEnabled',
|
|
1251
|
-
'currentDockState',
|
|
1252
|
-
'customColorPalette',
|
|
1253
|
-
'customDevicePresets',
|
|
1254
|
-
'customEmulatedDeviceList',
|
|
1255
|
-
'customFormatters',
|
|
1256
|
-
'customUserAgent',
|
|
1257
|
-
'databaseTableViewVisibleColumns',
|
|
1258
|
-
'dataGrid-cookiesTable',
|
|
1259
|
-
'dataGrid-DOMStorageItemsView',
|
|
1260
|
-
'debuggerSidebarHidden',
|
|
1261
|
-
'disablePausedStateOverlay',
|
|
1262
|
-
'domBreakpoints',
|
|
1263
|
-
'domWordWrap',
|
|
1264
|
-
'elementsPanelSplitViewState',
|
|
1265
|
-
'elementsSidebarWidth',
|
|
1266
|
-
'emulation.deviceHeight',
|
|
1267
|
-
'emulation.deviceModeValue',
|
|
1268
|
-
'emulation.deviceOrientationOverride',
|
|
1269
|
-
'emulation.deviceScale',
|
|
1270
|
-
'emulation.deviceScaleFactor',
|
|
1271
|
-
'emulation.deviceUA',
|
|
1272
|
-
'emulation.deviceWidth',
|
|
1273
|
-
'emulation.locationOverride',
|
|
1274
|
-
'emulation.showDeviceMode',
|
|
1275
|
-
'emulation.showRulers',
|
|
1276
|
-
'enableAsyncStackTraces',
|
|
1277
|
-
'enableIgnoreListing',
|
|
1278
|
-
'eventListenerBreakpoints',
|
|
1279
|
-
'fileMappingEntries',
|
|
1280
|
-
'fileSystemMapping',
|
|
1281
|
-
'FileSystemViewSidebarWidth',
|
|
1282
|
-
'fileSystemViewSplitViewState',
|
|
1283
|
-
'filterBar-consoleView',
|
|
1284
|
-
'filterBar-networkPanel',
|
|
1285
|
-
'filterBar-promisePane',
|
|
1286
|
-
'filterBar-timelinePanel',
|
|
1287
|
-
'frameViewerHideChromeWindow',
|
|
1288
|
-
'heapSnapshotRetainersViewSize',
|
|
1289
|
-
'heapSnapshotSplitViewState',
|
|
1290
|
-
'hideCollectedPromises',
|
|
1291
|
-
'hideNetworkMessages',
|
|
1292
|
-
'highlightNodeOnHoverInOverlay',
|
|
1293
|
-
'inlineVariableValues',
|
|
1294
|
-
'Inspector.drawerSplitView',
|
|
1295
|
-
'Inspector.drawerSplitViewState',
|
|
1296
|
-
'InspectorView.panelOrder',
|
|
1297
|
-
'InspectorView.screencastSplitView',
|
|
1298
|
-
'InspectorView.screencastSplitViewState',
|
|
1299
|
-
'InspectorView.splitView',
|
|
1300
|
-
'InspectorView.splitViewState',
|
|
1301
|
-
'javaScriptDisabled',
|
|
1302
|
-
'jsSourceMapsEnabled',
|
|
1303
|
-
'lastActivePanel',
|
|
1304
|
-
'lastDockState',
|
|
1305
|
-
'lastSelectedSourcesSidebarPaneTab',
|
|
1306
|
-
'lastSnippetEvaluationIndex',
|
|
1307
|
-
'layerDetailsSplitView',
|
|
1308
|
-
'layerDetailsSplitViewState',
|
|
1309
|
-
'layersPanelSplitViewState',
|
|
1310
|
-
'layersShowInternalLayers',
|
|
1311
|
-
'layersSidebarWidth',
|
|
1312
|
-
'messageLevelFilters',
|
|
1313
|
-
'messageURLFilters',
|
|
1314
|
-
'monitoringXHREnabled',
|
|
1315
|
-
'navigatorGroupByAuthored',
|
|
1316
|
-
'navigatorGroupByFolder',
|
|
1317
|
-
'navigatorHidden',
|
|
1318
|
-
'networkColorCodeResourceTypes',
|
|
1319
|
-
'networkConditions',
|
|
1320
|
-
'networkConditionsCustomProfiles',
|
|
1321
|
-
'networkHideDataURL',
|
|
1322
|
-
'networkLogColumnsVisibility',
|
|
1323
|
-
'networkLogLargeRows',
|
|
1324
|
-
'networkLogShowOverview',
|
|
1325
|
-
'networkPanelSplitViewState',
|
|
1326
|
-
'networkRecordFilmStripSetting',
|
|
1327
|
-
'networkResourceTypeFilters',
|
|
1328
|
-
'networkShowPrimaryLoadWaterfall',
|
|
1329
|
-
'networkSidebarWidth',
|
|
1330
|
-
'openLinkHandler',
|
|
1331
|
-
'pauseOnUncaughtException',
|
|
1332
|
-
'pauseOnCaughtException',
|
|
1333
|
-
'pauseOnExceptionEnabled',
|
|
1334
|
-
'preserveConsoleLog',
|
|
1335
|
-
'prettyPrintInfobarDisabled',
|
|
1336
|
-
'previouslyViewedFiles',
|
|
1337
|
-
'profilesPanelSplitViewState',
|
|
1338
|
-
'profilesSidebarWidth',
|
|
1339
|
-
'promiseStatusFilters',
|
|
1340
|
-
'recordAllocationStacks',
|
|
1341
|
-
'requestHeaderFilterSetting',
|
|
1342
|
-
'request-info-formData-category-expanded',
|
|
1343
|
-
'request-info-general-category-expanded',
|
|
1344
|
-
'request-info-queryString-category-expanded',
|
|
1345
|
-
'request-info-requestHeaders-category-expanded',
|
|
1346
|
-
'request-info-requestPayload-category-expanded',
|
|
1347
|
-
'request-info-responseHeaders-category-expanded',
|
|
1348
|
-
'resources',
|
|
1349
|
-
'resourcesLastSelectedItem',
|
|
1350
|
-
'resourcesPanelSplitViewState',
|
|
1351
|
-
'resourcesSidebarWidth',
|
|
1352
|
-
'resourceViewTab',
|
|
1353
|
-
'savedURLs',
|
|
1354
|
-
'screencastEnabled',
|
|
1355
|
-
'scriptsPanelNavigatorSidebarWidth',
|
|
1356
|
-
'searchInContentScripts',
|
|
1357
|
-
'selectedAuditCategories',
|
|
1358
|
-
'selectedColorPalette',
|
|
1359
|
-
'selectedProfileType',
|
|
1360
|
-
'shortcutPanelSwitch',
|
|
1361
|
-
'showAdvancedHeapSnapshotProperties',
|
|
1362
|
-
'showEventListenersForAncestors',
|
|
1363
|
-
'showFrameowkrListeners',
|
|
1364
|
-
'showHeaSnapshotObjectsHiddenProperties',
|
|
1365
|
-
'showInheritedComputedStyleProperties',
|
|
1366
|
-
'showMediaQueryInspector',
|
|
1367
|
-
'showUAShadowDOM',
|
|
1368
|
-
'showWhitespacesInEditor',
|
|
1369
|
-
'sidebarPosition',
|
|
1370
|
-
'skipContentScripts',
|
|
1371
|
-
'automaticallyIgnoreListKnownThirdPartyScripts',
|
|
1372
|
-
'skipStackFramesPattern',
|
|
1373
|
-
'sourceMapInfobarDisabled',
|
|
1374
|
-
'sourceMapSkippedInfobarDisabled',
|
|
1375
|
-
'sourcesPanelDebuggerSidebarSplitViewState',
|
|
1376
|
-
'sourcesPanelNavigatorSplitViewState',
|
|
1377
|
-
'sourcesPanelSplitSidebarRatio',
|
|
1378
|
-
'sourcesPanelSplitViewState',
|
|
1379
|
-
'sourcesSidebarWidth',
|
|
1380
|
-
'standardEmulatedDeviceList',
|
|
1381
|
-
'StylesPaneSplitRatio',
|
|
1382
|
-
'stylesPaneSplitViewState',
|
|
1383
|
-
'textEditorAutocompletion',
|
|
1384
|
-
'textEditorAutoDetectIndent',
|
|
1385
|
-
'textEditorBracketMatching',
|
|
1386
|
-
'textEditorIndent',
|
|
1387
|
-
'textEditorTabMovesFocus',
|
|
1388
|
-
'timelineCaptureFilmStrip',
|
|
1389
|
-
'timelineCaptureLayersAndPictures',
|
|
1390
|
-
'timelineCaptureMemory',
|
|
1391
|
-
'timelineCaptureNetwork',
|
|
1392
|
-
'timeline-details',
|
|
1393
|
-
'timelineEnableJSSampling',
|
|
1394
|
-
'timelineOverviewMode',
|
|
1395
|
-
'timelinePanelDetailsSplitViewState',
|
|
1396
|
-
'timelinePanelRecorsSplitViewState',
|
|
1397
|
-
'timelinePanelTimelineStackSplitViewState',
|
|
1398
|
-
'timelinePerspective',
|
|
1399
|
-
'timeline-split',
|
|
1400
|
-
'timelineTreeGroupBy',
|
|
1401
|
-
'timeline-view',
|
|
1402
|
-
'timelineViewMode',
|
|
1403
|
-
'uiTheme',
|
|
1404
|
-
'watchExpressions',
|
|
1405
|
-
'WebInspector.Drawer.lastSelectedView',
|
|
1406
|
-
'WebInspector.Drawer.showOnLoad',
|
|
1407
|
-
'workspaceExcludedFolders',
|
|
1408
|
-
'workspaceFolderExcludePattern',
|
|
1409
|
-
'workspaceInfobarDisabled',
|
|
1410
|
-
'workspaceMappingInfobarDisabled',
|
|
1411
|
-
'xhrBreakpoints'
|
|
1412
|
-
];
|
|
882
|
+
/**
|
|
883
|
+
* @param enabled
|
|
884
|
+
*/
|
|
885
|
+
setDevicesUpdatesEnabled(enabled) {
|
|
886
|
+
DevToolsAPI.sendMessageToEmbedder('setDevicesUpdatesEnabled', [enabled], null);
|
|
887
|
+
}
|
|
1413
888
|
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
889
|
+
/**
|
|
890
|
+
* @param browserId
|
|
891
|
+
* @param url
|
|
892
|
+
*/
|
|
893
|
+
openRemotePage(browserId, url) {
|
|
894
|
+
DevToolsAPI.sendMessageToEmbedder('openRemotePage', [browserId, url], null);
|
|
895
|
+
}
|
|
1420
896
|
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
* @param observer
|
|
1424
|
-
*/
|
|
1425
|
-
function objectObserve(object, observer) {
|
|
1426
|
-
if (window['WebInspector']) {
|
|
1427
|
-
const settingPrototype = /** @type {!Object} */ (window['WebInspector']['Setting']['prototype']);
|
|
1428
|
-
if (typeof settingPrototype['remove'] === 'function') {
|
|
1429
|
-
settingPrototype['remove'] = settingRemove;
|
|
1430
|
-
}
|
|
897
|
+
openNodeFrontend() {
|
|
898
|
+
DevToolsAPI.sendMessageToEmbedder('openNodeFrontend', [], null);
|
|
1431
899
|
}
|
|
1432
|
-
/** @type {!Set<string>} */
|
|
1433
|
-
const changedProperties = new Set();
|
|
1434
|
-
let scheduled = false;
|
|
1435
900
|
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
901
|
+
/**
|
|
902
|
+
* @param x
|
|
903
|
+
* @param y
|
|
904
|
+
* @param items
|
|
905
|
+
* @param document
|
|
906
|
+
*/
|
|
907
|
+
showContextMenuAtPoint(x, y, items, document) {
|
|
908
|
+
DevToolsHost.showContextMenuAtPoint(x, y, items, document);
|
|
1442
909
|
}
|
|
1443
910
|
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
});
|
|
1450
|
-
changedProperties.clear();
|
|
1451
|
-
observer.call(null, changes);
|
|
911
|
+
/**
|
|
912
|
+
* @returns
|
|
913
|
+
*/
|
|
914
|
+
isHostedMode() {
|
|
915
|
+
return DevToolsHost.isHostedMode();
|
|
1452
916
|
}
|
|
1453
917
|
|
|
1454
|
-
/**
|
|
1455
|
-
|
|
918
|
+
/**
|
|
919
|
+
* @param callback
|
|
920
|
+
*/
|
|
921
|
+
setAddExtensionCallback(callback) {
|
|
922
|
+
DevToolsAPI.setAddExtensionCallback(callback);
|
|
923
|
+
}
|
|
1456
924
|
|
|
1457
925
|
/**
|
|
1458
|
-
* @param
|
|
926
|
+
* @param impressionEvent
|
|
1459
927
|
*/
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
delete object[property];
|
|
1464
|
-
}
|
|
928
|
+
recordImpression(impressionEvent) {
|
|
929
|
+
DevToolsAPI.sendMessageToEmbedder('recordImpression', [impressionEvent], null);
|
|
930
|
+
}
|
|
1465
931
|
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
return storage.get(property);
|
|
1472
|
-
},
|
|
1473
|
-
|
|
1474
|
-
/**
|
|
1475
|
-
* @param value
|
|
1476
|
-
*/
|
|
1477
|
-
set: function(value) {
|
|
1478
|
-
storage.set(property, value);
|
|
1479
|
-
changedProperties.add(property);
|
|
1480
|
-
scheduleObserver();
|
|
1481
|
-
}
|
|
1482
|
-
});
|
|
932
|
+
/**
|
|
933
|
+
* @param resizeEvent
|
|
934
|
+
*/
|
|
935
|
+
recordResize(resizeEvent) {
|
|
936
|
+
DevToolsAPI.sendMessageToEmbedder('recordResize', [resizeEvent], null);
|
|
1483
937
|
}
|
|
1484
938
|
|
|
1485
|
-
|
|
1486
|
-
|
|
939
|
+
/**
|
|
940
|
+
* @param clickEvent
|
|
941
|
+
*/
|
|
942
|
+
recordClick(clickEvent) {
|
|
943
|
+
DevToolsAPI.sendMessageToEmbedder('recordClick', [clickEvent], null);
|
|
1487
944
|
}
|
|
1488
|
-
}
|
|
1489
945
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
[0x11, 'Control'],
|
|
1497
|
-
[0x10, 'Shift'],
|
|
1498
|
-
[0x14, 'CapsLock'],
|
|
1499
|
-
[0x5b, 'Win'],
|
|
1500
|
-
[0x5c, 'Win'],
|
|
1501
|
-
[0x0c, 'Clear'],
|
|
1502
|
-
[0x28, 'Down'],
|
|
1503
|
-
[0x23, 'End'],
|
|
1504
|
-
[0x0a, 'Enter'],
|
|
1505
|
-
[0x0d, 'Enter'],
|
|
1506
|
-
[0x2b, 'Execute'],
|
|
1507
|
-
[0x70, 'F1'],
|
|
1508
|
-
[0x71, 'F2'],
|
|
1509
|
-
[0x72, 'F3'],
|
|
1510
|
-
[0x73, 'F4'],
|
|
1511
|
-
[0x74, 'F5'],
|
|
1512
|
-
[0x75, 'F6'],
|
|
1513
|
-
[0x76, 'F7'],
|
|
1514
|
-
[0x77, 'F8'],
|
|
1515
|
-
[0x78, 'F9'],
|
|
1516
|
-
[0x79, 'F10'],
|
|
1517
|
-
[0x7a, 'F11'],
|
|
1518
|
-
[0x7b, 'F12'],
|
|
1519
|
-
[0x7c, 'F13'],
|
|
1520
|
-
[0x7d, 'F14'],
|
|
1521
|
-
[0x7e, 'F15'],
|
|
1522
|
-
[0x7f, 'F16'],
|
|
1523
|
-
[0x80, 'F17'],
|
|
1524
|
-
[0x81, 'F18'],
|
|
1525
|
-
[0x82, 'F19'],
|
|
1526
|
-
[0x83, 'F20'],
|
|
1527
|
-
[0x84, 'F21'],
|
|
1528
|
-
[0x85, 'F22'],
|
|
1529
|
-
[0x86, 'F23'],
|
|
1530
|
-
[0x87, 'F24'],
|
|
1531
|
-
[0x2f, 'Help'],
|
|
1532
|
-
[0x24, 'Home'],
|
|
1533
|
-
[0x2d, 'Insert'],
|
|
1534
|
-
[0x25, 'Left'],
|
|
1535
|
-
[0x22, 'PageDown'],
|
|
1536
|
-
[0x21, 'PageUp'],
|
|
1537
|
-
[0x13, 'Pause'],
|
|
1538
|
-
[0x2c, 'PrintScreen'],
|
|
1539
|
-
[0x27, 'Right'],
|
|
1540
|
-
[0x91, 'Scroll'],
|
|
1541
|
-
[0x29, 'Select'],
|
|
1542
|
-
[0x26, 'Up'],
|
|
1543
|
-
[0x2e, 'U+007F'], // Standard says that DEL becomes U+007F.
|
|
1544
|
-
[0xb0, 'MediaNextTrack'],
|
|
1545
|
-
[0xb1, 'MediaPreviousTrack'],
|
|
1546
|
-
[0xb2, 'MediaStop'],
|
|
1547
|
-
[0xb3, 'MediaPlayPause'],
|
|
1548
|
-
[0xad, 'VolumeMute'],
|
|
1549
|
-
[0xae, 'VolumeDown'],
|
|
1550
|
-
[0xaf, 'VolumeUp'],
|
|
1551
|
-
]);
|
|
1552
|
-
|
|
1553
|
-
/**
|
|
1554
|
-
* @param keyCode
|
|
1555
|
-
* @returns
|
|
1556
|
-
*/
|
|
1557
|
-
function keyCodeToKeyIdentifier(keyCode) {
|
|
1558
|
-
let result = staticKeyIdentifiers.get(keyCode);
|
|
1559
|
-
if (result !== undefined) {
|
|
1560
|
-
return result;
|
|
1561
|
-
}
|
|
1562
|
-
result = 'U+';
|
|
1563
|
-
const hexString = keyCode.toString(16).toUpperCase();
|
|
1564
|
-
for (let i = hexString.length; i < 4; ++i) {
|
|
1565
|
-
result += '0';
|
|
1566
|
-
}
|
|
1567
|
-
result += hexString;
|
|
1568
|
-
return result;
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
function installBackwardsCompatibility() {
|
|
1572
|
-
const majorVersion = getRemoteMajorVersion();
|
|
1573
|
-
if (!majorVersion) {
|
|
1574
|
-
return;
|
|
1575
|
-
}
|
|
946
|
+
/**
|
|
947
|
+
* @param hoverEvent
|
|
948
|
+
*/
|
|
949
|
+
recordHover(hoverEvent) {
|
|
950
|
+
DevToolsAPI.sendMessageToEmbedder('recordHover', [hoverEvent], null);
|
|
951
|
+
}
|
|
1576
952
|
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
return this.attachShadow({mode: 'open'});
|
|
1584
|
-
} catch {
|
|
1585
|
-
// some elements we use to add shadow roots can no
|
|
1586
|
-
// longer have shadow roots.
|
|
1587
|
-
const fakeShadowHost = document.createElement('span');
|
|
1588
|
-
this.appendChild(fakeShadowHost);
|
|
1589
|
-
fakeShadowHost.className = 'fake-shadow-host';
|
|
1590
|
-
return fakeShadowHost.createShadowRoot();
|
|
1591
|
-
}
|
|
1592
|
-
};
|
|
953
|
+
/**
|
|
954
|
+
* @param dragEvent
|
|
955
|
+
*/
|
|
956
|
+
recordDrag(dragEvent) {
|
|
957
|
+
DevToolsAPI.sendMessageToEmbedder('recordDrag', [dragEvent], null);
|
|
958
|
+
}
|
|
1593
959
|
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
};
|
|
960
|
+
/**
|
|
961
|
+
* @param changeEvent
|
|
962
|
+
*/
|
|
963
|
+
recordChange(changeEvent) {
|
|
964
|
+
DevToolsAPI.sendMessageToEmbedder('recordChange', [changeEvent], null);
|
|
965
|
+
}
|
|
1601
966
|
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
element.classList._myElement = element;
|
|
1609
|
-
return element;
|
|
1610
|
-
};
|
|
1611
|
-
|
|
1612
|
-
Object.defineProperty(HTMLSlotElement.prototype, 'select', {
|
|
1613
|
-
set(selector) {
|
|
1614
|
-
this.name = selector;
|
|
1615
|
-
}
|
|
1616
|
-
});
|
|
1617
|
-
}
|
|
967
|
+
/**
|
|
968
|
+
* @param keyDownEvent
|
|
969
|
+
*/
|
|
970
|
+
recordKeyDown(keyDownEvent) {
|
|
971
|
+
DevToolsAPI.sendMessageToEmbedder('recordKeyDown', [keyDownEvent], null);
|
|
972
|
+
}
|
|
1618
973
|
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
const callback = function() {
|
|
1626
|
-
const element = document.createElement(localName || typeExtension);
|
|
1627
|
-
const skip = new Set(['constructor', '__proto__']);
|
|
1628
|
-
for (const key of Object.keys(Object.getOwnPropertyDescriptors(prototype.__proto__ || {}))) {
|
|
1629
|
-
if (skip.has(key)) {
|
|
1630
|
-
continue;
|
|
1631
|
-
}
|
|
1632
|
-
element[key] = prototype[key];
|
|
1633
|
-
}
|
|
1634
|
-
element.setAttribute('is', typeExtension);
|
|
1635
|
-
if (element['createdCallback']) {
|
|
1636
|
-
element['createdCallback']();
|
|
1637
|
-
}
|
|
1638
|
-
return element;
|
|
1639
|
-
};
|
|
1640
|
-
fakeRegistry.set(typeExtension, callback);
|
|
1641
|
-
return callback;
|
|
1642
|
-
};
|
|
1643
|
-
|
|
1644
|
-
const origCreateElement = Document.prototype.createElement;
|
|
1645
|
-
Document.prototype.createElement = function(tagName, fakeCustomElementType) {
|
|
1646
|
-
const fakeConstructor = fakeRegistry.get(fakeCustomElementType);
|
|
1647
|
-
if (fakeConstructor) {
|
|
1648
|
-
return fakeConstructor();
|
|
1649
|
-
}
|
|
1650
|
-
return origCreateElement.call(this, tagName, fakeCustomElementType);
|
|
1651
|
-
};
|
|
1652
|
-
|
|
1653
|
-
// DevTools front-ends mistakenly assume that
|
|
1654
|
-
// classList.toggle('a', undefined) works as
|
|
1655
|
-
// classList.toggle('a', false) rather than as
|
|
1656
|
-
// classList.toggle('a');
|
|
1657
|
-
const originalDOMTokenListToggle = DOMTokenList.prototype.toggle;
|
|
1658
|
-
DOMTokenList.prototype.toggle = function(token, force) {
|
|
1659
|
-
if (arguments.length === 1) {
|
|
1660
|
-
force = !this.contains(token);
|
|
1661
|
-
}
|
|
1662
|
-
return originalDOMTokenListToggle.call(this, token, Boolean(force));
|
|
1663
|
-
};
|
|
1664
|
-
}
|
|
974
|
+
/**
|
|
975
|
+
* @param settingAccessEvent
|
|
976
|
+
*/
|
|
977
|
+
recordSettingAccess(settingAccessEvent) {
|
|
978
|
+
DevToolsAPI.sendMessageToEmbedder('recordSettingAccess', [settingAccessEvent], null);
|
|
979
|
+
}
|
|
1665
980
|
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
ShadowRoot.prototype.__originalShadowRootElementFromPoint = ShadowRoot.prototype.elementFromPoint;
|
|
1672
|
-
/**
|
|
1673
|
-
* @param x
|
|
1674
|
-
* @param y
|
|
1675
|
-
* @returns
|
|
1676
|
-
*/
|
|
1677
|
-
ShadowRoot.prototype.elementFromPoint = function(x, y) {
|
|
1678
|
-
const originalResult = ShadowRoot.prototype.__originalShadowRootElementFromPoint.apply(this, arguments);
|
|
1679
|
-
if (this.host && originalResult === this.host) {
|
|
1680
|
-
return null;
|
|
1681
|
-
}
|
|
1682
|
-
return originalResult;
|
|
1683
|
-
};
|
|
981
|
+
/**
|
|
982
|
+
* @param functionCallEvent
|
|
983
|
+
*/
|
|
984
|
+
recordFunctionCall(functionCallEvent) {
|
|
985
|
+
DevToolsAPI.sendMessageToEmbedder('recordFunctionCall', [functionCallEvent], null);
|
|
1684
986
|
}
|
|
1685
|
-
}
|
|
1686
987
|
|
|
1687
|
-
|
|
1688
|
-
Object.defineProperty(window.KeyboardEvent.prototype, 'keyIdentifier', {
|
|
1689
|
-
/**
|
|
1690
|
-
* @returns
|
|
1691
|
-
* @this {KeyboardEvent}
|
|
1692
|
-
*/
|
|
1693
|
-
get: function() {
|
|
1694
|
-
return keyCodeToKeyIdentifier(this.keyCode);
|
|
1695
|
-
}
|
|
1696
|
-
});
|
|
1697
|
-
}
|
|
988
|
+
// Backward-compatible methods below this line --------------------------------------------
|
|
1698
989
|
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
990
|
+
/**
|
|
991
|
+
* @returns
|
|
992
|
+
*/
|
|
993
|
+
initialTargetId() {
|
|
994
|
+
return DevToolsAPI._initialTargetIdPromiseWithResolver.promise;
|
|
995
|
+
}
|
|
1702
996
|
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
997
|
+
/**
|
|
998
|
+
* @param request
|
|
999
|
+
* @param streamId
|
|
1000
|
+
* @param cb
|
|
1001
|
+
*/
|
|
1002
|
+
doAidaConversation(request, streamId, cb) {
|
|
1003
|
+
DevToolsAPI.sendMessageToEmbedder('doAidaConversation', [request, streamId], cb);
|
|
1004
|
+
}
|
|
1707
1005
|
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1006
|
+
/**
|
|
1007
|
+
* @param request
|
|
1008
|
+
* @param cb
|
|
1009
|
+
*/
|
|
1010
|
+
aidaCodeComplete(request, cb) {
|
|
1011
|
+
DevToolsAPI.sendMessageToEmbedder('aidaCodeComplete', [request], cb);
|
|
1012
|
+
}
|
|
1711
1013
|
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1014
|
+
/**
|
|
1015
|
+
* @param request
|
|
1016
|
+
* @param cb
|
|
1017
|
+
*/
|
|
1018
|
+
registerAidaClientEvent(request, cb) {
|
|
1019
|
+
DevToolsAPI.sendMessageToEmbedder('registerAidaClientEvent', [request], cb);
|
|
1020
|
+
}
|
|
1720
1021
|
|
|
1721
|
-
|
|
1722
|
-
|
|
1022
|
+
/**
|
|
1023
|
+
* @param request
|
|
1024
|
+
* @param cb
|
|
1025
|
+
*/
|
|
1026
|
+
dispatchHttpRequest(request, cb) {
|
|
1027
|
+
DevToolsAPI.sendMessageToEmbedder('dispatchHttpRequest', [request], cb);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1723
1030
|
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1031
|
+
window.InspectorFrontendHost = new InspectorFrontendHostImpl();
|
|
1032
|
+
|
|
1033
|
+
// DevToolsApp ---------------------------------------------------------------
|
|
1034
|
+
|
|
1035
|
+
const staticKeyIdentifiers = new Map([
|
|
1036
|
+
[0x12, 'Alt'],
|
|
1037
|
+
[0x11, 'Control'],
|
|
1038
|
+
[0x10, 'Shift'],
|
|
1039
|
+
[0x14, 'CapsLock'],
|
|
1040
|
+
[0x5b, 'Win'],
|
|
1041
|
+
[0x5c, 'Win'],
|
|
1042
|
+
[0x0c, 'Clear'],
|
|
1043
|
+
[0x28, 'Down'],
|
|
1044
|
+
[0x23, 'End'],
|
|
1045
|
+
[0x0a, 'Enter'],
|
|
1046
|
+
[0x0d, 'Enter'],
|
|
1047
|
+
[0x2b, 'Execute'],
|
|
1048
|
+
[0x70, 'F1'],
|
|
1049
|
+
[0x71, 'F2'],
|
|
1050
|
+
[0x72, 'F3'],
|
|
1051
|
+
[0x73, 'F4'],
|
|
1052
|
+
[0x74, 'F5'],
|
|
1053
|
+
[0x75, 'F6'],
|
|
1054
|
+
[0x76, 'F7'],
|
|
1055
|
+
[0x77, 'F8'],
|
|
1056
|
+
[0x78, 'F9'],
|
|
1057
|
+
[0x79, 'F10'],
|
|
1058
|
+
[0x7a, 'F11'],
|
|
1059
|
+
[0x7b, 'F12'],
|
|
1060
|
+
[0x7c, 'F13'],
|
|
1061
|
+
[0x7d, 'F14'],
|
|
1062
|
+
[0x7e, 'F15'],
|
|
1063
|
+
[0x7f, 'F16'],
|
|
1064
|
+
[0x80, 'F17'],
|
|
1065
|
+
[0x81, 'F18'],
|
|
1066
|
+
[0x82, 'F19'],
|
|
1067
|
+
[0x83, 'F20'],
|
|
1068
|
+
[0x84, 'F21'],
|
|
1069
|
+
[0x85, 'F22'],
|
|
1070
|
+
[0x86, 'F23'],
|
|
1071
|
+
[0x87, 'F24'],
|
|
1072
|
+
[0x2f, 'Help'],
|
|
1073
|
+
[0x24, 'Home'],
|
|
1074
|
+
[0x2d, 'Insert'],
|
|
1075
|
+
[0x25, 'Left'],
|
|
1076
|
+
[0x22, 'PageDown'],
|
|
1077
|
+
[0x21, 'PageUp'],
|
|
1078
|
+
[0x13, 'Pause'],
|
|
1079
|
+
[0x2c, 'PrintScreen'],
|
|
1080
|
+
[0x27, 'Right'],
|
|
1081
|
+
[0x91, 'Scroll'],
|
|
1082
|
+
[0x29, 'Select'],
|
|
1083
|
+
[0x26, 'Up'],
|
|
1084
|
+
[0x2e, 'U+007F'], // Standard says that DEL becomes U+007F.
|
|
1085
|
+
[0xb0, 'MediaNextTrack'],
|
|
1086
|
+
[0xb1, 'MediaPreviousTrack'],
|
|
1087
|
+
[0xb2, 'MediaStop'],
|
|
1088
|
+
[0xb3, 'MediaPlayPause'],
|
|
1089
|
+
[0xad, 'VolumeMute'],
|
|
1090
|
+
[0xae, 'VolumeDown'],
|
|
1091
|
+
[0xaf, 'VolumeUp']
|
|
1092
|
+
]);
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* @param keyCode {number}
|
|
1096
|
+
* @returns
|
|
1097
|
+
*/
|
|
1098
|
+
function keyCodeToKeyIdentifier(keyCode) {
|
|
1099
|
+
let result = staticKeyIdentifiers.get(keyCode);
|
|
1100
|
+
if (result !== undefined) {
|
|
1101
|
+
return result;
|
|
1102
|
+
}
|
|
1103
|
+
result = 'U+';
|
|
1104
|
+
const hexString = keyCode.toString(16).toUpperCase();
|
|
1105
|
+
for (let i = hexString.length; i < 4; ++i) {
|
|
1106
|
+
result += '0';
|
|
1732
1107
|
}
|
|
1733
|
-
|
|
1734
|
-
return
|
|
1735
|
-
} catch {
|
|
1736
|
-
return null;
|
|
1108
|
+
result += hexString;
|
|
1109
|
+
return result;
|
|
1737
1110
|
}
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
function installExtraStyleRules(styleRules) {
|
|
1744
|
-
if (!styleRules.length) {
|
|
1745
|
-
return;
|
|
1111
|
+
|
|
1112
|
+
function installBackwardsCompatibility() {
|
|
1113
|
+
// Any polyfill that we need for backwards compatibility should be
|
|
1114
|
+
// Added in this function
|
|
1115
|
+
// Use getRemoteMajorVersion to get the correct Major Chrome version
|
|
1746
1116
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
const origCreateShadowRoot = HTMLElement.prototype.createShadowRoot;
|
|
1751
|
-
HTMLElement.prototype.createShadowRoot = function(...args) {
|
|
1752
|
-
const shadowRoot = origCreateShadowRoot.call(this, ...args);
|
|
1753
|
-
shadowRoot.appendChild(createStyleElement(styleText));
|
|
1754
|
-
return shadowRoot;
|
|
1755
|
-
};
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
/**
|
|
1759
|
-
* @param styleText
|
|
1760
|
-
* @returns
|
|
1761
|
-
*/
|
|
1762
|
-
function createStyleElement(styleText) {
|
|
1763
|
-
const style = document.createElement('style');
|
|
1764
|
-
style.textContent = styleText;
|
|
1765
|
-
return style;
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
installBackwardsCompatibility();
|
|
1117
|
+
|
|
1118
|
+
installBackwardsCompatibility();
|
|
1769
1119
|
})(window);
|