chrome-devtools-frontend 1.0.1674545 → 1.0.1676824
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/devtools-ux-writing-refactor/SKILL.md +26 -9
- package/WATCHLISTS +0 -4
- package/front_end/core/common/ParsedURL.ts +5 -1
- package/front_end/core/common/SettingRegistration.ts +29 -8
- package/front_end/core/common/Settings.ts +0 -77
- package/front_end/core/root/Runtime.ts +4 -5
- package/front_end/core/sdk/CSSMetadata.ts +5 -9
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +8 -28
- package/front_end/core/sdk/DebuggerModel.ts +50 -30
- package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
- package/front_end/core/sdk/Script.ts +9 -53
- package/front_end/core/sdk/TargetManager.ts +18 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
- package/front_end/entrypoints/main/MainImpl.ts +32 -0
- package/front_end/foundation/Universe.ts +44 -29
- package/front_end/generated/InspectorBackendCommands.ts +3 -1
- package/front_end/generated/SupportedCSSProperties.ts +21 -4
- package/front_end/generated/protocol-mapping.d.ts +14 -0
- package/front_end/generated/protocol-proxy-api.d.ts +10 -0
- package/front_end/generated/protocol.ts +35 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -0
- package/front_end/models/ai_assistance/AiConversation.ts +22 -5
- package/front_end/models/ai_assistance/README.md +52 -26
- package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +15 -192
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +8 -87
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +16 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +111 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
- package/front_end/models/ai_assistance/skills/README.md +63 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
- package/front_end/models/ai_assistance/skills/performance.md +8 -0
- package/front_end/models/ai_assistance/skills/sources.md +16 -0
- package/front_end/models/ai_assistance/skills/storage.md +31 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +81 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +22 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +14 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
- package/front_end/models/emulation/DeviceModeModel.ts +60 -71
- package/front_end/models/emulation/EmulatedDevices.ts +18 -66
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
- package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +2 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -31
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/persistence/persistence-meta.ts +9 -9
- package/front_end/models/trace/types/TraceEvents.ts +36 -0
- package/front_end/models/workspace/FileManager.ts +13 -6
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
- package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
- package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -2
- package/front_end/panels/application/IndexedDBViews.ts +65 -63
- package/front_end/panels/application/WebMCPView.ts +29 -12
- package/front_end/panels/application/components/AdsView.ts +24 -1
- package/front_end/panels/application/components/adsView.css +27 -21
- package/front_end/panels/autofill/AutofillView.ts +12 -12
- package/front_end/panels/autofill/autofill-meta.ts +2 -2
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/ExtensionServer.ts +21 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
- package/front_end/panels/common/PersistenceUtils.ts +2 -2
- package/front_end/panels/common/common.ts +0 -97
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +20 -19
- package/front_end/panels/elements/ElementsTreeElement.ts +550 -327
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/LayoutPane.ts +2 -8
- package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
- package/front_end/panels/js_timeline/js_timeline-meta.ts +8 -8
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +30 -30
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +6 -6
- package/front_end/panels/layer_viewer/LayerViewHost.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +11 -11
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +8 -8
- package/front_end/panels/layer_viewer/TransformController.ts +3 -3
- package/front_end/panels/layer_viewer/layer_viewer-meta.ts +11 -11
- package/front_end/panels/media/PlayerMessagesView.ts +149 -68
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -58
- package/front_end/panels/mobile_throttling/mobile_throttling.ts +0 -10
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +1 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
- package/front_end/panels/profiler/heapProfiler.css +0 -9
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +7 -0
- package/front_end/panels/recorder/RecorderPanel.ts +2 -3
- package/front_end/panels/screencast/ScreencastView.ts +148 -138
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +9 -58
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -8
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
- package/front_end/panels/timeline/TimelineController.ts +36 -64
- package/front_end/panels/timeline/TimelinePanel.ts +11 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timelinePanel.css +0 -10
- package/front_end/panels/utils/utils.ts +7 -7
- package/front_end/services/tracing/PerformanceTracing.ts +5 -17
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/package.json +2 -2
- package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +558 -0
- package/front_end/ui/comments/CommentManager.ts +640 -0
- package/front_end/ui/comments/CommentsOverlayWidget.ts +121 -0
- package/front_end/ui/comments/comments.ts +13 -0
- package/front_end/ui/comments/commentsOverlay.css +49 -0
- package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
- package/front_end/ui/components/dialogs/dialogs.ts +4 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
- package/front_end/ui/components/text_editor/text_editor.ts +4 -0
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +40 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +270 -162
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +8 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -0
- package/front_end/ui/settings/SettingUIRegistration.ts +59 -6
- package/front_end/ui/visual_logging/Debugging.ts +1 -5
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/front_end/ui/visual_logging/LoggingConfig.ts +21 -0
- package/front_end/ui/visual_logging/visual_logging.ts +9 -0
- package/mcp/mcp.ts +6 -1
- package/package.json +1 -1
- package/front_end/Images/toolbarResizerVertical.png +0 -0
- package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
- package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
- package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
- package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
- package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
- package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
- package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/iPad-landscape.svg +0 -73
- package/front_end/emulated_devices/iPad-portrait.svg +0 -76
- package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
- package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
- package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
- package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
- package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
- package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
- package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/README.md +0 -9
- package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
- package/front_end/models/ai_assistance/agents/README.md +0 -136
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +0 -92
- /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
- /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
|
@@ -59,14 +59,16 @@ Locate all TypeScript files in the target folder that define `const UIStrings =
|
|
|
59
59
|
* For panel names that consist of two words, capitalize only the first word (for example, `Developer resources panel`).
|
|
60
60
|
* When you use the panel name in combination with another word, capitalize the panel name but not the other word, unless it is a proper noun (for example, `Console view` or `DevTools Console`).
|
|
61
61
|
* In some cases, ambiguity exists whether a word refers to a UX element in DevTools (such as a panel name) or a concept (such as developer terminology). For example, this occurs with `console`, `issue`, or `network`. Decide based on the surrounding context and code (for example, `Console view`, `Console sidebar`, and `Console prompt` versus `console message`, `console warning`, `console log`, `copy console`, `clear console`, and `console history`; `Show Network` versus `network log` and `network filter`).
|
|
62
|
+
* **Casing in `@description` comments:** Apply the same capitalization rules to `@description` comments: ONLY panel names use sentence case (for example, `Memory panel`, `Console panel`, `Performance panel`). Feature names, view names, tool names, and sub-components MUST be all lowercase unless they appear at the very start of the description sentence or phrase (for example, `heap profiler`, `heap snapshot view`, `isolate selector`, `allocation sampling`, `command menu`, `summary view`).
|
|
62
63
|
6. **Punctuation and actionability:** Remove trailing periods from single-sentence labels or titles. Ensure that error messages instruct the user how to recover (for example, `Shorten filename to 64 characters or less` instead of `Invalid filename`). Ensure that ARIA labels and multi-sentence tooltips have consistent terminal punctuation.
|
|
63
64
|
7. **Terminology (glossary):** Strictly follow standard DevTools UI terminology and letter casing (`panel`, `tab`, `drawer`, `sidebar`, `datagrid` or `table`, `action bar`, `status bar`, and `live expressions section`). Never use `pane` or call tabs `panes` in UI strings or localization (L10n) comments.
|
|
64
65
|
8. **Localization (L10n) comments:** Ensure that every string in `UIStrings` has a preceding `@description` comment that explains where and when it appears. This information is used for translators who need to understand the context in which the string is used.
|
|
66
|
+
* **Research usage sites:** Before modifying or writing `@description` comments, always research where the string key (for example, `UIStrings.keyName`) is used in the codebase (`grep_search` or view surrounding code). Determine the exact UI element type (for example, button label, tooltip, table column header, context menu item, checkbox label, aria label, status bar message, or dropdown option) and location (panel, view, sidebar, or dialog).
|
|
67
|
+
* **Avoid redundancy and repetition:** Do not simply repeat or restate the UI string value in the description (for example, avoid `@description Text for clear all profiles` for `'Clear all profiles'`). Instead, describe the UI role, element type, and location (for example, `@description Tooltip text for the clear button in the profiles sidebar of the Memory panel.`).
|
|
68
|
+
* **Consistency across similar descriptions:** Ensure consistent phrasing structure across descriptions of similar UI strings in the same module and throughout DevTools (for example, use uniform patterns like `Tooltip text for the <action> button in <location>.` or `Column header in <table_name> datagrid for <purpose>.`).
|
|
69
|
+
* **Casing in descriptions:** Strictly follow the rule that ONLY panel names use sentence case (for example, `Memory panel`, `Console panel`, `Profiles panel`), while feature names, views, tools, and sub-components are ALL LOWERCASE (for example, `heap profiler`, `heap snapshot view`, `isolate selector`, `allocation sampling`, `summary view`), unless appearing at the start of the description sentence or phrase.
|
|
65
70
|
* **Straight apostrophes in comments:** Always use straight apostrophes (`'`) in code comments (such as `@description` comments and L10n annotations), even if the UI string itself uses curly apostrophes (`’`).
|
|
66
|
-
*
|
|
67
|
-
ambiguous, figure out the context by looking at the use site of the
|
|
68
|
-
string and come up with a better description.
|
|
69
|
-
* You must explicitly document all standard placeholders (`{PH1}`, `{url}`, `{index}`) with runtime data examples (for example, `@example {https://example.com} url`).
|
|
71
|
+
* **Placeholders:** You must explicitly document all standard placeholders (`{PH1}`, `{url}`, `{index}`) with runtime data examples (for example, `@example {https://example.com} url`).
|
|
70
72
|
* *ICU plural variables:* The i18n tool automatically parses variables in ICU plural format (such as `n` in `{n, plural, =0 {No issues} ...}`) as numeric counts, so they don’t require an `@example` tag in the `@description` comment.
|
|
71
73
|
* *Terminal punctuation:* Every `@description` comment must end with a period (`.`), even if it is a single phrase or sentence.
|
|
72
74
|
|
|
@@ -74,11 +76,26 @@ Locate all TypeScript files in the target folder that define `const UIStrings =
|
|
|
74
76
|
|
|
75
77
|
Also consult the style guides at `google3/experimental/users/rachelandrew/tools/chrome_writing/knowledge/style/` for applicable guidelines.
|
|
76
78
|
|
|
77
|
-
## 5.
|
|
79
|
+
## 5. Subagent critique of proposed changes
|
|
80
|
+
|
|
81
|
+
Before running tests or pausing for user review, enter an iterative critique loop with a subagent:
|
|
82
|
+
1. **Invoke subagent:** Use `invoke_subagent` with `TypeName: "self"` and `Role: "UX Writing Reviewer"`.
|
|
83
|
+
2. **Prompt instructions:** Provide the subagent with the `git diff` of your changes and instruct it to critique the refactoring against the **8-point UX writing checklist**:
|
|
84
|
+
- Are `@description` comments specific, informative, and non-redundant (not restating string values)?
|
|
85
|
+
- Are usage sites researched so the UI element type and location are accurately described?
|
|
86
|
+
- Do `@description` comments and string values strictly follow the casing rule (ONLY panel names in sentence case, feature/view names in all lowercase unless starting a phrase)?
|
|
87
|
+
- Are contractions, curly apostrophes, ellipses, and placeholders (`{PH1}`) correctly formatted?
|
|
88
|
+
- Were all references in sibling code/tests properly updated?
|
|
89
|
+
3. **Address feedback and loop:**
|
|
90
|
+
- If the subagent raises any feedback, concerns, or suggested fixes, apply the necessary code changes.
|
|
91
|
+
- Re-invoke the subagent with the updated `git diff` to re-critique the changes.
|
|
92
|
+
- **Repeat this loop continuously as long as the subagent has feedback, until the subagent explicitly approves the diff with no remaining issues.**
|
|
93
|
+
|
|
94
|
+
## 6. Pause for confirmation
|
|
78
95
|
|
|
79
96
|
Ask the user for a preliminary review of the proposed changes before proceeding. If the user has feedback, address feedback and pause again for confirmation.
|
|
80
97
|
|
|
81
|
-
##
|
|
98
|
+
## 7. Mandatory verification and testing
|
|
82
99
|
|
|
83
100
|
Don’t finish an edit without running the linter and test suite. In DevTools, i18n placeholder changes or string edits can easily break tests or linter rules.
|
|
84
101
|
|
|
@@ -89,18 +106,18 @@ Don’t finish an edit without running the linter and test suite. In DevTools, i
|
|
|
89
106
|
npm run lint -- <folder_path>
|
|
90
107
|
```
|
|
91
108
|
3. **Run unit tests**
|
|
92
|
-
|
|
109
|
+
You MUST run the full test suite using `npm run test` to verify that no cross-module regressions, e2e test failures, or snapshot regressions occurred. Do not only run a subset of tests:
|
|
93
110
|
```bash
|
|
94
|
-
npm run test -- <folder_path>
|
|
95
111
|
npm run test
|
|
96
112
|
```
|
|
113
|
+
*(Optionally, you may run `npm run test -- <folder_path>` first for rapid initial feedback during iterative development, but running `npm run test` for full test suite coverage is required before completing the task.)*
|
|
97
114
|
4. **Run presubmit checks**
|
|
98
115
|
Ensure that you commit or stage all changes before you run presubmit checks:
|
|
99
116
|
```bash
|
|
100
117
|
git cl presubmit -u
|
|
101
118
|
```
|
|
102
119
|
|
|
103
|
-
##
|
|
120
|
+
## 8. Summarize changes and upload the CL
|
|
104
121
|
|
|
105
122
|
When all tests and presubmit checks pass, commit your changes and upload the CL to Gerrit. Don’t use `[uxw]` as a prefix.
|
|
106
123
|
|
package/WATCHLISTS
CHANGED
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
'all': {
|
|
14
14
|
'filepath': '.',
|
|
15
15
|
},
|
|
16
|
-
'chromedriver': {
|
|
17
|
-
'filepath': 'front_end/emulated_devices/',
|
|
18
|
-
},
|
|
19
16
|
'lighthouse': {
|
|
20
17
|
'filepath': '[Ll]ighthouse',
|
|
21
18
|
},
|
|
@@ -26,7 +23,6 @@
|
|
|
26
23
|
|
|
27
24
|
'WATCHLISTS': {
|
|
28
25
|
'all': ['devtools-reviews+devtools@chromium.org'],
|
|
29
|
-
'chromedriver': [],
|
|
30
26
|
'lighthouse': ['lighthouse-eng+devtools-cl@google.com'],
|
|
31
27
|
'third_party': ['devtools-reviews+third_party@chromium.org'],
|
|
32
28
|
},
|
|
@@ -533,7 +533,11 @@ export class ParsedURL {
|
|
|
533
533
|
return 'data:' as Platform.DevToolsPath.UrlString;
|
|
534
534
|
}
|
|
535
535
|
const scheme = this.isBlobURL() ? this.blobInnerScheme : this.scheme;
|
|
536
|
-
|
|
536
|
+
const domain = this.domain();
|
|
537
|
+
if (!scheme && !domain) {
|
|
538
|
+
return '' as Platform.DevToolsPath.UrlString;
|
|
539
|
+
}
|
|
540
|
+
return scheme + '://' + domain as Platform.DevToolsPath.UrlString;
|
|
537
541
|
}
|
|
538
542
|
|
|
539
543
|
urlWithoutScheme(): string {
|
|
@@ -82,12 +82,34 @@ const str_ = i18n.i18n.registerUIStrings('core/common/SettingRegistration.ts', U
|
|
|
82
82
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
83
83
|
let registeredSettings: SettingRegistration[] = [];
|
|
84
84
|
const settingNameSet = new Set<string>();
|
|
85
|
+
const orderValuesBySettingCategory = new Map<SettingCategory, Set<number>>();
|
|
86
|
+
|
|
87
|
+
export function registerCategoryOrder(category?: SettingCategory, order?: number): void {
|
|
88
|
+
if (category && typeof order === 'number') {
|
|
89
|
+
let orderValues = orderValuesBySettingCategory.get(category);
|
|
90
|
+
if (!orderValues) {
|
|
91
|
+
orderValues = new Set();
|
|
92
|
+
orderValuesBySettingCategory.set(category, orderValues);
|
|
93
|
+
}
|
|
94
|
+
if (orderValues.has(order)) {
|
|
95
|
+
throw new Error(`Duplicate order value '${order}' for settings category '${category}'`);
|
|
96
|
+
}
|
|
97
|
+
orderValues.add(order);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function removeCategoryOrder(category?: SettingCategory, order?: number): void {
|
|
102
|
+
if (category && typeof order === 'number') {
|
|
103
|
+
orderValuesBySettingCategory.get(category)?.delete(order);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
85
106
|
|
|
86
107
|
export function registerSettingExtension(registration: SettingRegistration): void {
|
|
87
108
|
const settingName = registration.settingName;
|
|
88
109
|
if (settingNameSet.has(settingName)) {
|
|
89
110
|
throw new Error(`Duplicate setting name '${settingName}'`);
|
|
90
111
|
}
|
|
112
|
+
registerCategoryOrder(registration.category, registration.order);
|
|
91
113
|
settingNameSet.add(settingName);
|
|
92
114
|
registeredSettings.push(registration);
|
|
93
115
|
}
|
|
@@ -98,19 +120,17 @@ export function getRegisteredSettings(): SettingRegistration[] {
|
|
|
98
120
|
|
|
99
121
|
export function registerSettingsForTest(settings: SettingRegistration[], forceReset = false): void {
|
|
100
122
|
if (registeredSettings.length === 0 || forceReset) {
|
|
101
|
-
|
|
102
|
-
settingNameSet.clear();
|
|
123
|
+
resetSettings();
|
|
103
124
|
for (const setting of settings) {
|
|
104
|
-
|
|
105
|
-
if (settingNameSet.has(settingName)) {
|
|
106
|
-
throw new Error(`Duplicate setting name '${settingName}'`);
|
|
107
|
-
}
|
|
108
|
-
settingNameSet.add(settingName);
|
|
125
|
+
registerSettingExtension(setting);
|
|
109
126
|
}
|
|
110
127
|
}
|
|
111
128
|
}
|
|
112
129
|
|
|
113
130
|
export function resetSettings(): void {
|
|
131
|
+
for (const setting of registeredSettings) {
|
|
132
|
+
removeCategoryOrder(setting.category, setting.order);
|
|
133
|
+
}
|
|
114
134
|
registeredSettings = [];
|
|
115
135
|
settingNameSet.clear();
|
|
116
136
|
}
|
|
@@ -120,7 +140,8 @@ export function maybeRemoveSettingExtension(settingName: string): boolean {
|
|
|
120
140
|
if (settingIndex < 0 || !settingNameSet.delete(settingName)) {
|
|
121
141
|
return false;
|
|
122
142
|
}
|
|
123
|
-
registeredSettings.splice(settingIndex, 1);
|
|
143
|
+
const [removed] = registeredSettings.splice(settingIndex, 1);
|
|
144
|
+
removeCategoryOrder(removed.category, removed.order);
|
|
124
145
|
return true;
|
|
125
146
|
}
|
|
126
147
|
|
|
@@ -10,7 +10,6 @@ import type {EventDescriptor, EventTargetEvent, GenericEvents} from './EventTarg
|
|
|
10
10
|
import {ObjectWrapper} from './Object.js';
|
|
11
11
|
import {
|
|
12
12
|
getLocalizedSettingsCategory,
|
|
13
|
-
type LearnMore,
|
|
14
13
|
maybeRemoveSettingExtension,
|
|
15
14
|
type RegExpSettingItem,
|
|
16
15
|
registerSettingExtension,
|
|
@@ -112,7 +111,6 @@ export class Settings {
|
|
|
112
111
|
readonly #settingRegistrations: SettingRegistration[];
|
|
113
112
|
readonly #sessionStorage = new SettingsStorage({});
|
|
114
113
|
settingNameSet = new Set<string>();
|
|
115
|
-
orderValuesBySettingCategory = new Map<SettingCategory, Set<number>>();
|
|
116
114
|
#eventSupport = new ObjectWrapper<GenericEvents>();
|
|
117
115
|
#registry = new Map<string, Setting<unknown>>();
|
|
118
116
|
readonly moduleSettings = new Map<string, Setting<unknown>>();
|
|
@@ -215,19 +213,9 @@ export class Settings {
|
|
|
215
213
|
|
|
216
214
|
private registerModuleSetting(setting: Setting<unknown>): void {
|
|
217
215
|
const settingName = setting.name;
|
|
218
|
-
const category = setting.category();
|
|
219
|
-
const order = setting.order();
|
|
220
216
|
if (this.settingNameSet.has(settingName)) {
|
|
221
217
|
throw new Error(`Duplicate Setting name '${settingName}'`);
|
|
222
218
|
}
|
|
223
|
-
if (category && order) {
|
|
224
|
-
const orderValues = this.orderValuesBySettingCategory.get(category) || new Set();
|
|
225
|
-
if (orderValues.has(order)) {
|
|
226
|
-
throw new Error(`Duplicate order value '${order}' for settings category '${category}'`);
|
|
227
|
-
}
|
|
228
|
-
orderValues.add(order);
|
|
229
|
-
this.orderValuesBySettingCategory.set(category, orderValues);
|
|
230
|
-
}
|
|
231
219
|
this.settingNameSet.add(settingName);
|
|
232
220
|
this.moduleSettings.set(setting.name, setting);
|
|
233
221
|
}
|
|
@@ -529,13 +517,6 @@ export class Setting<V> {
|
|
|
529
517
|
this.eventSupport.removeEventListener(this.name, listener, thisObject);
|
|
530
518
|
}
|
|
531
519
|
|
|
532
|
-
title(): Platform.UIString.LocalizedString {
|
|
533
|
-
if (this.#registration?.title) {
|
|
534
|
-
return this.#registration.title();
|
|
535
|
-
}
|
|
536
|
-
return '' as Platform.UIString.LocalizedString;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
520
|
setRequiresUserAction(requiresUserAction: boolean): void {
|
|
540
521
|
this.#requiresUserAction = requiresUserAction;
|
|
541
522
|
}
|
|
@@ -635,57 +616,6 @@ export class Setting<V> {
|
|
|
635
616
|
return this.#type ?? this.#registration?.settingType ?? null;
|
|
636
617
|
}
|
|
637
618
|
|
|
638
|
-
options(): SimpleSettingOption[] {
|
|
639
|
-
if (this.#registration && this.#registration.options) {
|
|
640
|
-
return this.#registration.options.map(opt => {
|
|
641
|
-
const {value, title, text, raw} = opt;
|
|
642
|
-
return {
|
|
643
|
-
value,
|
|
644
|
-
title: title(),
|
|
645
|
-
text: typeof text === 'function' ? text() : text,
|
|
646
|
-
raw,
|
|
647
|
-
};
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
return [];
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
reloadRequired(): boolean|null {
|
|
654
|
-
if (this.#registration) {
|
|
655
|
-
return this.#registration.reloadRequired || null;
|
|
656
|
-
}
|
|
657
|
-
return null;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
category(): SettingCategory|null {
|
|
661
|
-
if (this.#registration) {
|
|
662
|
-
return this.#registration.category || null;
|
|
663
|
-
}
|
|
664
|
-
return null;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
tags(): string|null {
|
|
668
|
-
if (this.#registration && this.#registration.tags) {
|
|
669
|
-
// Get localized keys and separate by null character to prevent fuzzy matching from matching across them.
|
|
670
|
-
return this.#registration.tags.map(tag => tag()).join('\0');
|
|
671
|
-
}
|
|
672
|
-
return null;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
order(): number|null {
|
|
676
|
-
if (this.#registration) {
|
|
677
|
-
return this.#registration.order || null;
|
|
678
|
-
}
|
|
679
|
-
return null;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* See {@link LearnMore} for more info
|
|
684
|
-
*/
|
|
685
|
-
learnMore(): LearnMore|null {
|
|
686
|
-
return this.#registration?.learnMore ?? null;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
619
|
private printSettingsSavingError(message: string, value: string): void {
|
|
690
620
|
const errorMessage =
|
|
691
621
|
'Error saving setting with name: ' + this.name + ', value length: ' + value.length + '. Error: ' + message;
|
|
@@ -777,10 +707,3 @@ export {
|
|
|
777
707
|
SettingRegistration,
|
|
778
708
|
SettingType,
|
|
779
709
|
};
|
|
780
|
-
|
|
781
|
-
export interface SimpleSettingOption {
|
|
782
|
-
value: string|boolean;
|
|
783
|
-
title: string;
|
|
784
|
-
text?: string;
|
|
785
|
-
raw?: boolean;
|
|
786
|
-
}
|
|
@@ -484,10 +484,6 @@ interface GdpProfilesAvailability {
|
|
|
484
484
|
enterprisePolicyValue: GdpProfilesEnterprisePolicyValue;
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
interface LiveEdit {
|
|
488
|
-
enabled: boolean;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
487
|
interface ExtensionsOnChromeUrls {
|
|
492
488
|
enabled: boolean;
|
|
493
489
|
}
|
|
@@ -540,6 +536,9 @@ interface DevToolsPlusButton {
|
|
|
540
536
|
interface DevToolsInstrumentationBreakpoints {
|
|
541
537
|
enabled: boolean;
|
|
542
538
|
}
|
|
539
|
+
interface HostConfigDevToolsComments {
|
|
540
|
+
enabled: boolean;
|
|
541
|
+
}
|
|
543
542
|
|
|
544
543
|
/**
|
|
545
544
|
* The host configuration that we expect from the DevTools back-end.
|
|
@@ -585,7 +584,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
|
585
584
|
devToolsGlobalAiButton: GlobalAiButton,
|
|
586
585
|
devToolsGdpProfiles: GdpProfiles,
|
|
587
586
|
devToolsGdpProfilesAvailability: GdpProfilesAvailability,
|
|
588
|
-
devToolsLiveEdit: LiveEdit,
|
|
589
587
|
devToolsFlexibleLayout: DevToolsFlexibleLayout,
|
|
590
588
|
deviceBoundSessionsDebugging: DeviceBoundSessionsDebugging,
|
|
591
589
|
devToolsEnableDurableMessages: DevToolsEnableDurableMessages,
|
|
@@ -599,6 +597,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
|
599
597
|
devToolsPlusButton: DevToolsPlusButton,
|
|
600
598
|
devToolsInstrumentationBreakpoints: DevToolsInstrumentationBreakpoints,
|
|
601
599
|
extensionsOnChromeUrls: ExtensionsOnChromeUrls,
|
|
600
|
+
devToolsComments: HostConfigDevToolsComments,
|
|
602
601
|
}>;
|
|
603
602
|
|
|
604
603
|
/**
|
|
@@ -64,9 +64,6 @@ export class CSSMetadata {
|
|
|
64
64
|
if (Boolean(runtimeFlagStatus) && runtimeFlagStatus !== 'stable') {
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
|
-
if (!CSS.supports(propertyName, 'initial')) {
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
67
|
this.#values.push(propertyName);
|
|
71
68
|
|
|
72
69
|
if (property.inherited) {
|
|
@@ -113,7 +110,7 @@ export class CSSMetadata {
|
|
|
113
110
|
for (const propertyName of this.#longhands.keys()) {
|
|
114
111
|
// skip "all" because it is a CSS-wide keyword
|
|
115
112
|
// skip shorthands that are defined in generatedPropertyValues because they have their own value sets
|
|
116
|
-
if (propertyName === 'all' ||
|
|
113
|
+
if (propertyName === 'all' || propertyName in SupportedCSSProperties.generatedPropertyValues) {
|
|
117
114
|
continue;
|
|
118
115
|
}
|
|
119
116
|
const longhands = this.#longhands.get(propertyName);
|
|
@@ -121,6 +118,10 @@ export class CSSMetadata {
|
|
|
121
118
|
continue;
|
|
122
119
|
}
|
|
123
120
|
const values = new Array<string>();
|
|
121
|
+
const propertyValueSet = propertyValueSets.get(propertyName);
|
|
122
|
+
if (propertyValueSet) {
|
|
123
|
+
values.push(...propertyValueSet);
|
|
124
|
+
}
|
|
124
125
|
for (const longhand of longhands) {
|
|
125
126
|
const longhandValues = propertyValueSets.get(longhand);
|
|
126
127
|
if (!longhandValues) {
|
|
@@ -143,11 +144,6 @@ export class CSSMetadata {
|
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
for (const commonKeyword of CommonKeywords) {
|
|
147
|
-
if (!values.has(commonKeyword) && CSS.supports(propertyName, commonKeyword)) {
|
|
148
|
-
values.add(commonKeyword);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
147
|
|
|
152
148
|
this.#propertyValues.set(propertyName, [...values]);
|
|
153
149
|
}
|
|
@@ -156,42 +156,22 @@ export class VariableNameMatcher extends matcherBase(VariableNameMatch) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
override matches(node: CodeMirror.SyntaxNode, matching: BottomUpTreeMatching): VariableNameMatch|null {
|
|
159
|
-
if (node.
|
|
160
|
-
// TODO(b/484268589): The result shouldn't be KeywordQuery, but currently
|
|
161
|
-
// sometimes Lezer parses it that way. Fix this when Lezer is fixed.
|
|
159
|
+
if (!node.parent) {
|
|
162
160
|
return null;
|
|
163
161
|
}
|
|
164
|
-
|
|
165
|
-
if (
|
|
162
|
+
// TODO(b/484268589): When the misspelling is removed from Lezer we can remove that case.
|
|
163
|
+
if (node.name !== 'FeatureName' && node.name !== 'PropertyName' && node.name !== 'ProperyName') {
|
|
166
164
|
return null;
|
|
167
165
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
let foundStyleCall: CodeMirror.SyntaxNode|null = null;
|
|
171
|
-
while (cur) {
|
|
172
|
-
if (cur.name === 'CallExpression') {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
if (cur.name === 'CallQuery') {
|
|
176
|
-
const callee = cur.getChild('QueryCallee');
|
|
177
|
-
if (callee && matching.ast.text(callee) === 'style') {
|
|
178
|
-
foundStyleCall = cur;
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
cur = cur.parent;
|
|
166
|
+
if (node.parent.name !== 'StyleFeature' && node.parent.name !== 'StyleRange') {
|
|
167
|
+
return null;
|
|
184
168
|
}
|
|
185
|
-
|
|
186
|
-
if (!
|
|
169
|
+
const rawText = matching.ast.text(node);
|
|
170
|
+
if (!rawText.startsWith('--')) {
|
|
187
171
|
return null;
|
|
188
172
|
}
|
|
189
173
|
|
|
190
|
-
|
|
191
|
-
// includes the > in the token with --foo. We need to strip it.
|
|
192
|
-
const text = node.name === 'KeywordQuery' ? rawText.split(/\s|[>!=<:]/)[0] : rawText;
|
|
193
|
-
|
|
194
|
-
return new VariableNameMatch(node, text, this.matchedStyles, this.style);
|
|
174
|
+
return new VariableNameMatch(node, rawText, this.matchedStyles, this.style);
|
|
195
175
|
}
|
|
196
176
|
}
|
|
197
177
|
|
|
@@ -137,6 +137,12 @@ export const WASM_SYMBOLS_PRIORITY = [
|
|
|
137
137
|
Protocol.Debugger.DebugSymbolsType.SourceMap,
|
|
138
138
|
];
|
|
139
139
|
|
|
140
|
+
export const skipAllPausesSettingDescriptor: Common.Settings.SettingDescriptor<boolean> = {
|
|
141
|
+
name: 'skip-all-pauses',
|
|
142
|
+
type: Common.Settings.SettingType.BOOLEAN,
|
|
143
|
+
defaultValue: false,
|
|
144
|
+
};
|
|
145
|
+
|
|
140
146
|
export class DebuggerModel extends SDKModel<EventTypes> {
|
|
141
147
|
readonly agent: ProtocolProxyApi.DebuggerApi;
|
|
142
148
|
#runtimeModel: RuntimeModel;
|
|
@@ -149,6 +155,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
149
155
|
#selectedCallFrame: CallFrame|null = null;
|
|
150
156
|
#debuggerEnabled = false;
|
|
151
157
|
#debuggerId: string|null = null;
|
|
158
|
+
readonly #skipAllPausesSetting: Common.Settings.Setting<boolean>;
|
|
152
159
|
#skipAllPausesTimeout?: ReturnType<typeof setTimeout>;
|
|
153
160
|
#beforePausedCallback: ((arg0: DebuggerPausedDetails, stepOver: Location|null) => Promise<boolean>)|null = null;
|
|
154
161
|
#computeAutoStepRangesCallback: ((arg0: StepMode, arg1: CallFrame) => Promise<Array<{
|
|
@@ -179,10 +186,12 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
179
186
|
compiledURL, sourceMappingURL, payload, target.targetManager().getConsole(), script));
|
|
180
187
|
|
|
181
188
|
const settings = this.target().targetManager().settings;
|
|
189
|
+
this.#skipAllPausesSetting = settings.resolve(skipAllPausesSettingDescriptor);
|
|
182
190
|
settings.resolve(pauseOnExceptionEnabledSettingDescriptor)
|
|
183
191
|
.addChangeListener(this.pauseOnExceptionStateChanged, this);
|
|
184
192
|
settings.resolve(pauseOnCaughtExceptionSettingDescriptor)
|
|
185
193
|
.addChangeListener(this.pauseOnExceptionStateChanged, this);
|
|
194
|
+
this.#skipAllPausesSetting.addChangeListener(this.skipAllPausesChanged, this);
|
|
186
195
|
settings.moduleSetting('pause-on-uncaught-exception').addChangeListener(this.pauseOnExceptionStateChanged, this);
|
|
187
196
|
settings.moduleSetting('disable-async-stack-traces').addChangeListener(this.asyncStackTracesStateChanged, this);
|
|
188
197
|
settings.moduleSetting('breakpoints-active').addChangeListener(this.breakpointsActiveChanged, this);
|
|
@@ -256,6 +265,11 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
256
265
|
}
|
|
257
266
|
this.#debuggerEnabled = true;
|
|
258
267
|
|
|
268
|
+
let skipAllPausesPromise: Promise<Protocol.ProtocolResponseWithError>|undefined;
|
|
269
|
+
if (this.#skipAllPausesSetting.get()) {
|
|
270
|
+
skipAllPausesPromise = this.agent.invoke_setSkipAllPauses({skip: true});
|
|
271
|
+
}
|
|
272
|
+
|
|
259
273
|
// Set a limit for the total size of collected script sources retained by debugger.
|
|
260
274
|
// 10MB for remote frontends, 100MB for others.
|
|
261
275
|
const isRemoteFrontend = Root.Runtime.Runtime.queryParam('remoteFrontend') || Root.Runtime.Runtime.queryParam('ws');
|
|
@@ -267,14 +281,14 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
267
281
|
instrumentation: Protocol.Debugger.SetInstrumentationBreakpointRequestInstrumentation.BeforeScriptExecution,
|
|
268
282
|
});
|
|
269
283
|
}
|
|
284
|
+
const settings = this.target().targetManager().settings;
|
|
270
285
|
this.pauseOnExceptionStateChanged();
|
|
271
286
|
void this.asyncStackTracesStateChanged();
|
|
272
|
-
const settings = this.target().targetManager().settings;
|
|
273
287
|
if (!settings.moduleSetting('breakpoints-active').get()) {
|
|
274
288
|
this.breakpointsActiveChanged();
|
|
275
289
|
}
|
|
276
290
|
this.dispatchEventToListeners(Events.DebuggerWasEnabled, this);
|
|
277
|
-
const [enableResult] = await Promise.all([enablePromise, instrumentationPromise]);
|
|
291
|
+
const [enableResult] = await Promise.all([enablePromise, instrumentationPromise, skipAllPausesPromise]);
|
|
278
292
|
this.registerDebugger(enableResult);
|
|
279
293
|
}
|
|
280
294
|
|
|
@@ -344,12 +358,24 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
344
358
|
}
|
|
345
359
|
|
|
346
360
|
private skipAllPauses(skip: boolean): void {
|
|
361
|
+
if (this.#skipAllPausesSetting.get()) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
347
364
|
clearTimeout(this.#skipAllPausesTimeout);
|
|
348
365
|
|
|
349
366
|
void this.agent.invoke_setSkipAllPauses({skip});
|
|
350
367
|
}
|
|
351
368
|
|
|
369
|
+
private skipAllPausesChanged(): void {
|
|
370
|
+
const skip = this.#skipAllPausesSetting.get();
|
|
371
|
+
clearTimeout(this.#skipAllPausesTimeout);
|
|
372
|
+
void this.agent.invoke_setSkipAllPauses({skip});
|
|
373
|
+
}
|
|
374
|
+
|
|
352
375
|
skipAllPausesUntilReloadOrTimeout(timeout: number): void {
|
|
376
|
+
if (this.#skipAllPausesSetting.get()) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
353
379
|
clearTimeout(this.#skipAllPausesTimeout);
|
|
354
380
|
|
|
355
381
|
void this.agent.invoke_setSkipAllPauses({skip: true});
|
|
@@ -649,16 +675,16 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
649
675
|
this.dispatchEventToListeners(Events.DebuggerResumed, this);
|
|
650
676
|
}
|
|
651
677
|
|
|
652
|
-
parsedScriptSource(
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
678
|
+
parsedScriptSource(scriptId: Protocol.Runtime.ScriptId, sourceURL: Platform.DevToolsPath.UrlString, startLine: number,
|
|
679
|
+
startColumn: number, endLine: number, endColumn: number,
|
|
680
|
+
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
681
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
682
|
+
executionContextId: number, hash: string, executionContextAuxData: any,
|
|
683
|
+
sourceMapURL: string|undefined, hasSourceURLComment: boolean, hasSyntaxError: boolean,
|
|
684
|
+
length: number, isModule: boolean|null, originStackTrace: Protocol.Runtime.StackTrace|null,
|
|
685
|
+
codeOffset: number|null, scriptLanguage: string|null,
|
|
686
|
+
debugSymbols: Protocol.Debugger.DebugSymbols[]|null,
|
|
687
|
+
embedderName: Platform.DevToolsPath.UrlString|null, buildId: string|null): Script {
|
|
662
688
|
const knownScript = this.#scripts.get(scriptId);
|
|
663
689
|
if (knownScript) {
|
|
664
690
|
return knownScript;
|
|
@@ -670,10 +696,9 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
670
696
|
|
|
671
697
|
const selectedDebugSymbol =
|
|
672
698
|
DebuggerModel.selectSymbolSource(debugSymbols, this.target().targetManager().getConsole());
|
|
673
|
-
const script = new Script(
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
scriptLanguage, selectedDebugSymbol, embedderName, buildId);
|
|
699
|
+
const script = new Script(this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId,
|
|
700
|
+
hash, isContentScript, sourceMapURL, hasSourceURLComment, length, isModule,
|
|
701
|
+
originStackTrace, codeOffset, scriptLanguage, selectedDebugSymbol, embedderName, buildId);
|
|
677
702
|
this.registerScript(script);
|
|
678
703
|
this.dispatchEventToListeners(Events.ParsedScriptSource, script);
|
|
679
704
|
|
|
@@ -878,6 +903,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
878
903
|
.removeChangeListener(this.pauseOnExceptionStateChanged, this);
|
|
879
904
|
settings.resolve(pauseOnCaughtExceptionSettingDescriptor)
|
|
880
905
|
.removeChangeListener(this.pauseOnExceptionStateChanged, this);
|
|
906
|
+
this.#skipAllPausesSetting.removeChangeListener(this.skipAllPausesChanged, this);
|
|
881
907
|
settings.moduleSetting('disable-async-stack-traces').removeChangeListener(this.asyncStackTracesStateChanged, this);
|
|
882
908
|
}
|
|
883
909
|
|
|
@@ -972,7 +998,6 @@ export enum Events {
|
|
|
972
998
|
GlobalObjectCleared = 'GlobalObjectCleared',
|
|
973
999
|
CallFrameSelected = 'CallFrameSelected',
|
|
974
1000
|
DebuggerIsReadyToPause = 'DebuggerIsReadyToPause',
|
|
975
|
-
ScriptSourceWasEdited = 'ScriptSourceWasEdited',
|
|
976
1001
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
977
1002
|
}
|
|
978
1003
|
|
|
@@ -987,10 +1012,6 @@ export interface EventTypes {
|
|
|
987
1012
|
[Events.CallFrameSelected]: DebuggerModel;
|
|
988
1013
|
[Events.DebuggerIsReadyToPause]: DebuggerModel;
|
|
989
1014
|
[Events.DebugInfoAttached]: Script;
|
|
990
|
-
[Events.ScriptSourceWasEdited]: {
|
|
991
|
-
script: Script,
|
|
992
|
-
status: Protocol.Debugger.SetScriptSourceResponseStatus,
|
|
993
|
-
};
|
|
994
1015
|
}
|
|
995
1016
|
|
|
996
1017
|
class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
|
|
@@ -1026,7 +1047,6 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
|
|
|
1026
1047
|
executionContextId,
|
|
1027
1048
|
hash,
|
|
1028
1049
|
executionContextAuxData,
|
|
1029
|
-
isLiveEdit,
|
|
1030
1050
|
sourceMapURL,
|
|
1031
1051
|
hasSourceURL,
|
|
1032
1052
|
length,
|
|
@@ -1043,9 +1063,9 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
|
|
|
1043
1063
|
}
|
|
1044
1064
|
this.#debuggerModel.parsedScriptSource(
|
|
1045
1065
|
scriptId, url as Platform.DevToolsPath.UrlString, startLine, startColumn, endLine, endColumn,
|
|
1046
|
-
executionContextId, hash, executionContextAuxData,
|
|
1047
|
-
|
|
1048
|
-
|
|
1066
|
+
executionContextId, hash, executionContextAuxData, sourceMapURL, Boolean(hasSourceURL), false, length || 0,
|
|
1067
|
+
isModule || null, stackTrace || null, codeOffset || null, scriptLanguage || null, debugSymbols || null,
|
|
1068
|
+
embedderName as Platform.DevToolsPath.UrlString || null, buildId || null);
|
|
1049
1069
|
}
|
|
1050
1070
|
|
|
1051
1071
|
scriptFailedToParse({
|
|
@@ -1071,11 +1091,11 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
|
|
|
1071
1091
|
if (!this.#debuggerModel.debuggerEnabled()) {
|
|
1072
1092
|
return;
|
|
1073
1093
|
}
|
|
1074
|
-
this.#debuggerModel.parsedScriptSource(
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1094
|
+
this.#debuggerModel.parsedScriptSource(scriptId, url as Platform.DevToolsPath.UrlString, startLine, startColumn,
|
|
1095
|
+
endLine, endColumn, executionContextId, hash, executionContextAuxData,
|
|
1096
|
+
sourceMapURL, Boolean(hasSourceURL), true, length || 0, isModule || null,
|
|
1097
|
+
stackTrace || null, codeOffset || null, scriptLanguage || null, null,
|
|
1098
|
+
embedderName as Platform.DevToolsPath.UrlString || null, buildId || null);
|
|
1079
1099
|
}
|
|
1080
1100
|
|
|
1081
1101
|
breakpointResolved({breakpointId, location}: Protocol.Debugger.BreakpointResolvedEvent): void {
|