chrome-devtools-frontend 1.0.1548980 → 1.0.1549484
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/docs/contributing/settings-experiments-features.md +35 -0
- package/docs/styleguide/ux/patterns.md +27 -0
- package/eslint.config.mjs +1 -0
- package/front_end/Tests.js +2 -0
- package/front_end/core/host/InspectorFrontendHost.ts +26 -558
- package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
- package/front_end/core/host/ResourceLoader.ts +9 -23
- package/front_end/core/host/UserMetrics.ts +4 -4
- package/front_end/core/root/DevToolsContext.ts +4 -0
- package/front_end/core/root/Runtime.ts +10 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
- package/front_end/core/sdk/CSSModel.ts +24 -24
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +2 -2
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +29 -31
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/OverlayModel.ts +2 -2
- package/front_end/core/sdk/PageResourceLoader.ts +63 -37
- package/front_end/core/sdk/SourceMap.ts +6 -0
- package/front_end/core/sdk/SourceMapCache.ts +21 -0
- package/front_end/core/sdk/SourceMapManager.ts +7 -6
- package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
- package/front_end/core/sdk/TargetManager.ts +14 -2
- package/front_end/core/sdk/sdk-meta.ts +13 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +13 -3
- package/front_end/foundation/Universe.ts +1 -1
- package/front_end/generated/Deprecation.ts +18 -4
- package/front_end/generated/InspectorBackendCommands.ts +33 -31
- package/front_end/generated/SupportedCSSProperties.js +41 -41
- package/front_end/generated/protocol-mapping.d.ts +12 -0
- package/front_end/generated/protocol-proxy-api.d.ts +11 -0
- package/front_end/generated/protocol.ts +70 -35
- package/front_end/models/ai_assistance/AiConversation.ts +5 -4
- package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
- package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
- package/front_end/models/bindings/ResourceMapping.ts +73 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
- package/front_end/models/issues_manager/GenericIssue.ts +17 -0
- package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +7 -3
- package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
- package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +51 -44
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
- package/front_end/panels/application/AppManifestView.ts +3 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -6
- package/front_end/panels/application/ServiceWorkersView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -6
- package/front_end/panels/application/components/PermissionsPolicySection.ts +201 -157
- package/front_end/panels/application/components/ProtocolHandlersView.ts +117 -80
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
- package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
- package/front_end/panels/application/components/TrustTokensView.ts +76 -68
- package/front_end/panels/console/ConsoleView.ts +3 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +6 -4
- package/front_end/panels/console/console-meta.ts +0 -13
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
- package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +16 -13
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -1
- package/front_end/panels/elements/LayoutPane.ts +12 -10
- package/front_end/panels/elements/StylePropertyTreeElement.ts +12 -12
- package/front_end/panels/elements/components/AdornerManager.ts +3 -3
- package/front_end/panels/elements/components/StylePropertyEditor.ts +6 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +27 -49
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
- package/front_end/panels/media/PlayerListView.ts +100 -73
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
- package/front_end/panels/network/resourceChunkView.css +4 -0
- package/front_end/panels/security/CookieControlsView.ts +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +6 -6
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -2
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +13 -5
- package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -2
- package/front_end/panels/sources/NavigatorView.ts +2 -2
- package/front_end/panels/sources/OpenFileQuickOpen.ts +7 -8
- package/front_end/panels/sources/OutlineQuickOpen.ts +6 -3
- package/front_end/panels/sources/ProfilePlugin.ts +21 -12
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
- package/front_end/panels/timeline/TimelinePanel.ts +17 -18
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
- package/front_end/panels/utils/utils.ts +17 -3
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
- package/front_end/panels/whats_new/resources/WNDT.md +8 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
- package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
- package/front_end/ui/components/annotations/annotations.ts +6 -0
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
- package/front_end/ui/components/diff_view/DiffView.ts +1 -1
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +1 -0
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
- package/front_end/ui/components/highlighting/highlighting.ts +7 -0
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/icon_button/Icon.ts +4 -2
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/list/List.ts +184 -0
- package/front_end/ui/components/list/list.css +90 -0
- package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/SelectMenu.ts +1 -1
- package/front_end/ui/components/node_text/NodeText.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/kit/kit.ts +5 -0
- package/front_end/ui/legacy/TabbedPane.ts +98 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -184
- package/front_end/ui/legacy/ViewManager.ts +23 -8
- package/front_end/ui/legacy/ViewRegistration.ts +21 -22
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +12 -13
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +7 -16
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +5 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
- package/front_end/ui/legacy/tabbedPane.css +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/inspector_overlay/README.md +3 -3
- package/mcp/HostBindings.ts +310 -0
- package/mcp/mcp.ts +17 -0
- package/mcp/tsconfig.json +6 -1
- package/package.json +26 -24
- /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
- /package/front_end/ui/{components → kit}/cards/card.css +0 -0
|
@@ -2589,8 +2589,6 @@ export namespace Browser {
|
|
|
2589
2589
|
*/
|
|
2590
2590
|
export namespace CSS {
|
|
2591
2591
|
|
|
2592
|
-
export type StyleSheetId = OpaqueIdentifier<string, 'Protocol.CSS.StyleSheetId'>;
|
|
2593
|
-
|
|
2594
2592
|
/**
|
|
2595
2593
|
* Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent
|
|
2596
2594
|
* stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via
|
|
@@ -2746,7 +2744,7 @@ export namespace CSS {
|
|
|
2746
2744
|
/**
|
|
2747
2745
|
* The stylesheet identifier.
|
|
2748
2746
|
*/
|
|
2749
|
-
styleSheetId: StyleSheetId;
|
|
2747
|
+
styleSheetId: DOM.StyleSheetId;
|
|
2750
2748
|
/**
|
|
2751
2749
|
* Owner frame identifier.
|
|
2752
2750
|
*/
|
|
@@ -2832,7 +2830,7 @@ export namespace CSS {
|
|
|
2832
2830
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
2833
2831
|
* stylesheet rules) this rule came from.
|
|
2834
2832
|
*/
|
|
2835
|
-
styleSheetId?: StyleSheetId;
|
|
2833
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
2836
2834
|
/**
|
|
2837
2835
|
* Rule selector data.
|
|
2838
2836
|
*/
|
|
@@ -2911,7 +2909,7 @@ export namespace CSS {
|
|
|
2911
2909
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
2912
2910
|
* stylesheet rules) this rule came from.
|
|
2913
2911
|
*/
|
|
2914
|
-
styleSheetId: StyleSheetId;
|
|
2912
|
+
styleSheetId: DOM.StyleSheetId;
|
|
2915
2913
|
/**
|
|
2916
2914
|
* Offset of the start of the rule (including selector) from the beginning of the stylesheet.
|
|
2917
2915
|
*/
|
|
@@ -2991,7 +2989,7 @@ export namespace CSS {
|
|
|
2991
2989
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
2992
2990
|
* stylesheet rules) this rule came from.
|
|
2993
2991
|
*/
|
|
2994
|
-
styleSheetId?: StyleSheetId;
|
|
2992
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
2995
2993
|
/**
|
|
2996
2994
|
* CSS properties in the style.
|
|
2997
2995
|
*/
|
|
@@ -3087,7 +3085,7 @@ export namespace CSS {
|
|
|
3087
3085
|
/**
|
|
3088
3086
|
* Identifier of the stylesheet containing this object (if exists).
|
|
3089
3087
|
*/
|
|
3090
|
-
styleSheetId?: StyleSheetId;
|
|
3088
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3091
3089
|
/**
|
|
3092
3090
|
* Array of media queries.
|
|
3093
3091
|
*/
|
|
@@ -3150,7 +3148,7 @@ export namespace CSS {
|
|
|
3150
3148
|
/**
|
|
3151
3149
|
* Identifier of the stylesheet containing this object (if exists).
|
|
3152
3150
|
*/
|
|
3153
|
-
styleSheetId?: StyleSheetId;
|
|
3151
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3154
3152
|
/**
|
|
3155
3153
|
* Optional name for the container.
|
|
3156
3154
|
*/
|
|
@@ -3193,7 +3191,7 @@ export namespace CSS {
|
|
|
3193
3191
|
/**
|
|
3194
3192
|
* Identifier of the stylesheet containing this object (if exists).
|
|
3195
3193
|
*/
|
|
3196
|
-
styleSheetId?: StyleSheetId;
|
|
3194
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3197
3195
|
}
|
|
3198
3196
|
|
|
3199
3197
|
/**
|
|
@@ -3212,7 +3210,7 @@ export namespace CSS {
|
|
|
3212
3210
|
/**
|
|
3213
3211
|
* Identifier of the stylesheet containing this object (if exists).
|
|
3214
3212
|
*/
|
|
3215
|
-
styleSheetId?: StyleSheetId;
|
|
3213
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3216
3214
|
}
|
|
3217
3215
|
|
|
3218
3216
|
/**
|
|
@@ -3231,7 +3229,7 @@ export namespace CSS {
|
|
|
3231
3229
|
/**
|
|
3232
3230
|
* Identifier of the stylesheet containing this object (if exists).
|
|
3233
3231
|
*/
|
|
3234
|
-
styleSheetId?: StyleSheetId;
|
|
3232
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3235
3233
|
}
|
|
3236
3234
|
|
|
3237
3235
|
/**
|
|
@@ -3246,7 +3244,7 @@ export namespace CSS {
|
|
|
3246
3244
|
/**
|
|
3247
3245
|
* Identifier of the stylesheet containing this object (if exists).
|
|
3248
3246
|
*/
|
|
3249
|
-
styleSheetId?: StyleSheetId;
|
|
3247
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3250
3248
|
}
|
|
3251
3249
|
|
|
3252
3250
|
/**
|
|
@@ -3371,7 +3369,7 @@ export namespace CSS {
|
|
|
3371
3369
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
3372
3370
|
* stylesheet rules) this rule came from.
|
|
3373
3371
|
*/
|
|
3374
|
-
styleSheetId?: StyleSheetId;
|
|
3372
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3375
3373
|
/**
|
|
3376
3374
|
* Parent stylesheet's origin.
|
|
3377
3375
|
*/
|
|
@@ -3394,7 +3392,7 @@ export namespace CSS {
|
|
|
3394
3392
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
3395
3393
|
* stylesheet rules) this rule came from.
|
|
3396
3394
|
*/
|
|
3397
|
-
styleSheetId?: StyleSheetId;
|
|
3395
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3398
3396
|
/**
|
|
3399
3397
|
* Parent stylesheet's origin.
|
|
3400
3398
|
*/
|
|
@@ -3466,7 +3464,7 @@ export namespace CSS {
|
|
|
3466
3464
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
3467
3465
|
* stylesheet rules) this rule came from.
|
|
3468
3466
|
*/
|
|
3469
|
-
styleSheetId?: StyleSheetId;
|
|
3467
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3470
3468
|
/**
|
|
3471
3469
|
* Parent stylesheet's origin.
|
|
3472
3470
|
*/
|
|
@@ -3485,7 +3483,7 @@ export namespace CSS {
|
|
|
3485
3483
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
3486
3484
|
* stylesheet rules) this rule came from.
|
|
3487
3485
|
*/
|
|
3488
|
-
styleSheetId?: StyleSheetId;
|
|
3486
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3489
3487
|
/**
|
|
3490
3488
|
* Parent stylesheet's origin.
|
|
3491
3489
|
*/
|
|
@@ -3566,7 +3564,7 @@ export namespace CSS {
|
|
|
3566
3564
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
3567
3565
|
* stylesheet rules) this rule came from.
|
|
3568
3566
|
*/
|
|
3569
|
-
styleSheetId?: StyleSheetId;
|
|
3567
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3570
3568
|
/**
|
|
3571
3569
|
* Parent stylesheet's origin.
|
|
3572
3570
|
*/
|
|
@@ -3589,7 +3587,7 @@ export namespace CSS {
|
|
|
3589
3587
|
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
3590
3588
|
* stylesheet rules) this rule came from.
|
|
3591
3589
|
*/
|
|
3592
|
-
styleSheetId?: StyleSheetId;
|
|
3590
|
+
styleSheetId?: DOM.StyleSheetId;
|
|
3593
3591
|
/**
|
|
3594
3592
|
* Parent stylesheet's origin.
|
|
3595
3593
|
*/
|
|
@@ -3611,7 +3609,7 @@ export namespace CSS {
|
|
|
3611
3609
|
/**
|
|
3612
3610
|
* The css style sheet identifier.
|
|
3613
3611
|
*/
|
|
3614
|
-
styleSheetId: StyleSheetId;
|
|
3612
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3615
3613
|
/**
|
|
3616
3614
|
* The range of the style text in the enclosing stylesheet.
|
|
3617
3615
|
*/
|
|
@@ -3626,7 +3624,7 @@ export namespace CSS {
|
|
|
3626
3624
|
/**
|
|
3627
3625
|
* The css style sheet identifier where a new rule should be inserted.
|
|
3628
3626
|
*/
|
|
3629
|
-
styleSheetId: StyleSheetId;
|
|
3627
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3630
3628
|
/**
|
|
3631
3629
|
* The text of a new rule.
|
|
3632
3630
|
*/
|
|
@@ -3651,7 +3649,7 @@ export namespace CSS {
|
|
|
3651
3649
|
}
|
|
3652
3650
|
|
|
3653
3651
|
export interface CollectClassNamesRequest {
|
|
3654
|
-
styleSheetId: StyleSheetId;
|
|
3652
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3655
3653
|
}
|
|
3656
3654
|
|
|
3657
3655
|
export interface CollectClassNamesResponse extends ProtocolResponseWithError {
|
|
@@ -3679,7 +3677,7 @@ export namespace CSS {
|
|
|
3679
3677
|
/**
|
|
3680
3678
|
* Identifier of the created "via-inspector" stylesheet.
|
|
3681
3679
|
*/
|
|
3682
|
-
styleSheetId: StyleSheetId;
|
|
3680
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3683
3681
|
}
|
|
3684
3682
|
|
|
3685
3683
|
export interface ForcePseudoStateRequest {
|
|
@@ -3903,7 +3901,7 @@ export namespace CSS {
|
|
|
3903
3901
|
}
|
|
3904
3902
|
|
|
3905
3903
|
export interface GetStyleSheetTextRequest {
|
|
3906
|
-
styleSheetId: StyleSheetId;
|
|
3904
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3907
3905
|
}
|
|
3908
3906
|
|
|
3909
3907
|
export interface GetStyleSheetTextResponse extends ProtocolResponseWithError {
|
|
@@ -3922,7 +3920,7 @@ export namespace CSS {
|
|
|
3922
3920
|
}
|
|
3923
3921
|
|
|
3924
3922
|
export interface GetLocationForSelectorRequest {
|
|
3925
|
-
styleSheetId: StyleSheetId;
|
|
3923
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3926
3924
|
selectorText: string;
|
|
3927
3925
|
}
|
|
3928
3926
|
|
|
@@ -3955,7 +3953,7 @@ export namespace CSS {
|
|
|
3955
3953
|
}
|
|
3956
3954
|
|
|
3957
3955
|
export interface SetPropertyRulePropertyNameRequest {
|
|
3958
|
-
styleSheetId: StyleSheetId;
|
|
3956
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3959
3957
|
range: SourceRange;
|
|
3960
3958
|
propertyName: string;
|
|
3961
3959
|
}
|
|
@@ -3968,7 +3966,7 @@ export namespace CSS {
|
|
|
3968
3966
|
}
|
|
3969
3967
|
|
|
3970
3968
|
export interface SetKeyframeKeyRequest {
|
|
3971
|
-
styleSheetId: StyleSheetId;
|
|
3969
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3972
3970
|
range: SourceRange;
|
|
3973
3971
|
keyText: string;
|
|
3974
3972
|
}
|
|
@@ -3981,7 +3979,7 @@ export namespace CSS {
|
|
|
3981
3979
|
}
|
|
3982
3980
|
|
|
3983
3981
|
export interface SetMediaTextRequest {
|
|
3984
|
-
styleSheetId: StyleSheetId;
|
|
3982
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3985
3983
|
range: SourceRange;
|
|
3986
3984
|
text: string;
|
|
3987
3985
|
}
|
|
@@ -3994,7 +3992,7 @@ export namespace CSS {
|
|
|
3994
3992
|
}
|
|
3995
3993
|
|
|
3996
3994
|
export interface SetContainerQueryTextRequest {
|
|
3997
|
-
styleSheetId: StyleSheetId;
|
|
3995
|
+
styleSheetId: DOM.StyleSheetId;
|
|
3998
3996
|
range: SourceRange;
|
|
3999
3997
|
text: string;
|
|
4000
3998
|
}
|
|
@@ -4007,7 +4005,7 @@ export namespace CSS {
|
|
|
4007
4005
|
}
|
|
4008
4006
|
|
|
4009
4007
|
export interface SetSupportsTextRequest {
|
|
4010
|
-
styleSheetId: StyleSheetId;
|
|
4008
|
+
styleSheetId: DOM.StyleSheetId;
|
|
4011
4009
|
range: SourceRange;
|
|
4012
4010
|
text: string;
|
|
4013
4011
|
}
|
|
@@ -4020,7 +4018,7 @@ export namespace CSS {
|
|
|
4020
4018
|
}
|
|
4021
4019
|
|
|
4022
4020
|
export interface SetScopeTextRequest {
|
|
4023
|
-
styleSheetId: StyleSheetId;
|
|
4021
|
+
styleSheetId: DOM.StyleSheetId;
|
|
4024
4022
|
range: SourceRange;
|
|
4025
4023
|
text: string;
|
|
4026
4024
|
}
|
|
@@ -4033,7 +4031,7 @@ export namespace CSS {
|
|
|
4033
4031
|
}
|
|
4034
4032
|
|
|
4035
4033
|
export interface SetRuleSelectorRequest {
|
|
4036
|
-
styleSheetId: StyleSheetId;
|
|
4034
|
+
styleSheetId: DOM.StyleSheetId;
|
|
4037
4035
|
range: SourceRange;
|
|
4038
4036
|
selector: string;
|
|
4039
4037
|
}
|
|
@@ -4046,7 +4044,7 @@ export namespace CSS {
|
|
|
4046
4044
|
}
|
|
4047
4045
|
|
|
4048
4046
|
export interface SetStyleSheetTextRequest {
|
|
4049
|
-
styleSheetId: StyleSheetId;
|
|
4047
|
+
styleSheetId: DOM.StyleSheetId;
|
|
4050
4048
|
text: string;
|
|
4051
4049
|
}
|
|
4052
4050
|
|
|
@@ -4118,7 +4116,7 @@ export namespace CSS {
|
|
|
4118
4116
|
* Fired whenever a stylesheet is changed as a result of the client operation.
|
|
4119
4117
|
*/
|
|
4120
4118
|
export interface StyleSheetChangedEvent {
|
|
4121
|
-
styleSheetId: StyleSheetId;
|
|
4119
|
+
styleSheetId: DOM.StyleSheetId;
|
|
4122
4120
|
}
|
|
4123
4121
|
|
|
4124
4122
|
/**
|
|
@@ -4128,7 +4126,7 @@ export namespace CSS {
|
|
|
4128
4126
|
/**
|
|
4129
4127
|
* Identifier of the removed stylesheet.
|
|
4130
4128
|
*/
|
|
4131
|
-
styleSheetId: StyleSheetId;
|
|
4129
|
+
styleSheetId: DOM.StyleSheetId;
|
|
4132
4130
|
}
|
|
4133
4131
|
|
|
4134
4132
|
export interface ComputedStyleUpdatedEvent {
|
|
@@ -4407,6 +4405,11 @@ export namespace DOM {
|
|
|
4407
4405
|
*/
|
|
4408
4406
|
export type BackendNodeId = OpaqueIdentifier<integer, 'Protocol.DOM.BackendNodeId'>;
|
|
4409
4407
|
|
|
4408
|
+
/**
|
|
4409
|
+
* Unique identifier for a CSS stylesheet.
|
|
4410
|
+
*/
|
|
4411
|
+
export type StyleSheetId = OpaqueIdentifier<string, 'Protocol.DOM.StyleSheetId'>;
|
|
4412
|
+
|
|
4410
4413
|
/**
|
|
4411
4414
|
* Backend node with a friendly name.
|
|
4412
4415
|
*/
|
|
@@ -4644,6 +4647,7 @@ export namespace DOM {
|
|
|
4644
4647
|
assignedSlot?: BackendNode;
|
|
4645
4648
|
isScrollable?: boolean;
|
|
4646
4649
|
affectedByStartingStyles?: boolean;
|
|
4650
|
+
adoptedStyleSheets?: StyleSheetId[];
|
|
4647
4651
|
}
|
|
4648
4652
|
|
|
4649
4653
|
/**
|
|
@@ -5561,6 +5565,20 @@ export namespace DOM {
|
|
|
5561
5565
|
value: string;
|
|
5562
5566
|
}
|
|
5563
5567
|
|
|
5568
|
+
/**
|
|
5569
|
+
* Fired when `Element`'s adoptedStyleSheets are modified.
|
|
5570
|
+
*/
|
|
5571
|
+
export interface AdoptedStyleSheetsModifiedEvent {
|
|
5572
|
+
/**
|
|
5573
|
+
* Id of the node that has changed.
|
|
5574
|
+
*/
|
|
5575
|
+
nodeId: NodeId;
|
|
5576
|
+
/**
|
|
5577
|
+
* New adoptedStyleSheets array.
|
|
5578
|
+
*/
|
|
5579
|
+
adoptedStyleSheets: StyleSheetId[];
|
|
5580
|
+
}
|
|
5581
|
+
|
|
5564
5582
|
/**
|
|
5565
5583
|
* Fired when `Element`'s attribute is removed.
|
|
5566
5584
|
*/
|
|
@@ -13590,6 +13608,7 @@ export namespace Page {
|
|
|
13590
13608
|
AmbientLightSensor = 'ambient-light-sensor',
|
|
13591
13609
|
AriaNotify = 'aria-notify',
|
|
13592
13610
|
AttributionReporting = 'attribution-reporting',
|
|
13611
|
+
Autofill = 'autofill',
|
|
13593
13612
|
Autoplay = 'autoplay',
|
|
13594
13613
|
Bluetooth = 'bluetooth',
|
|
13595
13614
|
BrowsingTopics = 'browsing-topics',
|
|
@@ -13655,6 +13674,7 @@ export namespace Page {
|
|
|
13655
13674
|
LocalFonts = 'local-fonts',
|
|
13656
13675
|
LocalNetworkAccess = 'local-network-access',
|
|
13657
13676
|
Magnetometer = 'magnetometer',
|
|
13677
|
+
ManualText = 'manual-text',
|
|
13658
13678
|
MediaPlaybackWhileNotVisible = 'media-playback-while-not-visible',
|
|
13659
13679
|
Microphone = 'microphone',
|
|
13660
13680
|
Midi = 'midi',
|
|
@@ -13672,7 +13692,6 @@ export namespace Page {
|
|
|
13672
13692
|
RunAdAuction = 'run-ad-auction',
|
|
13673
13693
|
ScreenWakeLock = 'screen-wake-lock',
|
|
13674
13694
|
Serial = 'serial',
|
|
13675
|
-
SharedAutofill = 'shared-autofill',
|
|
13676
13695
|
SharedStorage = 'shared-storage',
|
|
13677
13696
|
SharedStorageSelectUrl = 'shared-storage-select-url',
|
|
13678
13697
|
SmartCard = 'smart-card',
|
|
@@ -15399,6 +15418,22 @@ export namespace Page {
|
|
|
15399
15418
|
isAllowed: boolean;
|
|
15400
15419
|
}
|
|
15401
15420
|
|
|
15421
|
+
export interface GetAnnotatedPageContentRequest {
|
|
15422
|
+
/**
|
|
15423
|
+
* Whether to include actionable information. Defaults to true.
|
|
15424
|
+
*/
|
|
15425
|
+
includeActionableInformation?: boolean;
|
|
15426
|
+
}
|
|
15427
|
+
|
|
15428
|
+
export interface GetAnnotatedPageContentResponse extends ProtocolResponseWithError {
|
|
15429
|
+
/**
|
|
15430
|
+
* The annotated page content as a base64 encoded protobuf.
|
|
15431
|
+
* The format is defined by the `AnnotatedPageContent` message in
|
|
15432
|
+
* components/optimization_guide/proto/features/common_quality_data.proto
|
|
15433
|
+
*/
|
|
15434
|
+
content: binary;
|
|
15435
|
+
}
|
|
15436
|
+
|
|
15402
15437
|
export interface DomContentEventFiredEvent {
|
|
15403
15438
|
timestamp: Network.MonotonicTime;
|
|
15404
15439
|
}
|
|
@@ -71,9 +71,9 @@ export class AiConversation {
|
|
|
71
71
|
) {
|
|
72
72
|
this.#changeManager = changeManager;
|
|
73
73
|
this.#aidaClient = aidaClient;
|
|
74
|
-
this.#agent = this.#createAgent(type);
|
|
75
|
-
|
|
76
74
|
this.type = type;
|
|
75
|
+
this.#agent = this.#createAgent();
|
|
76
|
+
|
|
77
77
|
this.id = id;
|
|
78
78
|
this.#isReadOnly = isReadOnly;
|
|
79
79
|
this.#isExternal = isExternal;
|
|
@@ -212,14 +212,14 @@ export class AiConversation {
|
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
#createAgent(
|
|
215
|
+
#createAgent(): AiAgent<unknown> {
|
|
216
216
|
const options = {
|
|
217
217
|
aidaClient: this.#aidaClient,
|
|
218
218
|
serverSideLoggingEnabled: isAiAssistanceServerSideLoggingEnabled(),
|
|
219
219
|
changeManager: this.#changeManager,
|
|
220
220
|
};
|
|
221
221
|
let agent: AiAgent<unknown>;
|
|
222
|
-
switch (
|
|
222
|
+
switch (this.type) {
|
|
223
223
|
case ConversationType.STYLING: {
|
|
224
224
|
agent = new StylingAgent(options);
|
|
225
225
|
break;
|
|
@@ -251,6 +251,7 @@ export class AiConversation {
|
|
|
251
251
|
): AsyncGenerator<ResponseData, void, void> {
|
|
252
252
|
for await (const data of this.#agent.run(initialQuery, options, multimodalInput)) {
|
|
253
253
|
// We don't want to save partial responses to the conversation history.
|
|
254
|
+
// TODO(crbug.com/463325400): We should save interleaved answers to the history as well.
|
|
254
255
|
if (data.type !== ResponseType.ANSWER || data.complete) {
|
|
255
256
|
void this.addHistoryItem(data);
|
|
256
257
|
}
|
|
@@ -31,9 +31,9 @@ function formatStyles(styles: Record<string, string>, indent = 2): string {
|
|
|
31
31
|
export class ChangeManager {
|
|
32
32
|
readonly #stylesheetMutex = new Common.Mutex.Mutex();
|
|
33
33
|
readonly #cssModelToStylesheetId =
|
|
34
|
-
new Map<SDK.CSSModel.CSSModel, Map<Protocol.Page.FrameId, Protocol.
|
|
35
|
-
readonly #stylesheetChanges = new Map<Protocol.
|
|
36
|
-
readonly #backupStylesheetChanges = new Map<Protocol.
|
|
34
|
+
new Map<SDK.CSSModel.CSSModel, Map<Protocol.Page.FrameId, Protocol.DOM.StyleSheetId>>();
|
|
35
|
+
readonly #stylesheetChanges = new Map<Protocol.DOM.StyleSheetId, Change[]>();
|
|
36
|
+
readonly #backupStylesheetChanges = new Map<Protocol.DOM.StyleSheetId, Change[]>();
|
|
37
37
|
|
|
38
38
|
constructor() {
|
|
39
39
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
@@ -147,7 +147,7 @@ ${formatStyles(change.styles)}
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
async #getStylesheet(cssModel: SDK.CSSModel.CSSModel, frameId: Protocol.Page.FrameId):
|
|
150
|
-
Promise<Protocol.
|
|
150
|
+
Promise<Protocol.DOM.StyleSheetId> {
|
|
151
151
|
return await this.#stylesheetMutex.run(async () => {
|
|
152
152
|
let frameToStylesheet = this.#cssModelToStylesheetId.get(cssModel);
|
|
153
153
|
if (!frameToStylesheet) {
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
type AiAgent,
|
|
15
15
|
type ExternalRequestResponse,
|
|
16
16
|
ExternalRequestResponseType,
|
|
17
|
-
type ResponseData,
|
|
18
17
|
ResponseType
|
|
19
18
|
} from './agents/AiAgent.js';
|
|
20
19
|
import {NetworkAgent, RequestContext} from './agents/NetworkAgent.js';
|
|
@@ -204,20 +203,6 @@ export class ConversationHandler extends Common.ObjectWrapper.ObjectWrapper<Even
|
|
|
204
203
|
}
|
|
205
204
|
}
|
|
206
205
|
|
|
207
|
-
async *
|
|
208
|
-
handleConversationWithHistory(
|
|
209
|
-
items: AsyncIterable<ResponseData, void, void>,
|
|
210
|
-
conversation: AiConversation|undefined,
|
|
211
|
-
): AsyncGenerator<ResponseData, void, void> {
|
|
212
|
-
for await (const data of items) {
|
|
213
|
-
// We don't want to save partial responses to the conversation history.
|
|
214
|
-
if (data.type !== ResponseType.ANSWER || data.complete) {
|
|
215
|
-
void conversation?.addHistoryItem(data);
|
|
216
|
-
}
|
|
217
|
-
yield data;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
206
|
async * #createAndDoExternalConversation(opts: {
|
|
222
207
|
conversationType: ConversationType,
|
|
223
208
|
aiAgent: AiAgent<unknown>,
|
|
@@ -237,7 +237,8 @@ export interface FunctionDeclaration<Args extends Record<string, unknown>, Retur
|
|
|
237
237
|
/**
|
|
238
238
|
* Function implementation that the LLM will try to execute,
|
|
239
239
|
*/
|
|
240
|
-
|
|
240
|
+
|
|
241
|
+
handler(args: Args, options?: FunctionHandlerOptions): Promise<FunctionCallHandlerResult<ReturnType>>;
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
interface AidaFetchResult {
|
|
@@ -618,10 +619,12 @@ export abstract class AiAgent<T> {
|
|
|
618
619
|
}
|
|
619
620
|
}
|
|
620
621
|
|
|
621
|
-
async *
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
622
|
+
async *
|
|
623
|
+
#callFunction(
|
|
624
|
+
name: string,
|
|
625
|
+
args: Record<string, unknown>,
|
|
626
|
+
options?: FunctionHandlerOptions,
|
|
627
|
+
): AsyncGenerator<FunctionCallResponseData, {result: unknown}> {
|
|
625
628
|
const call = this.#functionDeclarations.get(name);
|
|
626
629
|
if (!call) {
|
|
627
630
|
throw new Error(`Function ${name} is not found.`);
|
|
@@ -655,7 +658,7 @@ export abstract class AiAgent<T> {
|
|
|
655
658
|
}
|
|
656
659
|
}
|
|
657
660
|
|
|
658
|
-
let result = await call.handler(args, options)
|
|
661
|
+
let result = await call.handler(args, options);
|
|
659
662
|
|
|
660
663
|
if ('requiresApproval' in result) {
|
|
661
664
|
if (code) {
|