chrome-devtools-frontend 1.0.1555430 → 1.0.1558690
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/front_end/core/common/Object.ts +5 -1
- package/front_end/core/host/ResourceLoader.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/sdk/DOMModel.ts +7 -0
- package/front_end/core/sdk/NetworkManager.ts +0 -7
- package/front_end/core/sdk/SourceMap.ts +16 -2
- package/front_end/core/sdk/SourceMapManager.ts +1 -1
- package/front_end/core/sdk/SourceMapScopesInfo.ts +11 -4
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +3 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +119 -8
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +5 -1
- package/front_end/generated/Deprecation.ts +0 -7
- package/front_end/generated/InspectorBackendCommands.ts +4 -4
- package/front_end/generated/protocol.ts +9 -1
- package/front_end/models/ai_assistance/AiConversation.ts +71 -10
- package/front_end/models/ai_assistance/ArtifactsManager.ts +67 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +3 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +17 -27
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +151 -3
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +3 -3
- package/front_end/models/annotations/AnnotationRepository.ts +2 -2
- package/front_end/models/bindings/CompilerScriptMapping.ts +7 -6
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +4 -4
- package/front_end/models/greendev/Prototypes.ts +56 -0
- package/front_end/models/greendev/README.md +5 -0
- package/front_end/models/greendev/greendev.ts +5 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +5 -3
- package/front_end/models/stack_trace/StackTraceModel.ts +53 -40
- package/front_end/models/trace/EventsSerializer.ts +8 -2
- package/front_end/models/trace/extras/TraceTree.ts +4 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/insights/LCPDiscovery.ts +0 -2
- package/front_end/models/trace/types/TraceEvents.ts +0 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +96 -91
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +16 -0
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +109 -7
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +7 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +15 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +9 -9
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +6 -1
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +5 -6
- package/front_end/panels/application/AppManifestView.ts +360 -391
- package/front_end/panels/application/ApplicationPanelSidebar.ts +24 -57
- package/front_end/panels/application/CookieItemsView.ts +1 -0
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -0
- package/front_end/panels/application/ServiceWorkersView.ts +2 -0
- package/front_end/panels/application/SharedStorageTreeElement.ts +3 -0
- package/front_end/panels/application/StorageView.ts +1 -0
- package/front_end/panels/application/appManifestView.css +49 -1
- package/front_end/panels/application/components/ProtocolHandlersView.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +4 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +7 -1
- package/front_end/panels/elements/components/AdornerManager.ts +8 -0
- package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +0 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +10 -0
- package/front_end/panels/lighthouse/lighthousePanel.css +46 -3
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +4 -8
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +148 -97
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +37 -35
- package/front_end/panels/network/NetworkLogViewColumns.ts +9 -9
- package/front_end/panels/network/RequestCookiesView.ts +125 -141
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/requestCookiesView.css +22 -20
- package/front_end/panels/recorder/components/RecordingView.ts +3 -3
- package/front_end/panels/recorder/components/StepView.ts +2 -1
- package/front_end/panels/settings/SettingsScreen.ts +133 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +4 -0
- package/front_end/panels/settings/settings-meta.ts +24 -0
- package/front_end/panels/settings/settingsScreen.css +4 -0
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -3
- package/front_end/panels/sources/DebuggerPausedMessage.ts +125 -90
- package/front_end/panels/sources/SourcesPanel.ts +10 -7
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -17
- package/front_end/panels/sources/debuggerPausedMessage.css +8 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +2 -0
- package/front_end/third_party/acorn/estree-legacy.d.ts +4 -0
- 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/cjs/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +14 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +10 -14
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +21 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +86 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +14 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +11 -15
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +21 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +18 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +0 -33
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +14 -28
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/bidi/core/Connection.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +15 -6
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +29 -10
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/icon_button/iconButton.css +3 -1
- package/front_end/ui/components/report_view/ReportView.docs.ts +37 -0
- package/front_end/ui/components/report_view/ReportView.ts +12 -6
- package/front_end/ui/components/report_view/report.css +16 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +135 -7
- package/front_end/ui/components/text_editor/config.ts +6 -6
- package/front_end/ui/legacy/ContextMenu.ts +11 -2
- package/front_end/ui/legacy/Floaty.ts +5 -9
- package/front_end/ui/legacy/InspectorView.ts +2 -1
- package/front_end/ui/legacy/ReportView.ts +5 -4
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +4 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -2
- package/front_end/ui/legacy/Widget.ts +7 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +18 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +6 -0
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -1
- package/front_end/ui/legacy/reportView.css +0 -24
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/package.json +1 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
// Copyright 2011 The Chromium Authors
|
|
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
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
import * as Common from '../../core/common/common.js';
|
|
7
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
8
|
import * as Protocol from '../../generated/protocol.js';
|
|
10
9
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
11
|
-
import {Icon} from '../../ui/kit/kit.js';
|
|
12
10
|
import * as CookieTable from '../../ui/legacy/components/cookie_table/cookie_table.js';
|
|
13
|
-
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
14
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
|
+
import * as Lit from '../../ui/lit/lit.js';
|
|
15
13
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
16
14
|
|
|
17
15
|
import requestCookiesViewStyles from './requestCookiesView.css.js';
|
|
16
|
+
const {render, html} = Lit;
|
|
18
17
|
|
|
19
18
|
const UIStrings = {
|
|
20
19
|
/**
|
|
@@ -74,74 +73,108 @@ const UIStrings = {
|
|
|
74
73
|
const str_ = i18n.i18n.registerUIStrings('panels/network/RequestCookiesView.ts', UIStrings);
|
|
75
74
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
76
75
|
|
|
76
|
+
interface ViewInput {
|
|
77
|
+
requestCookies: CookieTable.CookiesTable.CookiesTableData;
|
|
78
|
+
responseCookies: CookieTable.CookiesTable.CookiesTableData;
|
|
79
|
+
malformedResponseCookies: SDK.NetworkRequest.BlockedSetCookieWithReason[];
|
|
80
|
+
showFilteredOutCookies: boolean;
|
|
81
|
+
hasBlockedCookies: boolean;
|
|
82
|
+
gotCookies: boolean;
|
|
83
|
+
onShowFilteredOutCookiesChange: (checked: boolean) => void;
|
|
84
|
+
siteHasCookieInOtherPartition: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type ViewFunction = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
88
|
+
|
|
89
|
+
export const DEFAULT_VIEW: ViewFunction = (input, _output, target) => {
|
|
90
|
+
// clang-format off
|
|
91
|
+
render(
|
|
92
|
+
html`
|
|
93
|
+
<style>${requestCookiesViewStyles}</style>
|
|
94
|
+
<style>${UI.inspectorCommonStyles}</style>
|
|
95
|
+
<div class="request-cookies-view">
|
|
96
|
+
${input.gotCookies ? Lit.nothing : html`
|
|
97
|
+
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(UI.EmptyWidget.EmptyWidget, {
|
|
98
|
+
header: i18nString(UIStrings.thisRequestHasNoCookies)})}></devtools-widget>
|
|
99
|
+
`}
|
|
100
|
+
|
|
101
|
+
<div class=${input.requestCookies.cookies.length || input.hasBlockedCookies ? '' : 'hidden'}>
|
|
102
|
+
<span class="request-cookies-title" title=${i18nString(UIStrings.cookiesThatWereSentToTheServerIn)}>
|
|
103
|
+
${i18nString(UIStrings.requestCookies)}
|
|
104
|
+
</span>
|
|
105
|
+
<devtools-checkbox
|
|
106
|
+
@change=${(e: Event) => input.onShowFilteredOutCookiesChange((e.target as HTMLInputElement).checked)}
|
|
107
|
+
.checked=${input.showFilteredOutCookies}>
|
|
108
|
+
${i18nString(UIStrings.showFilteredOutRequestCookies)}
|
|
109
|
+
</devtools-checkbox>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div class="cookies-panel-item ${!input.requestCookies.cookies.length && input.hasBlockedCookies ? '' : 'hidden'}">
|
|
113
|
+
${i18nString(UIStrings.noRequestCookiesWereSent)}
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
${input.requestCookies.cookies.length > 0 ? html`
|
|
117
|
+
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(CookieTable.CookiesTable.CookiesTable, {
|
|
118
|
+
cookiesData: input.requestCookies,
|
|
119
|
+
inline: true
|
|
120
|
+
})} class="cookie-table cookies-panel-item"></devtools-widget>
|
|
121
|
+
` : Lit.nothing}
|
|
122
|
+
|
|
123
|
+
<div class="cookies-panel-item site-has-cookies-in-other-partition ${input.siteHasCookieInOtherPartition ? '' : 'hidden'}">
|
|
124
|
+
${uiI18n.getFormatLocalizedString(str_, UIStrings.siteHasCookieInOtherPartition, {
|
|
125
|
+
PH1: UI.XLink.XLink.create(
|
|
126
|
+
'https://developer.chrome.com/en/docs/privacy-sandbox/chips/', i18nString(UIStrings.learnMore), undefined,
|
|
127
|
+
undefined, 'learn-more'),})}
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div class="request-cookies-title ${input.responseCookies.cookies.length ? '' : 'hidden'}"
|
|
131
|
+
title=${i18nString(UIStrings.cookiesThatWereReceivedFromThe)}>
|
|
132
|
+
${i18nString(UIStrings.responseCookies)}
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
${input.responseCookies.cookies.length ? html`
|
|
136
|
+
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(CookieTable.CookiesTable.CookiesTable, {
|
|
137
|
+
cookiesData: input.responseCookies,
|
|
138
|
+
inline: true })} class="cookie-table cookies-panel-item"></devtools-widget>
|
|
139
|
+
` : Lit.nothing}
|
|
140
|
+
|
|
141
|
+
<div class="request-cookies-title ${input.malformedResponseCookies.length ? '' : 'hidden'}" title=${i18nString(UIStrings.cookiesThatWereReceivedFromTheServer)}>
|
|
142
|
+
${i18nString(UIStrings.malformedResponseCookies)}
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div class=${input.malformedResponseCookies.length ? '' : 'hidden'}>
|
|
146
|
+
${input.malformedResponseCookies.map(malformedCookie => html`
|
|
147
|
+
<span class="cookie-line source-code" title=${getMalformedCookieTooltip(malformedCookie)}>
|
|
148
|
+
<devtools-icon class="cookie-warning-icon small" .name=${'cross-circle-filled'}></devtools-icon>
|
|
149
|
+
${malformedCookie.cookieLine}
|
|
150
|
+
</span>
|
|
151
|
+
`)}
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
`,
|
|
155
|
+
target);
|
|
156
|
+
// clang-format on
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
function getMalformedCookieTooltip(malformedCookie: SDK.NetworkRequest.BlockedSetCookieWithReason): string {
|
|
160
|
+
if (malformedCookie.blockedReasons.includes(Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize)) {
|
|
161
|
+
return SDK.NetworkRequest.setCookieBlockedReasonToUiString(
|
|
162
|
+
Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize);
|
|
163
|
+
}
|
|
164
|
+
return SDK.NetworkRequest.setCookieBlockedReasonToUiString(Protocol.Network.SetCookieBlockedReason.SyntaxError);
|
|
165
|
+
}
|
|
166
|
+
|
|
77
167
|
export class RequestCookiesView extends UI.Widget.Widget {
|
|
78
168
|
private request: SDK.NetworkRequest.NetworkRequest;
|
|
79
169
|
private readonly showFilteredOutCookiesSetting: Common.Settings.Setting<boolean>;
|
|
80
|
-
private readonly
|
|
81
|
-
private readonly requestCookiesTitle: HTMLElement;
|
|
82
|
-
private readonly requestCookiesEmpty: HTMLElement;
|
|
83
|
-
private readonly requestCookiesTable: CookieTable.CookiesTable.CookiesTable;
|
|
84
|
-
private readonly responseCookiesTitle: HTMLElement;
|
|
85
|
-
private readonly responseCookiesTable: CookieTable.CookiesTable.CookiesTable;
|
|
86
|
-
private readonly siteHasCookieInOtherPartition: HTMLElement;
|
|
87
|
-
private readonly malformedResponseCookiesTitle: HTMLElement;
|
|
88
|
-
private readonly malformedResponseCookiesList: HTMLElement;
|
|
170
|
+
private readonly view: ViewFunction;
|
|
89
171
|
|
|
90
|
-
constructor(request: SDK.NetworkRequest.NetworkRequest) {
|
|
172
|
+
constructor(request: SDK.NetworkRequest.NetworkRequest, view: ViewFunction = DEFAULT_VIEW) {
|
|
91
173
|
super({jslog: `${VisualLogging.pane('cookies').track({resize: true})}`});
|
|
92
|
-
this.registerRequiredCSS(requestCookiesViewStyles);
|
|
93
|
-
|
|
94
|
-
this.element.classList.add('request-cookies-view');
|
|
95
|
-
|
|
96
174
|
this.request = request;
|
|
97
175
|
this.showFilteredOutCookiesSetting = Common.Settings.Settings.instance().createSetting(
|
|
98
176
|
'show-filtered-out-request-cookies', /* defaultValue */ false);
|
|
99
|
-
|
|
100
|
-
this.emptyWidget = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.thisRequestHasNoCookies), '');
|
|
101
|
-
this.emptyWidget.show(this.element);
|
|
102
|
-
|
|
103
|
-
this.requestCookiesTitle = this.element.createChild('div');
|
|
104
|
-
const titleText = this.requestCookiesTitle.createChild('span', 'request-cookies-title');
|
|
105
|
-
titleText.textContent = i18nString(UIStrings.requestCookies);
|
|
106
|
-
UI.Tooltip.Tooltip.install(titleText, i18nString(UIStrings.cookiesThatWereSentToTheServerIn));
|
|
107
|
-
|
|
108
|
-
const requestCookiesCheckbox = SettingsUI.SettingsUI.createSettingCheckbox(
|
|
109
|
-
i18nString(UIStrings.showFilteredOutRequestCookies), this.showFilteredOutCookiesSetting);
|
|
110
|
-
requestCookiesCheckbox.addEventListener('change', () => {
|
|
111
|
-
this.refreshRequestCookiesView();
|
|
112
|
-
});
|
|
113
|
-
this.requestCookiesTitle.appendChild(requestCookiesCheckbox);
|
|
114
|
-
|
|
115
|
-
this.requestCookiesEmpty = this.element.createChild('div', 'cookies-panel-item');
|
|
116
|
-
this.requestCookiesEmpty.textContent = i18nString(UIStrings.noRequestCookiesWereSent);
|
|
117
|
-
|
|
118
|
-
this.requestCookiesTable = new CookieTable.CookiesTable.CookiesTable(/* renderInline */ true);
|
|
119
|
-
this.requestCookiesTable.contentElement.classList.add('cookie-table', 'cookies-panel-item');
|
|
120
|
-
this.requestCookiesTable.show(this.element);
|
|
121
|
-
|
|
122
|
-
this.siteHasCookieInOtherPartition =
|
|
123
|
-
this.element.createChild('div', 'cookies-panel-item site-has-cookies-in-other-partition');
|
|
124
|
-
this.siteHasCookieInOtherPartition.appendChild(
|
|
125
|
-
uiI18n.getFormatLocalizedString(str_, UIStrings.siteHasCookieInOtherPartition, {
|
|
126
|
-
PH1: UI.XLink.XLink.create(
|
|
127
|
-
'https://developer.chrome.com/en/docs/privacy-sandbox/chips/', i18nString(UIStrings.learnMore), undefined,
|
|
128
|
-
undefined, 'learn-more'),
|
|
129
|
-
}));
|
|
130
|
-
|
|
131
|
-
this.responseCookiesTitle = this.element.createChild('div', 'request-cookies-title');
|
|
132
|
-
this.responseCookiesTitle.textContent = i18nString(UIStrings.responseCookies);
|
|
133
|
-
this.responseCookiesTitle.title = i18nString(UIStrings.cookiesThatWereReceivedFromThe);
|
|
134
|
-
|
|
135
|
-
this.responseCookiesTable = new CookieTable.CookiesTable.CookiesTable(/* renderInline */ true);
|
|
136
|
-
this.responseCookiesTable.contentElement.classList.add('cookie-table', 'cookies-panel-item');
|
|
137
|
-
this.responseCookiesTable.show(this.element);
|
|
138
|
-
|
|
139
|
-
this.malformedResponseCookiesTitle = this.element.createChild('div', 'request-cookies-title');
|
|
140
|
-
this.malformedResponseCookiesTitle.textContent = i18nString(UIStrings.malformedResponseCookies);
|
|
141
|
-
UI.Tooltip.Tooltip.install(
|
|
142
|
-
this.malformedResponseCookiesTitle, i18nString(UIStrings.cookiesThatWereReceivedFromTheServer));
|
|
143
|
-
|
|
144
|
-
this.malformedResponseCookiesList = this.element.createChild('div');
|
|
177
|
+
this.view = view;
|
|
145
178
|
}
|
|
146
179
|
|
|
147
180
|
private getRequestCookies(): {
|
|
@@ -230,99 +263,50 @@ export class RequestCookiesView extends UI.Widget.Widget {
|
|
|
230
263
|
return {responseCookies, responseCookieToBlockedReasons, responseCookieToExemptionReason, malformedResponseCookies};
|
|
231
264
|
}
|
|
232
265
|
|
|
233
|
-
|
|
266
|
+
override performUpdate(): void {
|
|
234
267
|
if (!this.isShowing()) {
|
|
235
268
|
return;
|
|
236
269
|
}
|
|
237
|
-
|
|
238
|
-
const gotCookies = this.request.hasRequestCookies() || this.request.responseCookies.length;
|
|
239
|
-
if (gotCookies) {
|
|
240
|
-
this.emptyWidget.hideWidget();
|
|
241
|
-
} else {
|
|
242
|
-
this.emptyWidget.showWidget();
|
|
243
|
-
}
|
|
244
|
-
|
|
245
270
|
const {requestCookies, requestCookieToBlockedReasons, requestCookieToExemptionReason} = this.getRequestCookies();
|
|
246
271
|
const {responseCookies, responseCookieToBlockedReasons, responseCookieToExemptionReason, malformedResponseCookies} =
|
|
247
272
|
this.getResponseCookies();
|
|
248
273
|
|
|
249
|
-
|
|
250
|
-
this.
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
this.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
this.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
} else {
|
|
273
|
-
this.responseCookiesTitle.classList.add('hidden');
|
|
274
|
-
this.responseCookiesTable.hideWidget();
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
if (malformedResponseCookies.length) {
|
|
278
|
-
this.malformedResponseCookiesTitle.classList.remove('hidden');
|
|
279
|
-
this.malformedResponseCookiesList.classList.remove('hidden');
|
|
280
|
-
|
|
281
|
-
this.malformedResponseCookiesList.removeChildren();
|
|
282
|
-
for (const malformedCookie of malformedResponseCookies) {
|
|
283
|
-
const listItem = this.malformedResponseCookiesList.createChild('span', 'cookie-line source-code');
|
|
284
|
-
const icon = new Icon();
|
|
285
|
-
icon.name = 'cross-circle-filled';
|
|
286
|
-
icon.classList.add('cookie-warning-icon', 'small');
|
|
287
|
-
listItem.appendChild(icon);
|
|
288
|
-
UI.UIUtils.createTextChild(listItem, malformedCookie.cookieLine);
|
|
289
|
-
|
|
290
|
-
if (malformedCookie.blockedReasons.includes(
|
|
291
|
-
Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize)) {
|
|
292
|
-
listItem.title = SDK.NetworkRequest.setCookieBlockedReasonToUiString(
|
|
293
|
-
Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize);
|
|
294
|
-
} else {
|
|
295
|
-
listItem.title =
|
|
296
|
-
SDK.NetworkRequest.setCookieBlockedReasonToUiString(Protocol.Network.SetCookieBlockedReason.SyntaxError);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
} else {
|
|
300
|
-
this.malformedResponseCookiesTitle.classList.add('hidden');
|
|
301
|
-
this.malformedResponseCookiesList.classList.add('hidden');
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
if (this.request.siteHasCookieInOtherPartition()) {
|
|
305
|
-
this.siteHasCookieInOtherPartition.classList.remove('hidden');
|
|
306
|
-
} else {
|
|
307
|
-
this.siteHasCookieInOtherPartition.classList.add('hidden');
|
|
308
|
-
}
|
|
274
|
+
const input: ViewInput = {
|
|
275
|
+
gotCookies: this.request.hasRequestCookies() || this.request.responseCookies.length > 0,
|
|
276
|
+
requestCookies: {
|
|
277
|
+
cookies: requestCookies,
|
|
278
|
+
cookieToBlockedReasons: requestCookieToBlockedReasons,
|
|
279
|
+
cookieToExemptionReason: requestCookieToExemptionReason,
|
|
280
|
+
},
|
|
281
|
+
responseCookies: {
|
|
282
|
+
cookies: responseCookies,
|
|
283
|
+
cookieToBlockedReasons: responseCookieToBlockedReasons,
|
|
284
|
+
cookieToExemptionReason: responseCookieToExemptionReason,
|
|
285
|
+
},
|
|
286
|
+
malformedResponseCookies,
|
|
287
|
+
showFilteredOutCookies: this.showFilteredOutCookiesSetting.get(),
|
|
288
|
+
onShowFilteredOutCookiesChange: (checked: boolean) => {
|
|
289
|
+
this.showFilteredOutCookiesSetting.set(checked);
|
|
290
|
+
this.requestUpdate();
|
|
291
|
+
},
|
|
292
|
+
siteHasCookieInOtherPartition: this.request.siteHasCookieInOtherPartition(),
|
|
293
|
+
hasBlockedCookies: this.request.blockedRequestCookies().length > 0,
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
this.view(input, undefined, this.contentElement);
|
|
309
297
|
}
|
|
310
298
|
|
|
311
299
|
override wasShown(): void {
|
|
312
300
|
super.wasShown();
|
|
313
|
-
this.request.addEventListener(
|
|
314
|
-
|
|
315
|
-
this.request.addEventListener(
|
|
316
|
-
SDK.NetworkRequest.Events.RESPONSE_HEADERS_CHANGED, this.refreshRequestCookiesView, this);
|
|
301
|
+
this.request.addEventListener(SDK.NetworkRequest.Events.REQUEST_HEADERS_CHANGED, this.requestUpdate, this);
|
|
302
|
+
this.request.addEventListener(SDK.NetworkRequest.Events.RESPONSE_HEADERS_CHANGED, this.requestUpdate, this);
|
|
317
303
|
|
|
318
|
-
this.
|
|
304
|
+
this.requestUpdate();
|
|
319
305
|
}
|
|
320
306
|
|
|
321
307
|
override willHide(): void {
|
|
322
308
|
super.willHide();
|
|
323
|
-
this.request.removeEventListener(
|
|
324
|
-
|
|
325
|
-
this.request.removeEventListener(
|
|
326
|
-
SDK.NetworkRequest.Events.RESPONSE_HEADERS_CHANGED, this.refreshRequestCookiesView, this);
|
|
309
|
+
this.request.removeEventListener(SDK.NetworkRequest.Events.REQUEST_HEADERS_CHANGED, this.requestUpdate, this);
|
|
310
|
+
this.request.removeEventListener(SDK.NetworkRequest.Events.RESPONSE_HEADERS_CHANGED, this.requestUpdate, this);
|
|
327
311
|
}
|
|
328
312
|
}
|
|
@@ -86,11 +86,11 @@ const UIStrings = {
|
|
|
86
86
|
/**
|
|
87
87
|
* @description A context menu item in the Network Log View Columns of the Network panel
|
|
88
88
|
*/
|
|
89
|
-
responseHeaders: 'Response
|
|
89
|
+
responseHeaders: 'Response headers',
|
|
90
90
|
/**
|
|
91
91
|
* @description A context menu item in the Network Log View Columns of the Network panel
|
|
92
92
|
*/
|
|
93
|
-
earlyHintsHeaders: 'Early
|
|
93
|
+
earlyHintsHeaders: 'Early hints headers',
|
|
94
94
|
/**
|
|
95
95
|
* @description Title text for a link to the Sources panel to the file containing the header override definitions
|
|
96
96
|
*/
|
|
@@ -4,27 +4,29 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
.request-cookies-view {
|
|
9
|
+
overflow: auto;
|
|
10
|
+
padding: 12px;
|
|
11
|
+
height: 100%;
|
|
12
|
+
background-color: var(--sys-color-cdt-base-container);
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
.request-cookies-view .request-cookies-title {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
15
|
+
.request-cookies-view .request-cookies-title {
|
|
16
|
+
font-size: 12px;
|
|
17
|
+
font-weight: bold;
|
|
18
|
+
margin-right: 30px;
|
|
19
|
+
color: var(--sys-color-on-surface);
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
.request-cookies-view .cookie-line {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
22
|
+
.request-cookies-view .cookie-line {
|
|
23
|
+
margin-top: 6px;
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
.request-cookies-view .cookies-panel-item {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
.request-cookies-view .cookies-panel-item {
|
|
28
|
+
margin-top: 6px;
|
|
29
|
+
margin-bottom: 16px;
|
|
30
|
+
flex: none;
|
|
31
|
+
}
|
|
30
32
|
}
|
|
@@ -910,7 +910,7 @@ export class RecordingView extends UI.Widget.Widget {
|
|
|
910
910
|
}
|
|
911
911
|
|
|
912
912
|
#isTitleInvalid = false;
|
|
913
|
-
#selectedStep
|
|
913
|
+
#selectedStep: Models.Schema.Step|null = null;
|
|
914
914
|
#replaySettingsExpanded = false;
|
|
915
915
|
#showCodeView = false;
|
|
916
916
|
#code = '';
|
|
@@ -1090,10 +1090,10 @@ export class RecordingView extends UI.Widget.Widget {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
1092
|
#onWrapperClick(): void {
|
|
1093
|
-
if (this.#selectedStep
|
|
1093
|
+
if (!this.#selectedStep) {
|
|
1094
1094
|
return;
|
|
1095
1095
|
}
|
|
1096
|
-
this.#selectedStep =
|
|
1096
|
+
this.#selectedStep = null;
|
|
1097
1097
|
this.performUpdate();
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
@@ -412,7 +412,8 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
412
412
|
}
|
|
413
413
|
data-step-index=${input.stepIndex}
|
|
414
414
|
data-section-index=${input.sectionIndex}
|
|
415
|
-
@click=${() => {
|
|
415
|
+
@click=${(event: Event) => {
|
|
416
|
+
event.stopPropagation();
|
|
416
417
|
const stepOrSection = input.step || input.section;
|
|
417
418
|
if (stepOrSection) {
|
|
418
419
|
input.onStepClick(stepOrSection);
|
|
@@ -11,13 +11,14 @@ import * as Common from '../../core/common/common.js';
|
|
|
11
11
|
import * as Host from '../../core/host/host.js';
|
|
12
12
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
13
13
|
import * as Root from '../../core/root/root.js';
|
|
14
|
+
import * as GreenDev from '../../models/greendev/greendev.js';
|
|
14
15
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
15
16
|
import * as UIHelpers from '../../ui/helpers/helpers.js';
|
|
16
17
|
import {type Card, createIcon} from '../../ui/kit/kit.js';
|
|
17
18
|
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
18
19
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
19
20
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
20
|
-
import {html, render} from '../../ui/lit/lit.js';
|
|
21
|
+
import {html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
21
22
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
22
23
|
import {PanelUtils} from '../utils/utils.js';
|
|
23
24
|
|
|
@@ -51,6 +52,11 @@ const UIStrings = {
|
|
|
51
52
|
* @description Message shown in the experiments panel to warn users about any possible unstable features.
|
|
52
53
|
*/
|
|
53
54
|
theseExperimentsCouldBeUnstable: 'Warning: These experiments could be unstable or unreliable.',
|
|
55
|
+
/**
|
|
56
|
+
* @description Message shown in the GreenDev prototypes panel to warn users about any possible unstable features.
|
|
57
|
+
*/
|
|
58
|
+
greenDevUnstable:
|
|
59
|
+
'Warning: All these features are prototype and very unstable. They exist for user testing and are not designed to be relied on.',
|
|
54
60
|
/**
|
|
55
61
|
* @description Message text content in Settings Screen of the Settings
|
|
56
62
|
*/
|
|
@@ -603,3 +609,129 @@ export interface ShowSettingsScreenOptions {
|
|
|
603
609
|
name?: string;
|
|
604
610
|
focusTabHeader?: boolean;
|
|
605
611
|
}
|
|
612
|
+
|
|
613
|
+
export class GreenDevSettingsTab extends UI.Widget.VBox implements SettingsTab {
|
|
614
|
+
#view: View;
|
|
615
|
+
|
|
616
|
+
constructor(view = GREENDEV_VIEW) {
|
|
617
|
+
super({jslog: `${VisualLogging.pane('greendev-prototypes')}`});
|
|
618
|
+
this.element.id = 'greendev-prototypes-tab-content';
|
|
619
|
+
|
|
620
|
+
this.#view = view;
|
|
621
|
+
|
|
622
|
+
this.requestUpdate();
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
highlightObject(_object: Object): void {
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
override performUpdate(): Promise<void>|void {
|
|
629
|
+
const settings = GreenDev.Prototypes.instance().settings();
|
|
630
|
+
this.#view({settings}, {}, this.element);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
interface GreenDevViewInput {
|
|
635
|
+
settings: GreenDev.GreenDevSettings;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
type View = (input: GreenDevViewInput, output: object, target: HTMLElement) => void;
|
|
639
|
+
const GREENDEV_VIEW: View = (input, _output, target) => {
|
|
640
|
+
// clang-format off
|
|
641
|
+
render(html`
|
|
642
|
+
<div class="settings-card-container">
|
|
643
|
+
<devtools-card .heading=${'GreenDev prototypes'}>
|
|
644
|
+
<div class="experiments-warning-subsection">
|
|
645
|
+
<devtools-icon .name=${'warning'}></devtools-icon>
|
|
646
|
+
<span>${i18nString(UIStrings.greenDevUnstable)}</span>
|
|
647
|
+
</div>
|
|
648
|
+
<div class="settings-experiments-block">
|
|
649
|
+
${renderPrototypeCheckboxes(input.settings, ['aiAnnotations', 'inDevToolsFloaty'])}
|
|
650
|
+
</div>
|
|
651
|
+
</devtools-card>
|
|
652
|
+
|
|
653
|
+
<devtools-card .heading=${'GreenDev widgets'}>
|
|
654
|
+
<div class="experiments-warning-subsection">
|
|
655
|
+
<devtools-icon .name=${'warning'}></devtools-icon>
|
|
656
|
+
<span>${i18nString(UIStrings.greenDevUnstable)}</span>
|
|
657
|
+
</div>
|
|
658
|
+
<div class="settings-experiments-block greendev-widgets">
|
|
659
|
+
${renderWidgetOptions(input.settings)}
|
|
660
|
+
</div>
|
|
661
|
+
</devtools-card>
|
|
662
|
+
</div>
|
|
663
|
+
`, target);
|
|
664
|
+
// clang-format on
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
const GREENDEV_PROTOTYPE_NAMES: Record<keyof GreenDev.GreenDevSettings, string> = {
|
|
668
|
+
inDevToolsFloaty: 'In DevTools context picker',
|
|
669
|
+
aiAnnotations: 'AI auto-annotations',
|
|
670
|
+
inlineWidgets: 'Inline widgets in AI Assistance',
|
|
671
|
+
artifactViewer: 'Widgets in the Artifact viewer'
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
function renderWidgetOptions(settings: GreenDev.GreenDevSettings): TemplateResult {
|
|
675
|
+
function onChange(nowActiveRadio: 'inlineWidgets'|'artifactViewer'|'none') {
|
|
676
|
+
return () => {
|
|
677
|
+
switch (nowActiveRadio) {
|
|
678
|
+
case 'inlineWidgets': {
|
|
679
|
+
settings.artifactViewer.set(false);
|
|
680
|
+
settings.inlineWidgets.set(true);
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
case 'artifactViewer': {
|
|
684
|
+
settings.artifactViewer.set(true);
|
|
685
|
+
settings.inlineWidgets.set(false);
|
|
686
|
+
break;
|
|
687
|
+
}
|
|
688
|
+
case 'none': {
|
|
689
|
+
settings.artifactViewer.set(false);
|
|
690
|
+
settings.inlineWidgets.set(false);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
|
|
695
|
+
i18nString(UIStrings.oneOrMoreSettingsHaveChanged));
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
// clang-format off
|
|
699
|
+
return html`
|
|
700
|
+
<p class="settings-experiment">
|
|
701
|
+
<label><input type="radio" name="widgets-choice" @change=${onChange('inlineWidgets')}>${GREENDEV_PROTOTYPE_NAMES['inlineWidgets']}</label>
|
|
702
|
+
</p>
|
|
703
|
+
<p class="settings-experiment">
|
|
704
|
+
<label><input type="radio" name="widgets-choice" @change=${onChange('artifactViewer')}>${GREENDEV_PROTOTYPE_NAMES['artifactViewer']}</label>
|
|
705
|
+
</p>
|
|
706
|
+
<p class="settings-experiment">
|
|
707
|
+
<label><input type="radio" name="widgets-choice" @change=${onChange('none')}>None</label>
|
|
708
|
+
</p>
|
|
709
|
+
`;
|
|
710
|
+
// clang-format on
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function renderPrototypeCheckboxes(
|
|
714
|
+
settings: GreenDev.GreenDevSettings,
|
|
715
|
+
keys: Array<keyof GreenDev.GreenDevSettings>,
|
|
716
|
+
): TemplateResult {
|
|
717
|
+
const {bindToSetting} = UI.UIUtils;
|
|
718
|
+
|
|
719
|
+
function showChangeWarning(): void {
|
|
720
|
+
UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
|
|
721
|
+
i18nString(UIStrings.oneOrMoreSettingsHaveChanged));
|
|
722
|
+
}
|
|
723
|
+
// clang-format off
|
|
724
|
+
const checkboxes = Object.keys(settings).map(name => {
|
|
725
|
+
const settingName = name as keyof GreenDev.GreenDevSettings;
|
|
726
|
+
if(!keys.includes(settingName)) {
|
|
727
|
+
return nothing;
|
|
728
|
+
}
|
|
729
|
+
const setting = settings[settingName];
|
|
730
|
+
const title = GREENDEV_PROTOTYPE_NAMES[settingName];
|
|
731
|
+
return html`<p class="settings-experiment">
|
|
732
|
+
<devtools-checkbox @change=${showChangeWarning} title=${title} ${bindToSetting(setting)}>${title}</devtools-checkbox>
|
|
733
|
+
</p>`;
|
|
734
|
+
});
|
|
735
|
+
return html`${checkboxes}`;
|
|
736
|
+
// clang-format on
|
|
737
|
+
}
|
|
@@ -24,6 +24,14 @@ const UIStrings = {
|
|
|
24
24
|
* @description Text in Settings Screen of the Settings
|
|
25
25
|
*/
|
|
26
26
|
experiments: 'Experiments',
|
|
27
|
+
/**
|
|
28
|
+
* @description Text in Settings Screen of the Settings
|
|
29
|
+
*/
|
|
30
|
+
greenDevProtoTypes: 'GreenDev',
|
|
31
|
+
/**
|
|
32
|
+
* @description Command for showing the GreenDev tab in the Settings Screen
|
|
33
|
+
*/
|
|
34
|
+
showGreenDev: 'Show GreenDev',
|
|
27
35
|
/**
|
|
28
36
|
* @description Title of Ignore list settings
|
|
29
37
|
*/
|
|
@@ -154,6 +162,22 @@ UI.ViewManager.registerViewExtension({
|
|
|
154
162
|
iconName: 'clear-list',
|
|
155
163
|
});
|
|
156
164
|
|
|
165
|
+
UI.ViewManager.registerViewExtension({
|
|
166
|
+
location: UI.ViewManager.ViewLocationValues.SETTINGS_VIEW,
|
|
167
|
+
id: 'greendev-prototypes',
|
|
168
|
+
title: i18nLazyString(UIStrings.greenDevProtoTypes),
|
|
169
|
+
commandPrompt: i18nLazyString(UIStrings.showGreenDev),
|
|
170
|
+
order: 101,
|
|
171
|
+
async loadView() {
|
|
172
|
+
const Settings = await loadSettingsModule();
|
|
173
|
+
return new Settings.SettingsScreen.GreenDevSettingsTab();
|
|
174
|
+
},
|
|
175
|
+
iconName: 'experiment',
|
|
176
|
+
condition: config => {
|
|
177
|
+
return Boolean(config?.devToolsGreenDevUi?.enabled);
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
|
|
157
181
|
UI.ViewManager.registerViewExtension({
|
|
158
182
|
location: UI.ViewManager.ViewLocationValues.SETTINGS_VIEW,
|
|
159
183
|
id: 'keybinds',
|
|
@@ -111,6 +111,8 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
111
111
|
private muteActivateItem?: boolean;
|
|
112
112
|
private lastDebuggerModel: SDK.DebuggerModel.DebuggerModel|null = null;
|
|
113
113
|
|
|
114
|
+
#details: SDK.DebuggerModel.DebuggerPausedDetails|null = null;
|
|
115
|
+
|
|
114
116
|
private constructor() {
|
|
115
117
|
super({
|
|
116
118
|
jslog: `${VisualLogging.section('sources.callstack')}`,
|
|
@@ -196,10 +198,13 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
196
198
|
return callstackSidebarPaneInstance;
|
|
197
199
|
}
|
|
198
200
|
|
|
199
|
-
flavorChanged(
|
|
201
|
+
flavorChanged(details: SDK.DebuggerModel.DebuggerPausedDetails|null): void {
|
|
200
202
|
this.showIgnoreListed = false;
|
|
201
203
|
this.ignoreListCheckboxElement.checked = false;
|
|
202
204
|
this.maxAsyncStackChainDepth = defaultMaxAsyncStackChainDepth;
|
|
205
|
+
this.#details = details;
|
|
206
|
+
this.setSourceMapSubscription(details?.debuggerModel ?? null);
|
|
207
|
+
|
|
203
208
|
this.requestUpdate();
|
|
204
209
|
}
|
|
205
210
|
|
|
@@ -230,8 +235,7 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
230
235
|
|
|
231
236
|
this.callFrameWarningsElement.classList.add('hidden');
|
|
232
237
|
|
|
233
|
-
const details =
|
|
234
|
-
this.setSourceMapSubscription(details?.debuggerModel ?? null);
|
|
238
|
+
const details = this.#details;
|
|
235
239
|
if (!details) {
|
|
236
240
|
this.notPausedMessageElement.classList.remove('hidden');
|
|
237
241
|
this.ignoreListMessageElement.classList.add('hidden');
|