chrome-devtools-frontend 1.0.1605390 → 1.0.1608453
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/ui_engineering.md +2 -0
- package/eslint.config.mjs +2 -0
- package/front_end/core/common/VersionController.ts +18 -1
- package/front_end/core/host/UserMetrics.ts +0 -3
- package/front_end/core/platform/api/HostRuntime.ts +9 -6
- package/front_end/core/platform/browser/HostRuntime.ts +2 -2
- package/front_end/core/platform/node/HostRuntime.ts +7 -7
- package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
- package/front_end/core/root/ExperimentNames.ts +0 -3
- package/front_end/core/sdk/AccessibilityModel.ts +13 -1
- package/front_end/core/sdk/CrashReportContextModel.ts +28 -0
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -13
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -12
- package/front_end/core/sdk/sdk.ts +2 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +3 -3
- package/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.ts +5 -4
- package/front_end/entrypoints/main/MainImpl.ts +2 -112
- package/front_end/generated/InspectorBackendCommands.ts +3 -33
- package/front_end/generated/SupportedCSSProperties.js +8 -4
- package/front_end/generated/protocol-mapping.d.ts +7 -26
- package/front_end/generated/protocol-proxy-api.d.ts +5 -24
- package/front_end/generated/protocol.ts +2 -296
- package/front_end/models/ai_assistance/ChangeManager.ts +6 -6
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +112 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +0 -24
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +6 -3
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +13 -1
- package/front_end/models/ai_assistance/agents/FileAgent.ts +15 -1
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +15 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +38 -13
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +24 -15
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -2
- package/front_end/{panels/profiler → models/heap_snapshot_model}/ChildrenProvider.ts +3 -4
- package/front_end/{panels/profiler → models/heap_snapshot_model}/HeapSnapshotProxy.ts +21 -42
- package/front_end/models/heap_snapshot_model/heap_snapshot_model.ts +4 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -9
- package/front_end/models/web_mcp/WebMCPModel.ts +187 -0
- package/front_end/models/web_mcp/web_mcp.ts +9 -0
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +53 -10
- package/front_end/panels/accessibility/accessibility.ts +0 -2
- package/front_end/panels/accessibility/accessibilitySidebarView.css +10 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +8 -1
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/AccessibilityAgentMarkdownRenderer.ts +88 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +25 -8
- package/front_end/panels/ai_assistance/components/ChatView.ts +11 -4
- package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +12 -3
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +36 -17
- package/front_end/panels/ai_assistance/components/chatMessage.css +17 -0
- package/front_end/panels/ai_assistance/components/chatView.css +0 -2
- package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +13 -0
- package/front_end/panels/ai_assistance/components/walkthroughView.css +39 -11
- package/front_end/panels/application/CrashReportContextView.ts +237 -0
- package/front_end/panels/application/IndexedDBModel.ts +0 -10
- package/front_end/panels/application/InterestGroupStorageModel.ts +0 -11
- package/front_end/panels/application/SharedStorageModel.ts +0 -11
- package/front_end/panels/application/WebMCPView.ts +389 -74
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/CrashReportContextGrid.ts +154 -0
- package/front_end/panels/application/components/components.ts +2 -0
- package/front_end/panels/application/webMCPView.css +119 -8
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +12 -2
- package/front_end/panels/elements/AccessibilityTreeView.ts +10 -6
- package/front_end/panels/elements/ElementsPanel.ts +9 -50
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -5
- package/front_end/panels/elements/elements-meta.ts +1 -0
- package/front_end/panels/elements/elements.ts +3 -0
- package/front_end/panels/elements/elementsPanel.css +4 -14
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +7 -0
- package/front_end/panels/lighthouse/LighthousePanel.ts +7 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +25 -2
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +23 -13
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +30 -30
- package/front_end/panels/profiler/HeapSnapshotView.ts +23 -29
- package/front_end/panels/profiler/ProfileHeader.ts +1 -4
- package/front_end/panels/profiler/profiler.ts +0 -4
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +27 -22
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +5 -5
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +7 -7
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +1 -3
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +6 -1
- package/front_end/panels/timeline/ThreadAppender.ts +1 -3
- package/front_end/panels/timeline/TimelineController.ts +2 -2
- package/front_end/panels/timeline/TimelinePanel.ts +2 -157
- package/front_end/panels/timeline/TimelineTreeView.ts +43 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +75 -54
- package/front_end/panels/timeline/components/timelineRangeSummaryView.css +8 -0
- package/front_end/panels/timeline/thirdPartyTreeView.css +0 -1
- package/front_end/panels/timeline/timeline-meta.ts +13 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/markdown_view/CodeBlock.ts +47 -1
- package/front_end/ui/components/markdown_view/codeBlock.css +8 -0
- package/front_end/ui/legacy/TabbedPane.ts +126 -4
- package/front_end/ui/legacy/Widget.ts +67 -28
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +3 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +2 -5
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +4 -4
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +5 -1
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/utils/jsUtils.css +2 -0
- package/front_end/ui/legacy/infobar.css +1 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -4
- package/package.json +1 -1
- package/front_end/core/sdk/WebMCPModel.ts +0 -159
- package/front_end/models/ai_assistance/ConversationHandler.ts +0 -325
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +0 -653
package/docs/ui_engineering.md
CHANGED
|
@@ -90,6 +90,8 @@ render(html`
|
|
|
90
90
|
|
|
91
91
|
In this example, the `.title` style will apply within the parent widget but will not leak into the nested widget. Because this convention relies on developer discipline, it is important to verify its correct application during code reviews.
|
|
92
92
|
|
|
93
|
+
**Note:** Inside a `<devtools-data-grid>`, any `<style>` tags must be placed as direct children of the `<table>` element.
|
|
94
|
+
|
|
93
95
|
## Examples
|
|
94
96
|
|
|
95
97
|
```html
|
package/eslint.config.mjs
CHANGED
|
@@ -763,6 +763,8 @@ export default defineConfig([
|
|
|
763
763
|
'@devtools/prefer-url-string': 'error',
|
|
764
764
|
'@devtools/trace-engine-test-timeouts': 'error',
|
|
765
765
|
'@devtools/no-document-body-mutation': 'error',
|
|
766
|
+
// Don't update the KnownContext with test data.
|
|
767
|
+
'@devtools/jslog-context-list': 'off',
|
|
766
768
|
'@devtools/enforce-custom-element-definitions-location': 'off',
|
|
767
769
|
'@devtools/enforce-custom-element-prefix': 'off',
|
|
768
770
|
},
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Platform from '../platform/platform.js';
|
|
6
|
+
import * as Root from '../root/root.js';
|
|
6
7
|
|
|
7
8
|
/* eslint @devtools/enforce-version-controller-methods: "error" */
|
|
8
9
|
|
|
@@ -16,7 +17,7 @@ export class VersionController {
|
|
|
16
17
|
static readonly SYNCED_VERSION_SETTING_NAME = 'syncedInspectorVersion';
|
|
17
18
|
static readonly LOCAL_VERSION_SETTING_NAME = 'localInspectorVersion';
|
|
18
19
|
|
|
19
|
-
static readonly CURRENT_VERSION =
|
|
20
|
+
static readonly CURRENT_VERSION = 43;
|
|
20
21
|
|
|
21
22
|
readonly #settings: Settings;
|
|
22
23
|
readonly #globalVersionSetting: Setting<number>;
|
|
@@ -831,6 +832,22 @@ export class VersionController {
|
|
|
831
832
|
recordingsSetting.set(recordings);
|
|
832
833
|
}
|
|
833
834
|
|
|
835
|
+
updateVersionFrom42To43(): void {
|
|
836
|
+
const timelineShowAllEventsExperimentEnabled =
|
|
837
|
+
Root.Runtime.experiments.getValueFromStorage('timeline-show-all-events' as Root.ExperimentNames.ExperimentName);
|
|
838
|
+
if (timelineShowAllEventsExperimentEnabled !== undefined) {
|
|
839
|
+
if (this.#settings.syncedStorage.has('timeline-show-all-events')) {
|
|
840
|
+
return; // Already migrated
|
|
841
|
+
}
|
|
842
|
+
try {
|
|
843
|
+
const timelineShowAllEventsSetting = this.#settings.moduleSetting('timeline-show-all-events');
|
|
844
|
+
timelineShowAllEventsSetting.set(timelineShowAllEventsExperimentEnabled);
|
|
845
|
+
} catch {
|
|
846
|
+
// If the setting is not registered yet (e.g. in tests), skip.
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
834
851
|
/*
|
|
835
852
|
* Any new migration should be added before this comment.
|
|
836
853
|
*
|
|
@@ -815,12 +815,9 @@ export enum DevtoolsExperiments {
|
|
|
815
815
|
'live-heap-profile' = 11,
|
|
816
816
|
'protocol-monitor' = 13,
|
|
817
817
|
'sampling-heap-profiler-timeline' = 17,
|
|
818
|
-
'show-option-to-expose-internals-in-heap-snapshot' = 18,
|
|
819
818
|
'timeline-invalidation-tracking' = 26,
|
|
820
|
-
'timeline-show-all-events' = 27,
|
|
821
819
|
apca = 39,
|
|
822
820
|
'font-editor' = 41,
|
|
823
|
-
'full-accessibility-tree' = 42,
|
|
824
821
|
'instrumentation-breakpoints' = 61,
|
|
825
822
|
'use-source-map-scopes' = 76,
|
|
826
823
|
'timeline-debug-mode' = 93,
|
|
@@ -25,21 +25,24 @@ export interface Worker {
|
|
|
25
25
|
set onerror(listener: (event: any) => void);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
type WorkerMessagePort = typeof MessagePort.prototype;
|
|
29
|
+
|
|
28
30
|
/**
|
|
29
|
-
* Currently we
|
|
31
|
+
* Currently we only transfer MessagePorts to workers, but it's possible to add
|
|
30
32
|
* more things (like ReadableStream) as long as it's present in all runtimes.
|
|
31
33
|
*/
|
|
32
|
-
export type WorkerTransferable =
|
|
34
|
+
export type WorkerTransferable = WorkerMessagePort;
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* Used by workers to communicate with their parent.
|
|
36
38
|
*/
|
|
37
39
|
export interface WorkerScope {
|
|
38
40
|
postMessage(message: unknown): void;
|
|
39
|
-
set onmessage(listener: (event: WorkerMessageEvent) => void);
|
|
41
|
+
set onmessage(listener: (event: WorkerMessageEvent) => Promise<void>| void);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
readonly data:
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
export interface WorkerMessageEvent<T = any> {
|
|
46
|
+
readonly data: T;
|
|
47
|
+
ports: readonly WorkerMessagePort[];
|
|
45
48
|
}
|
|
@@ -9,8 +9,8 @@ class WebWorkerScope implements Api.HostRuntime.WorkerScope {
|
|
|
9
9
|
self.postMessage(message);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
set onmessage(listener: (event: Api.HostRuntime.WorkerMessageEvent) => void) {
|
|
13
|
-
self.
|
|
12
|
+
set onmessage(listener: (event: Api.HostRuntime.WorkerMessageEvent) => Promise<void>| void) {
|
|
13
|
+
self.addEventListener('message', listener);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -12,8 +12,8 @@ class NodeWorkerScope implements Api.HostRuntime.WorkerScope {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
set onmessage(listener: (event: Api.HostRuntime.WorkerMessageEvent) => void) {
|
|
15
|
-
WorkerThreads.parentPort?.
|
|
16
|
-
listener(
|
|
15
|
+
WorkerThreads.parentPort?.addEventListener('message', msg => {
|
|
16
|
+
listener(msg as unknown as Api.HostRuntime.WorkerMessageEvent);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -36,10 +36,10 @@ class NodeWorker implements Api.HostRuntime.Worker {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
postMessage(message: unknown): void {
|
|
39
|
+
postMessage(message: unknown, transfer?: Api.HostRuntime.WorkerTransferable[]): void {
|
|
40
40
|
void this.#workerPromise.then(worker => {
|
|
41
41
|
if (!this.#disposed) {
|
|
42
|
-
worker.postMessage(message);
|
|
42
|
+
worker.postMessage(message, transfer as unknown as WorkerThreads.Transferable[]);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -56,11 +56,11 @@ class NodeWorker implements Api.HostRuntime.Worker {
|
|
|
56
56
|
this.dispose();
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
set onmessage(listener: (event:
|
|
59
|
+
set onmessage(listener: (event: Api.HostRuntime.WorkerMessageEvent) => void) {
|
|
60
60
|
void this.#workerPromise.then(worker => {
|
|
61
|
-
worker.on('message', data => {
|
|
61
|
+
worker.on('message', (data: unknown) => {
|
|
62
62
|
if (!this.#disposed) {
|
|
63
|
-
listener({data});
|
|
63
|
+
listener({data, ports: []});
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
});
|
|
@@ -351,6 +351,10 @@ export class TargetBase {
|
|
|
351
351
|
return this.getAgent('CacheStorage');
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
crashReportContextAgent(): ProtocolProxyApi.CrashReportContextApi {
|
|
355
|
+
return this.getAgent('CrashReportContext');
|
|
356
|
+
}
|
|
357
|
+
|
|
354
358
|
cssAgent(): ProtocolProxyApi.CSSApi {
|
|
355
359
|
return this.getAgent('CSS');
|
|
356
360
|
}
|
|
@@ -8,12 +8,9 @@ export enum ExperimentName {
|
|
|
8
8
|
LIVE_HEAP_PROFILE = 'live-heap-profile',
|
|
9
9
|
PROTOCOL_MONITOR = 'protocol-monitor',
|
|
10
10
|
SAMPLING_HEAP_PROFILER_TIMELINE = 'sampling-heap-profiler-timeline',
|
|
11
|
-
SHOW_OPTION_TO_EXPOSE_INTERNALS_IN_HEAP_SNAPSHOT = 'show-option-to-expose-internals-in-heap-snapshot',
|
|
12
11
|
TIMELINE_INVALIDATION_TRACKING = 'timeline-invalidation-tracking',
|
|
13
|
-
TIMELINE_SHOW_ALL_EVENTS = 'timeline-show-all-events',
|
|
14
12
|
APCA = 'apca',
|
|
15
13
|
FONT_EDITOR = 'font-editor',
|
|
16
|
-
FULL_ACCESSIBILITY_TREE = 'full-accessibility-tree',
|
|
17
14
|
INSTRUMENTATION_BREAKPOINTS = 'instrumentation-breakpoints',
|
|
18
15
|
USE_SOURCE_MAP_SCOPES = 'use-source-map-scopes',
|
|
19
16
|
TIMELINE_DEBUG_MODE = 'timeline-debug-mode',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
6
|
import type * as Protocol from '../../generated/protocol.js';
|
|
7
7
|
|
|
8
|
-
import {DeferredDOMNode, type DOMNode} from './DOMModel.js';
|
|
8
|
+
import {DeferredDOMNode, DOMModel, type DOMNode, Events as DOMModelEvents} from './DOMModel.js';
|
|
9
9
|
import {SDKModel} from './SDKModel.js';
|
|
10
10
|
import {Capability, type Target} from './Target.js';
|
|
11
11
|
|
|
@@ -213,6 +213,18 @@ export class AccessibilityModel extends SDKModel<EventTypes> implements Protocol
|
|
|
213
213
|
target.registerAccessibilityDispatcher(this);
|
|
214
214
|
this.agent = target.accessibilityAgent();
|
|
215
215
|
void this.resumeModel();
|
|
216
|
+
|
|
217
|
+
const domModel = target.model(DOMModel);
|
|
218
|
+
if (domModel) {
|
|
219
|
+
domModel.addEventListener(DOMModelEvents.NodeRemoved, () => {
|
|
220
|
+
this.clear();
|
|
221
|
+
this.dispatchEventToListeners(Events.TREE_UPDATED, {});
|
|
222
|
+
});
|
|
223
|
+
domModel.addEventListener(DOMModelEvents.NodeInserted, () => {
|
|
224
|
+
this.clear();
|
|
225
|
+
this.dispatchEventToListeners(Events.TREE_UPDATED, {});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
216
228
|
}
|
|
217
229
|
|
|
218
230
|
clear(): void {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2026 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
|
+
|
|
5
|
+
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
|
+
import type * as Protocol from '../../generated/protocol.js';
|
|
7
|
+
|
|
8
|
+
import {SDKModel} from './SDKModel.js';
|
|
9
|
+
import {Capability, type Target} from './Target.js';
|
|
10
|
+
|
|
11
|
+
export class CrashReportContextModel extends SDKModel<void> {
|
|
12
|
+
readonly #agent: ProtocolProxyApi.CrashReportContextApi;
|
|
13
|
+
|
|
14
|
+
constructor(target: Target) {
|
|
15
|
+
super(target);
|
|
16
|
+
this.#agent = target.crashReportContextAgent();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async getEntries(): Promise<Protocol.CrashReportContext.CrashReportContextEntry[]|null> {
|
|
20
|
+
const response = await this.#agent.invoke_getEntries();
|
|
21
|
+
if (response.getError()) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return response.entries;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
SDKModel.register(CrashReportContextModel, {capabilities: Capability.JS, autostart: false});
|
|
@@ -265,9 +265,6 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
attributionReportingTriggerRegistered(_event: Protocol.Storage.AttributionReportingTriggerRegisteredEvent): void {
|
|
269
|
-
}
|
|
270
|
-
|
|
271
268
|
indexedDBListUpdated(_event: Protocol.Storage.IndexedDBListUpdatedEvent): void {
|
|
272
269
|
}
|
|
273
270
|
|
|
@@ -300,16 +297,6 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
|
|
|
300
297
|
setThrottlerSchedulesAsSoonAsPossibleForTest(): void {
|
|
301
298
|
this.#scheduleAsSoonAsPossible = true;
|
|
302
299
|
}
|
|
303
|
-
|
|
304
|
-
attributionReportingSourceRegistered(_event: Protocol.Storage.AttributionReportingSourceRegisteredEvent): void {
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
attributionReportingReportSent(_event: Protocol.Storage.AttributionReportingReportSentEvent): void {
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
attributionReportingVerboseDebugReportSent(_event: Protocol.Storage.AttributionReportingVerboseDebugReportSentEvent):
|
|
311
|
-
void {
|
|
312
|
-
}
|
|
313
300
|
}
|
|
314
301
|
|
|
315
302
|
export const enum Events {
|
|
@@ -142,9 +142,6 @@ export class StorageBucketsModel extends SDKModel<EventTypes> implements Protoco
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
attributionReportingTriggerRegistered(_event: Protocol.Storage.AttributionReportingTriggerRegisteredEvent): void {
|
|
146
|
-
}
|
|
147
|
-
|
|
148
145
|
interestGroupAccessed(_event: Protocol.Storage.InterestGroupAccessedEvent): void {
|
|
149
146
|
}
|
|
150
147
|
|
|
@@ -173,15 +170,6 @@ export class StorageBucketsModel extends SDKModel<EventTypes> implements Protoco
|
|
|
173
170
|
sharedStorageWorkletOperationExecutionFinished(
|
|
174
171
|
_event: Protocol.Storage.SharedStorageWorkletOperationExecutionFinishedEvent): void {
|
|
175
172
|
}
|
|
176
|
-
|
|
177
|
-
attributionReportingSourceRegistered(_event: Protocol.Storage.AttributionReportingSourceRegisteredEvent): void {
|
|
178
|
-
}
|
|
179
|
-
attributionReportingReportSent(_event: Protocol.Storage.AttributionReportingReportSentEvent): void {
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
attributionReportingVerboseDebugReportSent(_event: Protocol.Storage.AttributionReportingVerboseDebugReportSentEvent):
|
|
183
|
-
void {
|
|
184
|
-
}
|
|
185
173
|
}
|
|
186
174
|
|
|
187
175
|
SDKModel.register(StorageBucketsModel, {capabilities: Capability.STORAGE, autostart: false});
|
|
@@ -22,6 +22,7 @@ import * as CookieModel from './CookieModel.js';
|
|
|
22
22
|
import * as CookieParser from './CookieParser.js';
|
|
23
23
|
import * as CPUProfilerModel from './CPUProfilerModel.js';
|
|
24
24
|
import * as CPUThrottlingManager from './CPUThrottlingManager.js';
|
|
25
|
+
import * as CrashReportContextModel from './CrashReportContextModel.js';
|
|
25
26
|
import * as CSSContainerQuery from './CSSContainerQuery.js';
|
|
26
27
|
import * as CSSFontFace from './CSSFontFace.js';
|
|
27
28
|
import * as CSSLayer from './CSSLayer.js';
|
|
@@ -90,7 +91,6 @@ import * as Target from './Target.js';
|
|
|
90
91
|
import * as TargetManager from './TargetManager.js';
|
|
91
92
|
import * as TraceObject from './TraceObject.js';
|
|
92
93
|
import * as WebAuthnModel from './WebAuthnModel.js';
|
|
93
|
-
import * as WebMCPModel from './WebMCPModel.js';
|
|
94
94
|
|
|
95
95
|
export {
|
|
96
96
|
AccessibilityModel,
|
|
@@ -106,6 +106,7 @@ export {
|
|
|
106
106
|
CookieParser,
|
|
107
107
|
CPUProfilerModel,
|
|
108
108
|
CPUThrottlingManager,
|
|
109
|
+
CrashReportContextModel,
|
|
109
110
|
CSSContainerQuery,
|
|
110
111
|
CSSFontFace,
|
|
111
112
|
CSSLayer,
|
|
@@ -174,5 +175,4 @@ export {
|
|
|
174
175
|
TargetManager,
|
|
175
176
|
TraceObject,
|
|
176
177
|
WebAuthnModel,
|
|
177
|
-
WebMCPModel,
|
|
178
178
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import type * as PlatformApi from '../../core/platform/api/api.js';
|
|
5
6
|
import * as HeapSnapshotModel from '../../models/heap_snapshot_model/heap_snapshot_model.js';
|
|
6
7
|
|
|
7
8
|
// We mirror what heap_snapshot_worker.ts does, but we can't use it here as we'd have a
|
|
@@ -33,9 +34,8 @@ export class HeapSnapshotWorkerDispatcher {
|
|
|
33
34
|
this.#postMessage({eventName: name, data});
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
async dispatchMessage({data, ports}:
|
|
37
|
-
|
|
38
|
-
Promise<void> {
|
|
37
|
+
async dispatchMessage({data, ports}: PlatformApi.HostRuntime
|
|
38
|
+
.WorkerMessageEvent<HeapSnapshotModel.HeapSnapshotModel.WorkerCommand>): Promise<void> {
|
|
39
39
|
const response: DispatcherResponse = {
|
|
40
40
|
callId: data.callId,
|
|
41
41
|
result: null,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright 2020 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
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
4
5
|
|
|
5
6
|
import * as HeapSnapshotWorker from './heap_snapshot_worker.js';
|
|
6
7
|
|
|
7
|
-
const dispatcher =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const dispatcher = new HeapSnapshotWorker.HeapSnapshotWorkerDispatcher.HeapSnapshotWorkerDispatcher(
|
|
9
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage.bind(Platform.HostRuntime.HOST_RUNTIME.workerScope));
|
|
10
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.onmessage = dispatcher.dispatchMessage.bind(dispatcher);
|
|
11
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage('workerReady');
|
|
@@ -121,10 +121,6 @@ const UIStrings = {
|
|
|
121
121
|
* @description Text describing how to navigate the dock side menu
|
|
122
122
|
*/
|
|
123
123
|
dockSideNavigation: 'Use left and right arrow keys to navigate the options',
|
|
124
|
-
/**
|
|
125
|
-
* @description Notification shown to the user whenever DevTools receives an external request.
|
|
126
|
-
*/
|
|
127
|
-
externalRequestReceived: '`DevTools` received an external request',
|
|
128
124
|
/**
|
|
129
125
|
* @description Notification shown to the user whenever DevTools has finished downloading a local AI model.
|
|
130
126
|
*/
|
|
@@ -203,6 +199,8 @@ export class MainImpl {
|
|
|
203
199
|
this.#universe = new Foundation.Universe.Universe(creationOptions);
|
|
204
200
|
Root.DevToolsContext.setGlobalInstance(this.#universe.context as Root.DevToolsContext.WritableDevToolsContext);
|
|
205
201
|
|
|
202
|
+
Root.Runtime.experiments.cleanUpStaleExperiments();
|
|
203
|
+
|
|
206
204
|
await this.requestAndRegisterLocaleData();
|
|
207
205
|
|
|
208
206
|
Host.userMetrics.syncSetting(Common.Settings.Settings.instance().moduleSetting<boolean>('sync-preferences').get());
|
|
@@ -360,15 +358,10 @@ export class MainImpl {
|
|
|
360
358
|
Root.ExperimentNames.ExperimentName.PROTOCOL_MONITOR, protocolMonitorExperiment);
|
|
361
359
|
Root.Runtime.experiments.register(
|
|
362
360
|
Root.ExperimentNames.ExperimentName.SAMPLING_HEAP_PROFILER_TIMELINE, 'Sampling heap profiler timeline');
|
|
363
|
-
Root.Runtime.experiments.register(
|
|
364
|
-
Root.ExperimentNames.ExperimentName.SHOW_OPTION_TO_EXPOSE_INTERNALS_IN_HEAP_SNAPSHOT,
|
|
365
|
-
'Show option to expose internals in heap snapshots');
|
|
366
361
|
|
|
367
362
|
// Timeline
|
|
368
363
|
Root.Runtime.experiments.register(
|
|
369
364
|
Root.ExperimentNames.ExperimentName.TIMELINE_INVALIDATION_TRACKING, 'Performance panel: invalidation tracking');
|
|
370
|
-
Root.Runtime.experiments.register(
|
|
371
|
-
Root.ExperimentNames.ExperimentName.TIMELINE_SHOW_ALL_EVENTS, 'Performance panel: show all events');
|
|
372
365
|
Root.Runtime.experiments.register(
|
|
373
366
|
Root.ExperimentNames.ExperimentName.TIMELINE_DEBUG_MODE,
|
|
374
367
|
'Performance panel: debug mode (trace event details, etc)');
|
|
@@ -385,13 +378,6 @@ export class MainImpl {
|
|
|
385
378
|
'Advanced Perceptual Contrast Algorithm (APCA) replacing previous contrast ratio and AA/AAA guidelines',
|
|
386
379
|
'https://developer.chrome.com/blog/new-in-devtools-89/#apca');
|
|
387
380
|
|
|
388
|
-
// Full Accessibility Tree
|
|
389
|
-
Root.Runtime.experiments.register(
|
|
390
|
-
Root.ExperimentNames.ExperimentName.FULL_ACCESSIBILITY_TREE,
|
|
391
|
-
'Full accessibility tree view in the Elements panel',
|
|
392
|
-
'https://developer.chrome.com/blog/new-in-devtools-90/#accessibility-tree',
|
|
393
|
-
'https://g.co/devtools/a11y-tree-feedback');
|
|
394
|
-
|
|
395
381
|
// Font Editor
|
|
396
382
|
Root.Runtime.experiments.register(
|
|
397
383
|
Root.ExperimentNames.ExperimentName.FONT_EDITOR, 'New font editor in the Styles tab',
|
|
@@ -414,11 +400,9 @@ export class MainImpl {
|
|
|
414
400
|
});
|
|
415
401
|
|
|
416
402
|
Root.Runtime.experiments.enableExperimentsByDefault([
|
|
417
|
-
Root.ExperimentNames.ExperimentName.FULL_ACCESSIBILITY_TREE,
|
|
418
403
|
Root.ExperimentNames.ExperimentName.USE_SOURCE_MAP_SCOPES,
|
|
419
404
|
]);
|
|
420
405
|
|
|
421
|
-
Root.Runtime.experiments.cleanUpStaleExperiments();
|
|
422
406
|
const enabledExperiments = Root.Runtime.Runtime.queryParam('enabledExperiments');
|
|
423
407
|
if (enabledExperiments) {
|
|
424
408
|
Root.Runtime.experiments.setServerEnabledExperiments(enabledExperiments.split(';'));
|
|
@@ -581,14 +565,6 @@ export class MainImpl {
|
|
|
581
565
|
});
|
|
582
566
|
}
|
|
583
567
|
|
|
584
|
-
const conversationHandler = AiAssistanceModel.ConversationHandler.ConversationHandler.instance();
|
|
585
|
-
conversationHandler.addEventListener(
|
|
586
|
-
AiAssistanceModel.ConversationHandler.ConversationHandlerEvents.EXTERNAL_REQUEST_RECEIVED,
|
|
587
|
-
() => Snackbar.Snackbar.Snackbar.show({message: i18nString(UIStrings.externalRequestReceived)}));
|
|
588
|
-
conversationHandler.addEventListener(
|
|
589
|
-
AiAssistanceModel.ConversationHandler.ConversationHandlerEvents.EXTERNAL_CONVERSATION_STARTED,
|
|
590
|
-
event => void VisualLogging.logFunctionCall(`start-conversation-${event.data}`, 'external'));
|
|
591
|
-
|
|
592
568
|
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
593
569
|
await PanelCommon.GeminiRebrandPromoDialog.maybeShow();
|
|
594
570
|
}
|
|
@@ -1104,89 +1080,3 @@ export class ReloadActionDelegate implements UI.ActionRegistration.ActionDelegat
|
|
|
1104
1080
|
return false;
|
|
1105
1081
|
}
|
|
1106
1082
|
}
|
|
1107
|
-
|
|
1108
|
-
type ExternalRequestInput = {
|
|
1109
|
-
kind: 'LIVE_STYLE_DEBUGGER',
|
|
1110
|
-
args: {prompt: string, selector: string},
|
|
1111
|
-
}|{
|
|
1112
|
-
kind: 'PERFORMANCE_RELOAD_GATHER_INSIGHTS',
|
|
1113
|
-
}|{
|
|
1114
|
-
kind: 'PERFORMANCE_ANALYZE',
|
|
1115
|
-
args: {prompt: string},
|
|
1116
|
-
}|{
|
|
1117
|
-
kind: 'NETWORK_DEBUGGER',
|
|
1118
|
-
args: {requestUrl: string, prompt: string},
|
|
1119
|
-
};
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* For backwards-compatibility we iterate over the generator and drop the
|
|
1123
|
-
* intermediate results. The final response is transformed to its legacy type.
|
|
1124
|
-
* Instead of sending responses of type error, errors are throws.
|
|
1125
|
-
**/
|
|
1126
|
-
export async function handleExternalRequest(input: ExternalRequestInput):
|
|
1127
|
-
Promise<{response: string, devToolsLogs: object[]}> {
|
|
1128
|
-
const generator = await handleExternalRequestGenerator(input);
|
|
1129
|
-
let result: IteratorResult<
|
|
1130
|
-
AiAssistanceModel.AiAgent.ExternalRequestResponse, AiAssistanceModel.AiAgent.ExternalRequestResponse>;
|
|
1131
|
-
do {
|
|
1132
|
-
result = await generator.next();
|
|
1133
|
-
} while (!result.done);
|
|
1134
|
-
const response = result.value;
|
|
1135
|
-
if (response.type === AiAssistanceModel.AiAgent.ExternalRequestResponseType.ERROR) {
|
|
1136
|
-
throw new Error(response.message);
|
|
1137
|
-
}
|
|
1138
|
-
if (response.type === AiAssistanceModel.AiAgent.ExternalRequestResponseType.ANSWER) {
|
|
1139
|
-
return {
|
|
1140
|
-
response: response.message,
|
|
1141
|
-
devToolsLogs: response.devToolsLogs,
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
throw new Error('Received no response of type answer or type error');
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
// @ts-expect-error
|
|
1148
|
-
globalThis.handleExternalRequest = handleExternalRequest;
|
|
1149
|
-
|
|
1150
|
-
export async function handleExternalRequestGenerator(input: ExternalRequestInput): Promise<AsyncGenerator<
|
|
1151
|
-
AiAssistanceModel.AiAgent.ExternalRequestResponse, AiAssistanceModel.AiAgent.ExternalRequestResponse>> {
|
|
1152
|
-
switch (input.kind) {
|
|
1153
|
-
case 'PERFORMANCE_RELOAD_GATHER_INSIGHTS': {
|
|
1154
|
-
const TimelinePanel = await import('../../panels/timeline/timeline.js');
|
|
1155
|
-
return TimelinePanel.TimelinePanel.TimelinePanel.handleExternalRecordRequest();
|
|
1156
|
-
}
|
|
1157
|
-
case 'PERFORMANCE_ANALYZE': {
|
|
1158
|
-
const TimelinePanel = await import('../../panels/timeline/timeline.js');
|
|
1159
|
-
return await TimelinePanel.TimelinePanel.TimelinePanel.handleExternalAnalyzeRequest(input.args.prompt);
|
|
1160
|
-
}
|
|
1161
|
-
case 'NETWORK_DEBUGGER': {
|
|
1162
|
-
const AiAssistanceModel = await import('../../models/ai_assistance/ai_assistance.js');
|
|
1163
|
-
const conversationHandler = AiAssistanceModel.ConversationHandler.ConversationHandler.instance();
|
|
1164
|
-
return await conversationHandler.handleExternalRequest({
|
|
1165
|
-
conversationType: AiAssistanceModel.AiHistoryStorage.ConversationType.NETWORK,
|
|
1166
|
-
prompt: input.args.prompt,
|
|
1167
|
-
requestUrl: input.args.requestUrl,
|
|
1168
|
-
});
|
|
1169
|
-
}
|
|
1170
|
-
case 'LIVE_STYLE_DEBUGGER': {
|
|
1171
|
-
const AiAssistanceModel = await import('../../models/ai_assistance/ai_assistance.js');
|
|
1172
|
-
const conversationHandler = AiAssistanceModel.ConversationHandler.ConversationHandler.instance();
|
|
1173
|
-
return await conversationHandler.handleExternalRequest({
|
|
1174
|
-
conversationType: AiAssistanceModel.AiHistoryStorage.ConversationType.STYLING,
|
|
1175
|
-
prompt: input.args.prompt,
|
|
1176
|
-
selector: input.args.selector,
|
|
1177
|
-
});
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
// eslint-disable-next-line require-yield
|
|
1181
|
-
return (async function*(): AsyncGenerator<
|
|
1182
|
-
AiAssistanceModel.AiAgent.ExternalRequestResponse, AiAssistanceModel.AiAgent.ExternalRequestResponse> {
|
|
1183
|
-
return {
|
|
1184
|
-
type: AiAssistanceModel.AiAgent.ExternalRequestResponseType.ERROR,
|
|
1185
|
-
// @ts-expect-error
|
|
1186
|
-
message: `Debugging with an agent of type '${input.kind}' is not implemented yet.`,
|
|
1187
|
-
};
|
|
1188
|
-
})();
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
// @ts-expect-error
|
|
1192
|
-
globalThis.handleExternalRequestGenerator = handleExternalRequestGenerator;
|