chrome-devtools-frontend 1.0.1652307 → 1.0.1656291
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/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
- package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
- package/AUTHORS +1 -0
- package/config/owner/COMMON_OWNERS +0 -4
- package/docs/get_the_code.md +1 -2
- package/docs/playbook.md +1 -1
- package/docs/ui_engineering.md +3 -1
- package/eslint.config.mjs +0 -5
- package/front_end/Tests.js +1 -0
- package/front_end/core/common/Settings.ts +47 -30
- package/front_end/core/sdk/CPUThrottlingManager.ts +23 -167
- package/front_end/core/sdk/CSSMetadata.ts +23 -0
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
- package/front_end/core/sdk/ConsoleModel.ts +13 -11
- package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/EmulationModel.ts +4 -0
- package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
- package/front_end/core/sdk/IsolateManager.ts +6 -6
- package/front_end/core/sdk/ResourceTreeModel.ts +8 -5
- package/front_end/core/sdk/TargetManager.ts +17 -0
- package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
- package/front_end/entrypoints/main/MainImpl.ts +12 -42
- package/front_end/foundation/Universe.ts +116 -3
- package/front_end/generated/InspectorBackendCommands.ts +11 -6
- package/front_end/generated/SupportedCSSProperties.js +124 -34
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +15 -0
- package/front_end/generated/protocol.ts +94 -1
- package/front_end/models/ai_assistance/AiConversation.ts +2 -7
- package/front_end/models/ai_assistance/README.md +4 -3
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +13 -320
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
- package/front_end/models/ai_assistance/ai_assistance.ts +6 -8
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
- package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
- package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
- package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
- package/front_end/models/ai_assistance/tools/README.md +21 -1
- package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
- package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
- package/front_end/models/autofill_manager/AutofillManager.ts +6 -15
- package/front_end/models/bindings/NetworkProject.ts +4 -8
- package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
- package/front_end/models/emulation/DeviceModeModel.ts +24 -0
- package/front_end/models/emulation/EmulatedDevices.ts +108 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
- package/front_end/models/issues_manager/IssuesManager.ts +10 -6
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
- package/front_end/models/logs/LogManager.ts +25 -10
- package/front_end/models/logs/NetworkLog.ts +24 -19
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +26 -14
- package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -11
- package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
- package/front_end/models/persistence/PersistenceImpl.ts +4 -5
- package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
- package/front_end/models/trace/EntityMapper.ts +1 -1
- package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +12 -38
- package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
- package/front_end/panels/application/FrameDetailsView.ts +2 -1
- package/front_end/panels/application/IndexedDBViews.ts +38 -36
- package/front_end/panels/application/ServiceWorkersView.ts +23 -16
- package/front_end/panels/application/components/AdsView.ts +4 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/autofill/autofill-meta.ts +3 -2
- package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
- package/front_end/panels/common/ThrottlingUtils.ts +9 -4
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
- package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
- package/front_end/panels/elements/ElementsPanel.ts +0 -74
- package/front_end/panels/elements/ElementsTreeOutline.ts +5 -4
- package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +79 -30
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
- package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
- package/front_end/panels/network/NetworkLogView.ts +28 -9
- package/front_end/panels/network/NetworkPanel.ts +1 -63
- package/front_end/panels/network/RequestInitiatorView.ts +29 -4
- package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
- package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
- package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
- package/front_end/panels/network/components/RequestHeadersView.css +1 -1
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
- package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
- package/front_end/panels/security/SecurityPanel.ts +36 -23
- package/front_end/panels/settings/SettingsScreen.ts +18 -103
- package/front_end/panels/settings/settings-meta.ts +0 -24
- package/front_end/panels/timeline/TimelineController.ts +3 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
- package/front_end/panels/timeline/TimelinePanel.ts +52 -11
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +20 -18
- package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
- package/front_end/panels/timeline/components/MetricCard.ts +18 -18
- package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
- package/front_end/panels/timeline/components/metricCard.css +4 -4
- package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
- package/front_end/panels/utils/utils.ts +25 -24
- package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
- package/front_end/panels/whats_new/resources/WNDT.md +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +3 -0
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
- package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
- package/front_end/ui/legacy/ListWidget.ts +12 -0
- package/front_end/ui/legacy/SplitWidget.ts +12 -11
- package/front_end/ui/legacy/TabbedPane.ts +1 -108
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +192 -139
- package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
- package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
- package/front_end/ui/legacy/treeoutline.css +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +4 -3
- package/front_end/Images/navigationControls.png +0 -0
- package/front_end/Images/navigationControls_2x.png +0 -0
- package/front_end/Images/popoverArrows.png +0 -0
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
- package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
- package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
- package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
- package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
- package/front_end/models/annotations/AnnotationRepository.ts +0 -238
- package/front_end/models/annotations/AnnotationType.ts +0 -10
- package/front_end/models/annotations/README.md +0 -7
- package/front_end/models/annotations/annotations.ts +0 -6
- package/front_end/models/greendev/Prototypes.ts +0 -68
- package/front_end/models/greendev/README.md +0 -5
- package/front_end/models/greendev/greendev.ts +0 -5
- package/front_end/panels/common/Annotation.ts +0 -184
- package/front_end/panels/common/AnnotationManager.ts +0 -208
- package/front_end/panels/common/annotation.css +0 -40
- package/front_end/panels/greendev/GreenDevPanel.css +0 -282
- package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
- package/front_end/panels/greendev/GreenDevShared.ts +0 -13
- package/front_end/panels/greendev/greendev-meta.ts +0 -52
- package/front_end/panels/greendev/greendev.ts +0 -9
|
@@ -17,75 +17,6 @@ import type {CdpFrame} from './Frame.js';
|
|
|
17
17
|
import type {FrameManager} from './FrameManager.js';
|
|
18
18
|
import {MAIN_WORLD} from './IsolatedWorlds.js';
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Tool annotations
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export interface WebMCPAnnotation {
|
|
26
|
-
/**
|
|
27
|
-
* A hint indicating that the tool does not modify any state.
|
|
28
|
-
*/
|
|
29
|
-
readOnly?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* A hint indicating that the tool output may contain untrusted content, ex: UGC, 3rd
|
|
32
|
-
* party data.
|
|
33
|
-
*/
|
|
34
|
-
untrustedContent?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* If the declarative tool was declared with the autosubmit attribute.
|
|
37
|
-
*/
|
|
38
|
-
autosubmit?: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Represents the status of a tool invocation.
|
|
43
|
-
*
|
|
44
|
-
* @public
|
|
45
|
-
*/
|
|
46
|
-
export type WebMCPInvocationStatus = 'Completed' | 'Canceled' | 'Error';
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @internal
|
|
50
|
-
*/
|
|
51
|
-
export interface ProtocolWebMCPTool {
|
|
52
|
-
name: string;
|
|
53
|
-
description: string;
|
|
54
|
-
inputSchema?: object;
|
|
55
|
-
annotations?: WebMCPAnnotation;
|
|
56
|
-
frameId: string;
|
|
57
|
-
backendNodeId?: number;
|
|
58
|
-
stackTrace?: Protocol.Runtime.StackTrace;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface ProtocolWebMCPToolsAddedEvent {
|
|
62
|
-
tools: ProtocolWebMCPTool[];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface ProtocolWebMCPRemovedTool {
|
|
66
|
-
name: string;
|
|
67
|
-
frameId: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface ProtocolWebMCPToolsRemovedEvent {
|
|
71
|
-
tools: ProtocolWebMCPRemovedTool[];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
interface ProtocolWebMCPToolInvokedEvent {
|
|
75
|
-
toolName: string;
|
|
76
|
-
frameId: string;
|
|
77
|
-
invocationId: string;
|
|
78
|
-
input: string;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
interface ProtocolWebMCPToolRespondedEvent {
|
|
82
|
-
invocationId: string;
|
|
83
|
-
status: WebMCPInvocationStatus;
|
|
84
|
-
output?: any;
|
|
85
|
-
errorText?: string;
|
|
86
|
-
exception?: Protocol.Runtime.RemoteObject;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
20
|
/**
|
|
90
21
|
* Represents a registered WebMCP tool available on the page.
|
|
91
22
|
*
|
|
@@ -114,7 +45,7 @@ export class WebMCPTool extends EventEmitter<{
|
|
|
114
45
|
/**
|
|
115
46
|
* Optional annotations for the tool.
|
|
116
47
|
*/
|
|
117
|
-
annotations?:
|
|
48
|
+
annotations?: Protocol.WebMCP.Annotation;
|
|
118
49
|
/**
|
|
119
50
|
* Frame the tool was defined for.
|
|
120
51
|
*/
|
|
@@ -131,7 +62,7 @@ export class WebMCPTool extends EventEmitter<{
|
|
|
131
62
|
/**
|
|
132
63
|
* @internal
|
|
133
64
|
*/
|
|
134
|
-
constructor(webmcp: WebMCP, tool:
|
|
65
|
+
constructor(webmcp: WebMCP, tool: Protocol.WebMCP.Tool, frame: Frame) {
|
|
135
66
|
super();
|
|
136
67
|
this.#webmcp = webmcp;
|
|
137
68
|
this.name = tool.name;
|
|
@@ -254,7 +185,7 @@ export interface WebMCPToolCallResult {
|
|
|
254
185
|
/**
|
|
255
186
|
* Status of the invocation.
|
|
256
187
|
*/
|
|
257
|
-
status:
|
|
188
|
+
status: Protocol.WebMCP.InvocationStatus;
|
|
258
189
|
/**
|
|
259
190
|
* Output or error delivered as delivered to the agent. Missing if `status` is anything
|
|
260
191
|
* other than Completed.
|
|
@@ -305,7 +236,7 @@ export class WebMCP extends EventEmitter<{
|
|
|
305
236
|
#tools = new Map<string, Map<string, WebMCPTool>>();
|
|
306
237
|
#pendingCalls = new Map<string, WebMCPToolCall>();
|
|
307
238
|
|
|
308
|
-
#onToolsAdded = (event:
|
|
239
|
+
#onToolsAdded = (event: Protocol.WebMCP.ToolsAddedEvent) => {
|
|
309
240
|
const tools: WebMCPTool[] = [];
|
|
310
241
|
for (const tool of event.tools) {
|
|
311
242
|
const frame = this.#frameManager.frame(tool.frameId);
|
|
@@ -327,7 +258,7 @@ export class WebMCP extends EventEmitter<{
|
|
|
327
258
|
this.emit('toolsadded', {tools});
|
|
328
259
|
};
|
|
329
260
|
|
|
330
|
-
#onToolsRemoved = (event:
|
|
261
|
+
#onToolsRemoved = (event: Protocol.WebMCP.ToolsRemovedEvent) => {
|
|
331
262
|
const tools: WebMCPTool[] = [];
|
|
332
263
|
event.tools.forEach(tool => {
|
|
333
264
|
const removedTool = this.#tools.get(tool.frameId)?.get(tool.name);
|
|
@@ -339,7 +270,7 @@ export class WebMCP extends EventEmitter<{
|
|
|
339
270
|
this.emit('toolsremoved', {tools});
|
|
340
271
|
};
|
|
341
272
|
|
|
342
|
-
#onToolInvoked = (event:
|
|
273
|
+
#onToolInvoked = (event: Protocol.WebMCP.ToolInvokedEvent) => {
|
|
343
274
|
const tool = this.#tools.get(event.frameId)?.get(event.toolName);
|
|
344
275
|
if (!tool) {
|
|
345
276
|
return;
|
|
@@ -350,7 +281,7 @@ export class WebMCP extends EventEmitter<{
|
|
|
350
281
|
this.emit('toolinvoked', call);
|
|
351
282
|
};
|
|
352
283
|
|
|
353
|
-
#onToolResponded = (event:
|
|
284
|
+
#onToolResponded = (event: Protocol.WebMCP.ToolRespondedEvent) => {
|
|
354
285
|
const call = this.#pendingCalls.get(event.invocationId);
|
|
355
286
|
if (call) {
|
|
356
287
|
this.#pendingCalls.delete(event.invocationId);
|
|
@@ -42,10 +42,7 @@ export interface SupportedWebDriverCapabilities {
|
|
|
42
42
|
* @public
|
|
43
43
|
*/
|
|
44
44
|
export type ChromeReleaseChannel =
|
|
45
|
-
| 'chrome'
|
|
46
|
-
| 'chrome-beta'
|
|
47
|
-
| 'chrome-canary'
|
|
48
|
-
| 'chrome-dev';
|
|
45
|
+
'chrome' | 'chrome-beta' | 'chrome-canary' | 'chrome-dev';
|
|
49
46
|
|
|
50
47
|
/**
|
|
51
48
|
* Generic browser options that can be passed when launching any browser or when
|
|
@@ -95,6 +95,7 @@ export abstract class BrowserLauncher {
|
|
|
95
95
|
const {
|
|
96
96
|
dumpio = false,
|
|
97
97
|
enableExtensions = false,
|
|
98
|
+
extensionsEnabledInIncognito = [],
|
|
98
99
|
env = process.env,
|
|
99
100
|
handleSIGINT = true,
|
|
100
101
|
handleSIGTERM = true,
|
|
@@ -279,7 +280,9 @@ export abstract class BrowserLauncher {
|
|
|
279
280
|
if (Array.isArray(enableExtensions)) {
|
|
280
281
|
await Promise.all([
|
|
281
282
|
enableExtensions.map(path => {
|
|
282
|
-
return browser.installExtension(path
|
|
283
|
+
return browser.installExtension(path, {
|
|
284
|
+
enabledInIncognito: extensionsEnabledInIncognito.includes(path),
|
|
285
|
+
});
|
|
283
286
|
}),
|
|
284
287
|
]);
|
|
285
288
|
}
|
|
@@ -65,6 +65,11 @@ export interface LaunchOptions extends ConnectOptions {
|
|
|
65
65
|
* load the provided paths as unpacked extensions.
|
|
66
66
|
*/
|
|
67
67
|
enableExtensions?: boolean | string[];
|
|
68
|
+
/**
|
|
69
|
+
* List of extensions that will be enable in Incognito and off-the-record
|
|
70
|
+
* profiles.
|
|
71
|
+
*/
|
|
72
|
+
extensionsEnabledInIncognito?: string[];
|
|
68
73
|
/**
|
|
69
74
|
* Close the browser process on `Ctrl+C`.
|
|
70
75
|
* @defaultValue `true`
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export function normalizeHeaderValue(
|
|
14
|
-
if (!
|
|
15
|
-
return
|
|
13
|
+
export function normalizeHeaderValue(name: string, value: string): string {
|
|
14
|
+
if (!value.includes('\n')) {
|
|
15
|
+
return value;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
return
|
|
18
|
+
return value
|
|
19
19
|
.split('\n')
|
|
20
20
|
.map(v => {
|
|
21
21
|
return v.trim();
|
|
22
22
|
})
|
|
23
23
|
.filter(Boolean)
|
|
24
|
-
.join(', ');
|
|
24
|
+
.join(name === 'set-cookie' ? '\n ' : ', ');
|
|
25
25
|
}
|
|
@@ -118,6 +118,9 @@ type DialogAnchor = HTMLElement|DOMRect|DOMPoint;
|
|
|
118
118
|
export const MODAL = 'MODAL';
|
|
119
119
|
|
|
120
120
|
export type DialogOrigin = DialogAnchor|null|(() => DialogAnchor)|typeof MODAL;
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated in favor of UI.Dialog.Dialog.
|
|
123
|
+
*/
|
|
121
124
|
export class Dialog extends HTMLElement {
|
|
122
125
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
123
126
|
readonly #forceDialogCloseInDevToolsBound = this.#forceDialogCloseInDevToolsMutation.bind(this);
|
|
@@ -2,8 +2,6 @@
|
|
|
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
|
-
import * as Greendev from '../../../models/greendev/greendev.js';
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* To use links in markdown, add key here with the link and
|
|
9
7
|
* use the added key in markdown.
|
|
@@ -108,11 +106,6 @@ export const getMarkdownLink = (key: string): string => {
|
|
|
108
106
|
}
|
|
109
107
|
const link = markdownLinks.get(key);
|
|
110
108
|
if (!link) {
|
|
111
|
-
if (Greendev.Prototypes.instance().isEnabled('beyondStylingAntigravity') ||
|
|
112
|
-
Greendev.Prototypes.instance().isEnabled('beyondStylingGemini')) {
|
|
113
|
-
return key;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
109
|
throw new Error(`Markdown link with key '${key}' is not available, please check MarkdownLinksMap.ts`);
|
|
117
110
|
}
|
|
118
111
|
return link;
|
|
@@ -43,13 +43,16 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
43
43
|
* Opens the given `url` in a new Chrome tab.
|
|
44
44
|
*
|
|
45
45
|
* If the `url` is a Google owned documentation page (currently that includes
|
|
46
|
-
* `web.dev`, `developers.google.com`, and `developer.chrome.com`)
|
|
47
|
-
* will also be checked
|
|
46
|
+
* `web.dev`, `developers.google.com`, and `developer.chrome.com`) or an MDN
|
|
47
|
+
* documentation page (`developer.mozilla.org`), the `url` will also be checked
|
|
48
|
+
* for UTM parameters:
|
|
48
49
|
*
|
|
49
|
-
* -
|
|
50
|
-
*
|
|
51
|
-
* -
|
|
52
|
-
*
|
|
50
|
+
* - For MDN links (`developer.mozilla.org`), if neither `utm_source` nor `utm_medium` is present,
|
|
51
|
+
* this method will add `utm_source=chrome-devtools` and `utm_medium=referral`.
|
|
52
|
+
* - For Google documentation links, if no `utm_source` search parameter is present, this method
|
|
53
|
+
* will add a new search parameter `utm_source=devtools` to `url`.
|
|
54
|
+
* - If no `utm_campaign` search parameter is present on Google documentation links, and DevTools
|
|
55
|
+
* is running within a branded build, this method will add `utm_campaign=<channel>` to
|
|
53
56
|
* the search parameters, with `<channel>` being the release channel of
|
|
54
57
|
* Chrome ("stable", "beta", "dev", or "canary").
|
|
55
58
|
*
|
|
@@ -77,7 +80,12 @@ export function openInNewTab(url: URL|string, allowPrivileged?: boolean): void {
|
|
|
77
80
|
}
|
|
78
81
|
});
|
|
79
82
|
} else {
|
|
80
|
-
if (
|
|
83
|
+
if (url.hostname === 'developer.mozilla.org') {
|
|
84
|
+
if (!url.searchParams.has('utm_source') && !url.searchParams.has('utm_medium')) {
|
|
85
|
+
url.searchParams.append('utm_source', 'chrome-devtools');
|
|
86
|
+
url.searchParams.append('utm_medium', 'referral');
|
|
87
|
+
}
|
|
88
|
+
} else if (['developer.chrome.com', 'developers.google.com', 'web.dev'].includes(url.hostname)) {
|
|
81
89
|
if (!url.searchParams.has('utm_source')) {
|
|
82
90
|
url.searchParams.append('utm_source', 'devtools');
|
|
83
91
|
}
|
|
@@ -244,6 +244,7 @@ export class InspectorDrawerView {
|
|
|
244
244
|
const wasDrawerVisible = this.isVisibleForEvents();
|
|
245
245
|
this.tabbedPane.setAutoSelectFirstItemOnShow(!hasTargetDrawer);
|
|
246
246
|
this.#splitWidget.showBoth();
|
|
247
|
+
this.#updatePresentation(this.isMinimized());
|
|
247
248
|
this.#dispatchPaneVisibilityChangedIfNeeded(wasDrawerVisible);
|
|
248
249
|
}
|
|
249
250
|
|
|
@@ -251,8 +252,8 @@ export class InspectorDrawerView {
|
|
|
251
252
|
const wasDrawerVisible = this.isVisibleForEvents();
|
|
252
253
|
const wasMinimized = this.isMinimized();
|
|
253
254
|
this.#splitWidget.hideSidebar(!wasMinimized);
|
|
255
|
+
this.#updatePresentation(false);
|
|
254
256
|
if (wasMinimized) {
|
|
255
|
-
this.#updatePresentation(false);
|
|
256
257
|
this.#splitWidget.setSidebarMinimized(false);
|
|
257
258
|
this.#splitWidget.setResizable(true);
|
|
258
259
|
}
|
|
@@ -341,11 +342,12 @@ export class InspectorDrawerView {
|
|
|
341
342
|
}
|
|
342
343
|
|
|
343
344
|
#updatePresentation(minimized: boolean): void {
|
|
345
|
+
const requireVerticalMinimumWidth =
|
|
346
|
+
this.#splitWidget.isVertical() && this.#splitWidget.sidebarIsShowing() && !minimized;
|
|
347
|
+
this.#setInspectorMinimumSize(requireVerticalMinimumWidth ? this.#minimumSizes.inspectorWidthWhenVertical :
|
|
348
|
+
this.#minimumSizes.inspectorWidthWhenHorizontal,
|
|
349
|
+
this.#minimumSizes.inspectorHeight);
|
|
344
350
|
const drawerIsVertical = this.#splitWidget.isVertical();
|
|
345
|
-
this.#setInspectorMinimumSize(
|
|
346
|
-
drawerIsVertical ? this.#minimumSizes.inspectorWidthWhenVertical :
|
|
347
|
-
this.#minimumSizes.inspectorWidthWhenHorizontal,
|
|
348
|
-
this.#minimumSizes.inspectorHeight);
|
|
349
351
|
this.updatePresentation({
|
|
350
352
|
isVertical: drawerIsVertical,
|
|
351
353
|
isMinimized: minimized,
|
|
@@ -64,6 +64,7 @@ export class ListWidget<T> extends VBox {
|
|
|
64
64
|
private editElement: HTMLElement|null;
|
|
65
65
|
private emptyPlaceholder: Element|null;
|
|
66
66
|
private isTable: boolean;
|
|
67
|
+
private headerElement: Element|null = null;
|
|
67
68
|
constructor(delegate: Delegate<T>, delegatesFocus = true, isTable = false) {
|
|
68
69
|
super({useShadowDom: true, delegatesFocus});
|
|
69
70
|
this.registerRequiredCSS(listWidgetStyles);
|
|
@@ -100,10 +101,21 @@ export class ListWidget<T> extends VBox {
|
|
|
100
101
|
this.elements = [];
|
|
101
102
|
this.lastSeparator = false;
|
|
102
103
|
this.list.removeChildren();
|
|
104
|
+
if (this.headerElement) {
|
|
105
|
+
this.list.appendChild(this.headerElement);
|
|
106
|
+
}
|
|
103
107
|
this.updatePlaceholder();
|
|
104
108
|
this.stopEditing();
|
|
105
109
|
}
|
|
106
110
|
|
|
111
|
+
setHeader(header: Element): void {
|
|
112
|
+
if (this.headerElement) {
|
|
113
|
+
this.headerElement.remove();
|
|
114
|
+
}
|
|
115
|
+
this.headerElement = header;
|
|
116
|
+
this.list.insertBefore(header, this.list.firstChild);
|
|
117
|
+
}
|
|
118
|
+
|
|
107
119
|
updateItem(index: number, newItem: T, editable: boolean, focusable = true, controlLabels: {
|
|
108
120
|
edit?: string,
|
|
109
121
|
delete?: string,
|
|
@@ -54,6 +54,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
54
54
|
#showMode: ShowMode = ShowMode.BOTH;
|
|
55
55
|
#savedShowMode: ShowMode;
|
|
56
56
|
#autoAdjustOrientation = false;
|
|
57
|
+
readonly #zoomManager = ZoomManager.instance();
|
|
57
58
|
|
|
58
59
|
constructor(
|
|
59
60
|
isVertical: boolean,
|
|
@@ -401,7 +402,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
401
402
|
}
|
|
402
403
|
|
|
403
404
|
setSidebarSize(size: number): void {
|
|
404
|
-
const sizeDIP =
|
|
405
|
+
const sizeDIP = this.#zoomManager.cssToDIP(size);
|
|
405
406
|
this.#savedSidebarSizeDIP = sizeDIP;
|
|
406
407
|
this.#saveSetting();
|
|
407
408
|
this.#setSidebarSizeDIP(sizeDIP, false, true);
|
|
@@ -409,12 +410,12 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
409
410
|
|
|
410
411
|
sidebarSize(): number {
|
|
411
412
|
const sizeDIP = Math.max(0, this.#sidebarSizeDIP);
|
|
412
|
-
return
|
|
413
|
+
return this.#zoomManager.dipToCSS(sizeDIP);
|
|
413
414
|
}
|
|
414
415
|
|
|
415
416
|
totalSize(): number {
|
|
416
417
|
const sizeDIP = Math.max(0, this.#totalSizeDIP());
|
|
417
|
-
return
|
|
418
|
+
return this.#zoomManager.dipToCSS(sizeDIP);
|
|
418
419
|
}
|
|
419
420
|
|
|
420
421
|
/**
|
|
@@ -426,7 +427,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
426
427
|
this.#totalSizeCSS = this.#isVertical ? width : height;
|
|
427
428
|
this.#totalSizeOtherDimensionCSS = this.#isVertical ? height : width;
|
|
428
429
|
}
|
|
429
|
-
return
|
|
430
|
+
return this.#zoomManager.cssToDIP(this.#totalSizeCSS);
|
|
430
431
|
}
|
|
431
432
|
|
|
432
433
|
#updateShowMode(showMode: ShowMode): void {
|
|
@@ -457,7 +458,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
457
458
|
this.#removeAllLayoutProperties();
|
|
458
459
|
|
|
459
460
|
// this.#totalSizeDIP is available below since we successfully applied constraints.
|
|
460
|
-
const sizeCSS =
|
|
461
|
+
const sizeCSS = this.#zoomManager.dipToCSS(sizeDIP);
|
|
461
462
|
const sidebarSizeValue = sizeCSS + 'px';
|
|
462
463
|
const mainSizeValue = (this.#totalSizeCSS - sizeCSS) + 'px';
|
|
463
464
|
// With `box-sizing: border-box` on the sidebar (set in splitWidget.css),
|
|
@@ -519,8 +520,8 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
519
520
|
animatedMarginPropertyName = this.#secondIsSidebar ? 'margin-bottom' : 'margin-top';
|
|
520
521
|
}
|
|
521
522
|
|
|
522
|
-
const marginFrom = reverse ? '0' : '-' +
|
|
523
|
-
const marginTo = reverse ? '-' +
|
|
523
|
+
const marginFrom = reverse ? '0' : '-' + this.#zoomManager.dipToCSS(this.#sidebarSizeDIP) + 'px';
|
|
524
|
+
const marginTo = reverse ? '-' + this.#zoomManager.dipToCSS(this.#sidebarSizeDIP) + 'px' : '0';
|
|
524
525
|
|
|
525
526
|
// This order of things is important.
|
|
526
527
|
// 1. Resize main element early and force layout.
|
|
@@ -587,7 +588,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
587
588
|
|
|
588
589
|
#applyConstraints(sidebarSize: number, userAction?: boolean): number {
|
|
589
590
|
const totalSize = this.#totalSizeDIP();
|
|
590
|
-
const zoomFactor = this.#constraintsInDip ? 1 :
|
|
591
|
+
const zoomFactor = this.#constraintsInDip ? 1 : this.#zoomManager.zoomFactor();
|
|
591
592
|
|
|
592
593
|
let constraints: Geometry.Constraints =
|
|
593
594
|
this.#sidebarWidget ? this.#sidebarWidget.constraints() : new Geometry.Constraints();
|
|
@@ -653,12 +654,12 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
653
654
|
override wasShown(): void {
|
|
654
655
|
super.wasShown();
|
|
655
656
|
this.#forceUpdateLayout();
|
|
656
|
-
|
|
657
|
+
this.#zoomManager.addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);
|
|
657
658
|
}
|
|
658
659
|
|
|
659
660
|
override willHide(): void {
|
|
660
661
|
super.willHide();
|
|
661
|
-
|
|
662
|
+
this.#zoomManager.removeEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);
|
|
662
663
|
}
|
|
663
664
|
|
|
664
665
|
override onResize(): void {
|
|
@@ -711,7 +712,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
711
712
|
|
|
712
713
|
#onResizeUpdate(event: Common.EventTarget.EventTargetEvent<ResizeUpdatePositionEvent>): void {
|
|
713
714
|
const offset = event.data.currentPosition - event.data.startPosition;
|
|
714
|
-
const offsetDIP =
|
|
715
|
+
const offsetDIP = this.#zoomManager.cssToDIP(offset);
|
|
715
716
|
const newSizeDIP =
|
|
716
717
|
this.#secondIsSidebar ? this.#resizeStartSizeDIP - offsetDIP : this.#resizeStartSizeDIP + offsetDIP;
|
|
717
718
|
const constrainedSizeDIP = this.#applyConstraints(newSizeDIP, true);
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import * as Common from '../../core/common/common.js';
|
|
8
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
9
9
|
import * as Platform from '../../core/platform/platform.js';
|
|
10
|
-
import * as Annotations from '../../models/annotations/annotations.js';
|
|
11
10
|
import * as Geometry from '../../models/geometry/geometry.js';
|
|
12
11
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
13
12
|
import {type LitTemplate, render} from '../../ui/lit/lit.js';
|
|
@@ -53,10 +52,7 @@ const UIStrings = {
|
|
|
53
52
|
* @description Indicates that a tab contains a preview feature (i.e., a beta / experimental feature).
|
|
54
53
|
*/
|
|
55
54
|
previewFeature: 'Preview feature',
|
|
56
|
-
|
|
57
|
-
* @description Indicates that a tab contains annotation(s).
|
|
58
|
-
*/
|
|
59
|
-
panelContainsAnnotation: 'This panel has one or more annotations',
|
|
55
|
+
|
|
60
56
|
/**
|
|
61
57
|
* @description Text to move a tab forwar.
|
|
62
58
|
*/
|
|
@@ -181,14 +177,6 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
181
177
|
ZoomManager.instance().addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.zoomChanged, this);
|
|
182
178
|
this.makeTabSlider();
|
|
183
179
|
|
|
184
|
-
if (Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
185
|
-
Annotations.AnnotationRepository.instance().addEventListener(
|
|
186
|
-
Annotations.Events.ANNOTATION_ADDED, this.#onUpdateAnnotations, this);
|
|
187
|
-
Annotations.AnnotationRepository.instance().addEventListener(
|
|
188
|
-
Annotations.Events.ANNOTATION_DELETED, this.#onUpdateAnnotations, this);
|
|
189
|
-
Annotations.AnnotationRepository.instance().addEventListener(
|
|
190
|
-
Annotations.Events.ALL_ANNOTATIONS_DELETED, this.#onUpdateAnnotations, this);
|
|
191
|
-
}
|
|
192
180
|
}
|
|
193
181
|
|
|
194
182
|
setAccessibleName(name: string): void {
|
|
@@ -679,36 +667,6 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
679
667
|
this.performUpdate();
|
|
680
668
|
}
|
|
681
669
|
|
|
682
|
-
updateTabAnnotationIcons(): void {
|
|
683
|
-
if (!Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
const annotations = Annotations.AnnotationRepository.instance();
|
|
688
|
-
if (!annotations) {
|
|
689
|
-
return;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
for (const tab of this.tabs) {
|
|
693
|
-
let primaryType = -1;
|
|
694
|
-
let secondaryType = -1;
|
|
695
|
-
switch (tab.id) {
|
|
696
|
-
case 'elements':
|
|
697
|
-
primaryType = Annotations.AnnotationType.ELEMENT_NODE;
|
|
698
|
-
secondaryType = Annotations.AnnotationType.STYLE_RULE;
|
|
699
|
-
break;
|
|
700
|
-
case 'network':
|
|
701
|
-
primaryType = Annotations.AnnotationType.NETWORK_REQUEST;
|
|
702
|
-
secondaryType = Annotations.AnnotationType.NETWORK_REQUEST_SUBPANEL_HEADERS;
|
|
703
|
-
break;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
const showTabAnnotationIcon = annotations.getAnnotationDataByType(primaryType).length > 0 ||
|
|
707
|
-
annotations.getAnnotationDataByType(secondaryType).length > 0;
|
|
708
|
-
this.setTabAnnotationIcon(tab.id, showTabAnnotationIcon);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
|
|
712
670
|
override performUpdate(): void {
|
|
713
671
|
if (!this.isShowing()) {
|
|
714
672
|
return;
|
|
@@ -737,7 +695,6 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
737
695
|
this.updateWidths();
|
|
738
696
|
this.updateTabsDropDown();
|
|
739
697
|
this.updateTabSlider();
|
|
740
|
-
this.updateTabAnnotationIcons();
|
|
741
698
|
}
|
|
742
699
|
|
|
743
700
|
private adjustToolbarWidth(): void {
|
|
@@ -1207,17 +1164,6 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
1207
1164
|
this.automaticReorder = automatic;
|
|
1208
1165
|
}
|
|
1209
1166
|
|
|
1210
|
-
setTabAnnotationIcon(id: string, iconVisible: boolean): void {
|
|
1211
|
-
const tab = this.tabsById.get(id);
|
|
1212
|
-
if (tab) {
|
|
1213
|
-
tab.tabAnnotationIcon = iconVisible;
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
#onUpdateAnnotations(): void {
|
|
1218
|
-
this.updateTabAnnotationIcons();
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
1167
|
private keyDown(event: KeyboardEvent): void {
|
|
1222
1168
|
if (!this.currentTab) {
|
|
1223
1169
|
return;
|
|
@@ -1288,7 +1234,6 @@ export interface EventTypes {
|
|
|
1288
1234
|
export class TabbedPaneTab {
|
|
1289
1235
|
closeable: boolean;
|
|
1290
1236
|
previewFeature = false;
|
|
1291
|
-
#tabAnnotationIcon = false;
|
|
1292
1237
|
private readonly tabbedPane: TabbedPane;
|
|
1293
1238
|
#id: string;
|
|
1294
1239
|
#title: string;
|
|
@@ -1349,42 +1294,6 @@ export class TabbedPaneTab {
|
|
|
1349
1294
|
this.#jslogContext = jslogContext;
|
|
1350
1295
|
}
|
|
1351
1296
|
|
|
1352
|
-
get tabAnnotationIcon(): boolean {
|
|
1353
|
-
return this.#tabAnnotationIcon;
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
set tabAnnotationIcon(iconVisible: boolean) {
|
|
1357
|
-
if (this.#tabAnnotationIcon === iconVisible) {
|
|
1358
|
-
return;
|
|
1359
|
-
}
|
|
1360
|
-
this.#tabAnnotationIcon = iconVisible;
|
|
1361
|
-
if (!this.#tabElement) {
|
|
1362
|
-
return;
|
|
1363
|
-
}
|
|
1364
|
-
const iconElement = this.#tabElement.querySelector('.spark');
|
|
1365
|
-
if (iconVisible) {
|
|
1366
|
-
if (!iconElement) {
|
|
1367
|
-
const spark = this.createTabAnnotationIcon();
|
|
1368
|
-
this.#tabElement.appendChild(spark);
|
|
1369
|
-
|
|
1370
|
-
const parentRect = this.#tabElement.parentElement?.getBoundingClientRect();
|
|
1371
|
-
if (!parentRect) {
|
|
1372
|
-
return;
|
|
1373
|
-
}
|
|
1374
|
-
const containerRect = this.tabElement.getBoundingClientRect();
|
|
1375
|
-
const iconWidth = spark.getBoundingClientRect().width;
|
|
1376
|
-
// Position the icon so that its right edge is at the container's right edge.
|
|
1377
|
-
const x = containerRect.x - parentRect.x + containerRect.width - iconWidth;
|
|
1378
|
-
(spark as HTMLElement).style.left = `${x}px`;
|
|
1379
|
-
}
|
|
1380
|
-
} else {
|
|
1381
|
-
iconElement?.remove();
|
|
1382
|
-
}
|
|
1383
|
-
this.#tabElement.classList.toggle('ai', iconVisible);
|
|
1384
|
-
delete this.measuredWidth;
|
|
1385
|
-
this.tabbedPane.requestUpdate();
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
1297
|
isCloseable(): boolean {
|
|
1389
1298
|
return this.closeable;
|
|
1390
1299
|
}
|
|
@@ -1529,12 +1438,6 @@ export class TabbedPaneTab {
|
|
|
1529
1438
|
tabElement.classList.add('preview');
|
|
1530
1439
|
}
|
|
1531
1440
|
|
|
1532
|
-
if (this.tabAnnotationIcon) {
|
|
1533
|
-
const tabAnnotationIcon = this.createTabAnnotationIcon();
|
|
1534
|
-
tabElement.appendChild(tabAnnotationIcon);
|
|
1535
|
-
tabElement.classList.add('ai');
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
1441
|
if (this.closeable) {
|
|
1539
1442
|
const closeIcon = this.createCloseIconButton();
|
|
1540
1443
|
tabElement.appendChild(closeIcon);
|
|
@@ -1561,16 +1464,6 @@ export class TabbedPaneTab {
|
|
|
1561
1464
|
return tabElement as HTMLElement;
|
|
1562
1465
|
}
|
|
1563
1466
|
|
|
1564
|
-
private createTabAnnotationIcon(): Icon {
|
|
1565
|
-
const tabAnnotationIcon = new Icon();
|
|
1566
|
-
tabAnnotationIcon.name = 'spark';
|
|
1567
|
-
tabAnnotationIcon.classList.add('small');
|
|
1568
|
-
tabAnnotationIcon.classList.add('spark');
|
|
1569
|
-
tabAnnotationIcon.setAttribute('title', i18nString(UIStrings.panelContainsAnnotation));
|
|
1570
|
-
tabAnnotationIcon.setAttribute('aria-label', i18nString(UIStrings.panelContainsAnnotation));
|
|
1571
|
-
return tabAnnotationIcon;
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
1467
|
private createCloseIconButton(): Buttons.Button.Button {
|
|
1575
1468
|
const closeButton = new Buttons.Button.Button();
|
|
1576
1469
|
closeButton.data = {
|
|
@@ -162,6 +162,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
162
162
|
private resizeMethod: ResizeMethod;
|
|
163
163
|
private headerContextMenuCallback: ((arg0: UI.ContextMenu.SubMenu) => void)|null;
|
|
164
164
|
private rowContextMenuCallback: ((arg0: UI.ContextMenu.ContextMenu, arg1: DataGridNode<T>) => void)|null;
|
|
165
|
+
private tableContextMenuCallback: ((arg0: UI.ContextMenu.ContextMenu) => void)|null;
|
|
165
166
|
elementToDataGridNode: WeakMap<Node, DataGridNode<T>>;
|
|
166
167
|
disclosureColumnId?: string;
|
|
167
168
|
private sortColumnCell?: Element;
|
|
@@ -246,6 +247,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
246
247
|
|
|
247
248
|
this.headerContextMenuCallback = null;
|
|
248
249
|
this.rowContextMenuCallback = null;
|
|
250
|
+
this.tableContextMenuCallback = null;
|
|
249
251
|
|
|
250
252
|
this.elementToDataGridNode = new WeakMap();
|
|
251
253
|
}
|
|
@@ -1407,6 +1409,10 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1407
1409
|
}
|
|
1408
1410
|
}
|
|
1409
1411
|
|
|
1412
|
+
setTableContextMenuCallback(callback: ((arg0: UI.ContextMenu.ContextMenu) => void)|null): void {
|
|
1413
|
+
this.tableContextMenuCallback = callback;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1410
1416
|
setHeaderContextMenuCallback(callback: ((arg0: UI.ContextMenu.SubMenu) => void)|null): void {
|
|
1411
1417
|
this.headerContextMenuCallback = callback;
|
|
1412
1418
|
}
|
|
@@ -1420,6 +1426,9 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1420
1426
|
return;
|
|
1421
1427
|
}
|
|
1422
1428
|
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
|
1429
|
+
if (this.tableContextMenuCallback) {
|
|
1430
|
+
this.tableContextMenuCallback(contextMenu);
|
|
1431
|
+
}
|
|
1423
1432
|
const target = (event.target as Node);
|
|
1424
1433
|
|
|
1425
1434
|
const sortableVisibleColumns = this.visibleColumnsArray.filter(column => {
|