chrome-devtools-frontend 1.0.1661063 → 1.0.1662965
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-unicode-escaping/SKILL.md +64 -0
- package/.agents/skills/evaluate-ai-css-completion/SKILL.md +19 -9
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +44 -16
- package/.agents/skills/migrate-chromium-test/SKILL.md +32 -2
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
- package/docs/ui_engineering.md +75 -42
- package/front_end/core/common/SettingRegistration.ts +0 -10
- package/front_end/core/common/Settings.ts +69 -3
- package/front_end/core/platform/ArrayUtilities.ts +10 -0
- package/front_end/core/platform/StringUtilities.ts +38 -6
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -10
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -10
- package/front_end/core/sdk/sdk-meta.ts +0 -1
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +0 -13
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +8 -3
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +7 -2
- package/front_end/foundation/README.md +86 -0
- package/front_end/foundation/Universe.ts +16 -0
- package/front_end/generated/InspectorBackendCommands.ts +6 -19
- package/front_end/generated/protocol-mapping.d.ts +0 -53
- package/front_end/generated/protocol-proxy-api.d.ts +0 -46
- package/front_end/generated/protocol.ts +20 -186
- package/front_end/models/ai_assistance/AiAgent2.ts +3 -3
- package/front_end/models/ai_assistance/AiConversation.ts +21 -10
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +21 -10
- package/front_end/models/ai_assistance/ChangeManager.ts +2 -2
- package/front_end/models/ai_assistance/ExtensionScope.ts +6 -2
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +8 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/badges/UserBadges.ts +31 -17
- package/front_end/models/bindings/CompilerScriptMapping.ts +5 -4
- package/front_end/models/bindings/ContentProviderBasedProject.ts +2 -3
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -3
- package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
- package/front_end/models/bindings/NetworkProject.ts +22 -1
- package/front_end/models/bindings/ResourceMapping.ts +4 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -1
- package/front_end/models/bindings/SASSSourceMapping.ts +4 -3
- package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
- package/front_end/models/emulation/DeviceModeModel.ts +67 -5
- package/front_end/models/extensions/RecorderExtensionEndpoint.ts +7 -5
- package/front_end/models/extensions/RecorderPluginManager.ts +10 -6
- package/front_end/models/har/Log.snapshot.txt +193 -0
- package/front_end/models/har/Log.ts +3 -2
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +14 -5
- package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +8 -9
- package/front_end/models/issues_manager/RelatedIssue.ts +10 -8
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/logs/RequestResolver.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +0 -5
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +8 -6
- package/front_end/models/source_map_scopes/NamesResolver.ts +36 -30
- package/front_end/models/stack_trace/StackTrace.ts +17 -0
- package/front_end/models/trace/handlers/FramesHandler.ts +4 -7
- package/front_end/models/trace/handlers/ModelHandlers.ts +0 -1
- package/front_end/models/trace/handlers/RendererHandler.ts +2 -15
- package/front_end/models/trace/handlers/Threads.ts +4 -11
- package/front_end/models/trace/insights/DOMSize.ts +1 -1
- package/front_end/models/workspace/WorkspaceImpl.ts +1 -10
- package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -44
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/FrameDetailsView.ts +1 -1
- package/front_end/panels/application/IndexedDBModel.ts +0 -10
- package/front_end/panels/application/IndexedDBViews.ts +240 -164
- package/front_end/panels/application/ServiceWorkersView.ts +494 -411
- package/front_end/panels/application/SharedStorageModel.ts +0 -10
- package/front_end/panels/application/application.ts +0 -6
- package/front_end/panels/application/components/AdsView.ts +23 -0
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +1 -1
- package/front_end/panels/application/components/adsView.css +21 -1
- package/front_end/panels/application/components/components.ts +0 -2
- package/front_end/panels/application/indexedDBViews.css +1 -1
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +1 -1
- package/front_end/panels/application/serviceWorkersView.css +40 -4
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +147 -123
- package/front_end/panels/common/ExtensionServer.ts +3 -3
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/emulation/DeviceModeView.ts +139 -70
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +53 -12
- package/front_end/panels/network/NetworkDataGridNode.ts +43 -1
- package/front_end/panels/network/RequestInitiatorView.ts +24 -2
- package/front_end/panels/network/RequestPayloadView.ts +77 -39
- package/front_end/panels/network/components/ResponseHeaderSection.ts +5 -3
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/network/requestInitiatorViewTree.css +5 -0
- package/front_end/panels/profiler/HeapProfileView.ts +198 -79
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -2
- package/front_end/panels/recorder/README.md +1 -2
- package/front_end/panels/recorder/RecorderPanel.ts +1749 -17
- package/front_end/panels/recorder/recorder.ts +0 -2
- package/front_end/panels/settings/AISettingsTab.ts +13 -0
- package/front_end/panels/sources/SourcesNavigator.ts +3 -2
- package/front_end/panels/sources/SourcesView.ts +0 -17
- package/front_end/panels/sources/UISourceCodeFrame.ts +42 -0
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +0 -17
- package/front_end/panels/timeline/ThreadAppender.ts +0 -106
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +11 -5
- package/front_end/ui/components/report_view/report.css +4 -1
- package/front_end/ui/components/spinners/Spinner.ts +29 -32
- package/front_end/ui/components/spinners/spinner.css +32 -84
- package/front_end/ui/legacy/TextPrompt.ts +49 -1
- package/front_end/ui/legacy/Treeoutline.ts +14 -6
- package/front_end/ui/legacy/UIUtils.ts +36 -11
- package/front_end/ui/legacy/Widget.ts +17 -10
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -2
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +36 -7
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +63 -68
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/objectValue.css +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +4 -4
- package/front_end/ui/legacy/textPrompt.css +10 -0
- package/front_end/ui/lit/lit.ts +1 -0
- package/front_end/ui/lit/render.ts +44 -10
- package/front_end/ui/lit/strip-whitespace.ts +23 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
- package/front_end/panels/application/InterestGroupStorageModel.ts +0 -81
- package/front_end/panels/application/InterestGroupStorageView.ts +0 -151
- package/front_end/panels/application/InterestGroupTreeElement.ts +0 -65
- package/front_end/panels/application/components/InterestGroupAccessGrid.ts +0 -135
- package/front_end/panels/application/components/interestGroupAccessGrid.css +0 -27
- package/front_end/panels/application/interestGroupStorageView.css +0 -9
- package/front_end/panels/recorder/RecorderController.ts +0 -1595
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +0 -149
- /package/front_end/panels/recorder/{recorderController.css → recorderPanel.css} +0 -0
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
// Copyright 2014 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
-
|
|
6
|
-
import * as Common from '../../core/common/common.js';
|
|
7
|
-
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
-
import * as Formatter from '../../models/formatter/formatter.js';
|
|
9
|
-
import * as Persistence from '../../models/persistence/persistence.js';
|
|
10
|
-
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
11
|
-
import * as Workspace from '../../models/workspace/workspace.js';
|
|
12
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
type EditorAction,
|
|
16
|
-
type EditorClosedEvent,
|
|
17
|
-
Events,
|
|
18
|
-
registerEditorAction,
|
|
19
|
-
type SourcesView,
|
|
20
|
-
} from './SourcesView.js';
|
|
21
|
-
import type {UISourceCodeFrame} from './UISourceCodeFrame.js';
|
|
22
|
-
|
|
23
|
-
const UIStrings = {
|
|
24
|
-
/**
|
|
25
|
-
* @description Title of the format button in the Sources panel
|
|
26
|
-
* @example {file name} PH1
|
|
27
|
-
*/
|
|
28
|
-
formatS: 'Format {PH1}',
|
|
29
|
-
/**
|
|
30
|
-
* @description Tooltip text that appears when hovering over the largeicon pretty print button in the Inplace Formatter Editor Action of the Sources panel
|
|
31
|
-
*/
|
|
32
|
-
format: 'Format',
|
|
33
|
-
} as const;
|
|
34
|
-
const str_ = i18n.i18n.registerUIStrings('panels/sources/InplaceFormatterEditorAction.ts', UIStrings);
|
|
35
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
36
|
-
|
|
37
|
-
let inplaceFormatterEditorActionInstance: InplaceFormatterEditorAction;
|
|
38
|
-
|
|
39
|
-
export class InplaceFormatterEditorAction implements EditorAction {
|
|
40
|
-
private button!: UI.Toolbar.ToolbarButton;
|
|
41
|
-
private sourcesView!: SourcesView;
|
|
42
|
-
private uiSourceCodeTitleChangedEvent: Common.EventTarget.EventDescriptor|null = null;
|
|
43
|
-
static instance(opts: {
|
|
44
|
-
forceNew: boolean|null,
|
|
45
|
-
} = {forceNew: null}): InplaceFormatterEditorAction {
|
|
46
|
-
const {forceNew} = opts;
|
|
47
|
-
if (!inplaceFormatterEditorActionInstance || forceNew) {
|
|
48
|
-
inplaceFormatterEditorActionInstance = new InplaceFormatterEditorAction();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return inplaceFormatterEditorActionInstance;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
private editorSelected(event: Common.EventTarget.EventTargetEvent<Workspace.UISourceCode.UISourceCode>): void {
|
|
55
|
-
const uiSourceCode = event.data;
|
|
56
|
-
this.updateButton(uiSourceCode);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private editorClosed(event: Common.EventTarget.EventTargetEvent<EditorClosedEvent>): void {
|
|
60
|
-
const {wasSelected} = event.data;
|
|
61
|
-
if (wasSelected) {
|
|
62
|
-
this.updateButton(null);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
private updateButton(uiSourceCode: Workspace.UISourceCode.UISourceCode|null): void {
|
|
67
|
-
if (this.uiSourceCodeTitleChangedEvent) {
|
|
68
|
-
Common.EventTarget.removeEventListeners([this.uiSourceCodeTitleChangedEvent]);
|
|
69
|
-
}
|
|
70
|
-
this.uiSourceCodeTitleChangedEvent = uiSourceCode ?
|
|
71
|
-
uiSourceCode.addEventListener(
|
|
72
|
-
Workspace.UISourceCode.Events.TitleChanged, event => this.updateButton(event.data), this) :
|
|
73
|
-
null;
|
|
74
|
-
const isFormattable = this.isFormattable(uiSourceCode);
|
|
75
|
-
this.button.element.classList.toggle('hidden', !isFormattable);
|
|
76
|
-
if (uiSourceCode && isFormattable) {
|
|
77
|
-
this.button.setTitle(i18nString(UIStrings.formatS, {PH1: uiSourceCode.name()}));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
getOrCreateButton(sourcesView: SourcesView): UI.Toolbar.ToolbarButton {
|
|
82
|
-
if (this.button) {
|
|
83
|
-
return this.button;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
this.sourcesView = sourcesView;
|
|
87
|
-
this.sourcesView.addEventListener(Events.EDITOR_SELECTED, this.editorSelected.bind(this));
|
|
88
|
-
this.sourcesView.addEventListener(Events.EDITOR_CLOSED, this.editorClosed.bind(this));
|
|
89
|
-
|
|
90
|
-
this.button = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.format), 'brackets');
|
|
91
|
-
this.button.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.formatSourceInPlace, this);
|
|
92
|
-
this.updateButton(sourcesView.currentUISourceCode());
|
|
93
|
-
|
|
94
|
-
return this.button;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
private isFormattable(uiSourceCode: Workspace.UISourceCode.UISourceCode|null): boolean {
|
|
98
|
-
if (!uiSourceCode) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
// Only show Format button for editable files
|
|
102
|
-
if (!Persistence.Persistence.PersistenceImpl.instance().hasEditableContent(uiSourceCode)) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
// Only show Format button for JavaScript files. For other file types (JSON, CSS),
|
|
106
|
-
// the pretty-print toggle in the status bar should be used instead, which provides
|
|
107
|
-
// reversible formatting (fixes issue 378870233).
|
|
108
|
-
const mimeType = Common.ResourceType.ResourceType.simplifyContentType(uiSourceCode.mimeType());
|
|
109
|
-
return Common.ResourceType.ResourceType.isJavaScriptMimeType(mimeType);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
private formatSourceInPlace(): void {
|
|
113
|
-
const sourceFrame = this.sourcesView.currentSourceFrame();
|
|
114
|
-
if (!sourceFrame) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const uiSourceCode = sourceFrame.uiSourceCode();
|
|
118
|
-
if (!this.isFormattable(uiSourceCode)) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (uiSourceCode.isDirty()) {
|
|
123
|
-
void this.contentLoaded(uiSourceCode, sourceFrame, uiSourceCode.workingCopy());
|
|
124
|
-
} else {
|
|
125
|
-
void uiSourceCode.requestContentData()
|
|
126
|
-
.then(contentDataOrError => TextUtils.ContentData.ContentData.textOr(contentDataOrError, ''))
|
|
127
|
-
.then(content => {
|
|
128
|
-
void this.contentLoaded(uiSourceCode, sourceFrame, content);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
private async contentLoaded(
|
|
134
|
-
uiSourceCode: Workspace.UISourceCode.UISourceCode, sourceFrame: UISourceCodeFrame,
|
|
135
|
-
content: string): Promise<void> {
|
|
136
|
-
const {formattedContent, formattedMapping} = await Formatter.ScriptFormatter.format(
|
|
137
|
-
Common.Settings.Settings.instance(), uiSourceCode.contentType(), sourceFrame.contentType, content);
|
|
138
|
-
if (uiSourceCode.workingCopy() === formattedContent) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const selection = sourceFrame.textEditor.toLineColumn(sourceFrame.textEditor.state.selection.main.head);
|
|
142
|
-
const [lineNumber, columnNumber] =
|
|
143
|
-
formattedMapping.originalToFormatted(selection.lineNumber, selection.columnNumber);
|
|
144
|
-
uiSourceCode.setWorkingCopy(formattedContent);
|
|
145
|
-
this.sourcesView.showSourceLocation(uiSourceCode, {lineNumber, columnNumber});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
registerEditorAction(InplaceFormatterEditorAction.instance);
|
|
File without changes
|