chrome-devtools-frontend 1.0.1652307 → 1.0.1654411
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/fixing-skipped-tests/SKILL.md +32 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
- package/docs/get_the_code.md +1 -2
- package/docs/ui_engineering.md +3 -1
- package/eslint.config.mjs +0 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +13 -8
- package/front_end/core/sdk/CSSMetadata.ts +23 -0
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/EmulationModel.ts +4 -0
- package/front_end/core/sdk/ResourceTreeModel.ts +3 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
- package/front_end/entrypoints/main/MainImpl.ts +0 -6
- package/front_end/foundation/Universe.ts +18 -0
- package/front_end/generated/InspectorBackendCommands.ts +6 -5
- package/front_end/generated/SupportedCSSProperties.js +122 -28
- package/front_end/generated/protocol.ts +58 -0
- package/front_end/models/ai_assistance/AiConversation.ts +2 -1
- package/front_end/models/ai_assistance/README.md +4 -3
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +11 -164
- package/front_end/models/ai_assistance/ai_assistance.ts +6 -2
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
- package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
- package/front_end/models/ai_assistance/tools/README.md +21 -1
- package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
- package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
- package/front_end/models/autofill_manager/AutofillManager.ts +7 -15
- package/front_end/models/bindings/NetworkProject.ts +4 -8
- package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
- package/front_end/models/emulation/DeviceModeModel.ts +24 -0
- package/front_end/models/emulation/EmulatedDevices.ts +108 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
- package/front_end/models/issues_manager/IssuesManager.ts +10 -6
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
- package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
- package/front_end/models/logs/LogManager.ts +25 -10
- package/front_end/models/logs/NetworkLog.ts +24 -19
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +14 -5
- package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +5 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
- package/front_end/models/persistence/PersistenceImpl.ts +4 -5
- package/front_end/models/trace/EntityMapper.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +9 -9
- package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/application/IndexedDBViews.ts +38 -36
- package/front_end/panels/application/components/AdsView.ts +4 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/autofill/autofill-meta.ts +3 -2
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
- package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
- package/front_end/panels/elements/ElementsTreeOutline.ts +5 -0
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +64 -17
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
- package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
- package/front_end/panels/network/NetworkLogView.ts +28 -0
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
- package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
- package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
- package/front_end/panels/timeline/TimelinePanel.ts +32 -8
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +7 -6
- package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
- package/front_end/panels/timeline/components/MetricCard.ts +18 -18
- package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
- package/front_end/panels/timeline/components/metricCard.css +4 -4
- package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
- package/front_end/panels/whats_new/resources/WNDT.md +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
- package/front_end/ui/legacy/ListWidget.ts +12 -0
- package/front_end/ui/legacy/SplitWidget.ts +12 -11
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +23 -19
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
- package/front_end/ui/legacy/treeoutline.css +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +4 -3
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import * as Platform from '../../core/platform/platform.js';
|
|
8
|
+
import * as Root from '../../core/root/root.js';
|
|
8
9
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
10
|
import * as Bindings from '../bindings/bindings.js';
|
|
10
11
|
import * as BreakpointManager from '../breakpoints/breakpoints.js';
|
|
@@ -13,8 +14,6 @@ import * as Workspace from '../workspace/workspace.js';
|
|
|
13
14
|
|
|
14
15
|
import {Automapping, type AutomappingStatus} from './Automapping.js';
|
|
15
16
|
|
|
16
|
-
let persistenceInstance: PersistenceImpl;
|
|
17
|
-
|
|
18
17
|
export class PersistenceImpl extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
19
18
|
readonly #workspace: Workspace.Workspace.WorkspaceImpl;
|
|
20
19
|
readonly #breakpointManager: BreakpointManager.BreakpointManager.BreakpointManager;
|
|
@@ -40,14 +39,14 @@ export class PersistenceImpl extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
40
39
|
breakpointManager: BreakpointManager.BreakpointManager.BreakpointManager|null,
|
|
41
40
|
} = {forceNew: null, workspace: null, breakpointManager: null}): PersistenceImpl {
|
|
42
41
|
const {forceNew, workspace, breakpointManager} = opts;
|
|
43
|
-
if (!
|
|
42
|
+
if (!Root.DevToolsContext.globalInstance().has(PersistenceImpl) || forceNew) {
|
|
44
43
|
if (!workspace || !breakpointManager) {
|
|
45
44
|
throw new Error('Missing arguments for workspace');
|
|
46
45
|
}
|
|
47
|
-
|
|
46
|
+
Root.DevToolsContext.globalInstance().set(PersistenceImpl, new PersistenceImpl(workspace, breakpointManager));
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
return
|
|
49
|
+
return Root.DevToolsContext.globalInstance().get(PersistenceImpl);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
addNetworkInterceptor(interceptor: (arg0: Workspace.UISourceCode.UISourceCode) => boolean): void {
|
|
@@ -118,7 +118,7 @@ export class EntityMapper {
|
|
|
118
118
|
const sourceLocationEvents: Types.Events.Event[] = [];
|
|
119
119
|
// The events that don't match the source location, but that we should keep mapped to its current entity.
|
|
120
120
|
const unrelatedEvents: Types.Events.Event[] = [];
|
|
121
|
-
currentEntityEvents?.forEach(e => {
|
|
121
|
+
currentEntityEvents?.forEach((e: Types.Events.Event) => {
|
|
122
122
|
const cf = Helpers.Trace.getStackTraceTopCallFrameInEventPayload(e);
|
|
123
123
|
|
|
124
124
|
const matchesCallFrame = cf && Helpers.Trace.isMatchingCallFrame(cf, callFrame);
|
|
@@ -371,7 +371,7 @@ function createV2MarkdownRenderer(conversation?: AiAssistanceModel.AiConversatio
|
|
|
371
371
|
const resourceTreeModel = primaryTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel);
|
|
372
372
|
const context = conversation?.selectedContext;
|
|
373
373
|
|
|
374
|
-
if (context instanceof AiAssistanceModel.
|
|
374
|
+
if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
|
|
375
375
|
const focus = context.getItem();
|
|
376
376
|
options.mainFrameId = focus.parsedTrace.data.Meta.mainFrameId;
|
|
377
377
|
options.lookupTraceEvent = focus.lookupEvent.bind(focus);
|
|
@@ -400,7 +400,7 @@ function getMarkdownRenderer(conversation?: AiAssistanceModel.AiConversation.AiC
|
|
|
400
400
|
|
|
401
401
|
const context = conversation?.selectedContext;
|
|
402
402
|
|
|
403
|
-
if (context instanceof AiAssistanceModel.
|
|
403
|
+
if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
|
|
404
404
|
const focus = context.getItem();
|
|
405
405
|
return new PerformanceAgentMarkdownRenderer(focus.parsedTrace.data.Meta.mainFrameId, focus.lookupEvent.bind(focus));
|
|
406
406
|
}
|
|
@@ -640,12 +640,12 @@ function createRequestContext(request: SDK.NetworkRequest.NetworkRequest|
|
|
|
640
640
|
return new AiAssistanceModel.RequestContext.RequestContext(request, calculator);
|
|
641
641
|
}
|
|
642
642
|
|
|
643
|
-
function createPerformanceTraceContext(focus: AiAssistanceModel.AIContext.AgentFocus|
|
|
644
|
-
|
|
643
|
+
function createPerformanceTraceContext(focus: AiAssistanceModel.AIContext.AgentFocus|
|
|
644
|
+
null): AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext|null {
|
|
645
645
|
if (!focus) {
|
|
646
646
|
return null;
|
|
647
647
|
}
|
|
648
|
-
return new AiAssistanceModel.
|
|
648
|
+
return new AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext(focus);
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
function createStorageContext(item: AiAssistanceModel.StorageItem.StorageItem|null):
|
|
@@ -707,7 +707,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
707
707
|
|
|
708
708
|
#selectedFile: AiAssistanceModel.FileContext.FileContext|null = null;
|
|
709
709
|
#selectedElement: AiAssistanceModel.DOMNodeContext.DOMNodeContext|null = null;
|
|
710
|
-
#selectedPerformanceTrace: AiAssistanceModel.
|
|
710
|
+
#selectedPerformanceTrace: AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext|null = null;
|
|
711
711
|
#selectedRequest: AiAssistanceModel.RequestContext.RequestContext|null = null;
|
|
712
712
|
|
|
713
713
|
#selectedAccessibility: AiAssistanceModel.AccessibilityContext.AccessibilityContext|null = null;
|
|
@@ -1307,7 +1307,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1307
1307
|
}
|
|
1308
1308
|
|
|
1309
1309
|
this.#selectedPerformanceTrace =
|
|
1310
|
-
Boolean(ev.data) ? new AiAssistanceModel.
|
|
1310
|
+
Boolean(ev.data) ? new AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext(ev.data) : null;
|
|
1311
1311
|
|
|
1312
1312
|
this.#updateConversationState(this.#conversation);
|
|
1313
1313
|
};
|
|
@@ -1535,7 +1535,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1535
1535
|
if (context instanceof AiAssistanceModel.FileContext.FileContext) {
|
|
1536
1536
|
return Common.Revealer.reveal(context.getItem().uiLocation(0, 0));
|
|
1537
1537
|
}
|
|
1538
|
-
if (context instanceof AiAssistanceModel.
|
|
1538
|
+
if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
|
|
1539
1539
|
const focus = context.getItem();
|
|
1540
1540
|
if (focus.callTree) {
|
|
1541
1541
|
const event = focus.callTree.selectedNode?.event ?? focus.callTree.rootNode.event;
|
|
@@ -1778,7 +1778,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1778
1778
|
this.#selectedElement = data;
|
|
1779
1779
|
} else if (data instanceof AiAssistanceModel.RequestContext.RequestContext) {
|
|
1780
1780
|
this.#selectedRequest = data;
|
|
1781
|
-
} else if (data instanceof AiAssistanceModel.
|
|
1781
|
+
} else if (data instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
|
|
1782
1782
|
this.#selectedPerformanceTrace = data;
|
|
1783
1783
|
|
|
1784
1784
|
} else if (data instanceof AiAssistanceModel.AccessibilityContext.AccessibilityContext) {
|
|
@@ -13,7 +13,10 @@ export async function saveToDisk(conversation: AiAssistanceModel.AiConversation.
|
|
|
13
13
|
const titleFormatted = Platform.StringUtilities.toSnakeCase(conversation.title || '');
|
|
14
14
|
const prefix = 'devtools_';
|
|
15
15
|
const suffix = '.md';
|
|
16
|
-
|
|
16
|
+
// The Windows save dialog / Chrome wrapper limits the suggested filename
|
|
17
|
+
// to 63 characters (due to a 64-byte null-terminated buffer).
|
|
18
|
+
// Capping the total filename length at 63 avoids truncation of the extension.
|
|
19
|
+
const maxTitleLength = 63 - prefix.length - suffix.length;
|
|
17
20
|
let finalTitle = titleFormatted || 'conversation';
|
|
18
21
|
if (finalTitle.length > maxTitleLength) {
|
|
19
22
|
finalTitle = finalTitle.substring(0, maxTitleLength);
|
|
@@ -180,7 +180,7 @@ function getContextRemoveLabel(context: AiAssistanceModel.AiAgent.ConversationCo
|
|
|
180
180
|
if (context instanceof AiAssistanceModel.RequestContext.RequestContext) {
|
|
181
181
|
return lockedString(UIStringsNotTranslate.removeContextRequest);
|
|
182
182
|
}
|
|
183
|
-
if (context instanceof AiAssistanceModel.
|
|
183
|
+
if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
|
|
184
184
|
return lockedString(UIStringsNotTranslate.removeContextPerfInsight);
|
|
185
185
|
}
|
|
186
186
|
if (context instanceof AiAssistanceModel.StorageAgent.StorageContext) {
|
|
@@ -357,7 +357,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
357
357
|
PanelUtils.PanelUtils.getIconForSourceFile(input.context.getItem()) :
|
|
358
358
|
input.context instanceof AiAssistanceModel.AccessibilityContext.AccessibilityContext ?
|
|
359
359
|
html`<devtools-icon class="icon" name="performance" title="Lighthouse"></devtools-icon>` :
|
|
360
|
-
input.context instanceof AiAssistanceModel.
|
|
360
|
+
input.context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext ?
|
|
361
361
|
html`<devtools-icon class="icon" name="performance" title="Performance"></devtools-icon>` :
|
|
362
362
|
input.context instanceof AiAssistanceModel.StorageAgent.StorageContext ?
|
|
363
363
|
html`<devtools-icon class="icon" name="table" title="Storage"></devtools-icon>` :
|
|
@@ -262,9 +262,8 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
262
262
|
private lastKey?: any;
|
|
263
263
|
private summaryBarElement?: HTMLElement;
|
|
264
264
|
|
|
265
|
-
constructor(
|
|
266
|
-
|
|
267
|
-
refreshObjectStoreCallback: () => void) {
|
|
265
|
+
constructor(model: IndexedDBModel, databaseId: DatabaseId, objectStore: ObjectStore, index: Index|null,
|
|
266
|
+
refreshObjectStoreCallback: () => void) {
|
|
268
267
|
super({
|
|
269
268
|
title: i18nString(UIStrings.idb),
|
|
270
269
|
viewId: 'idb',
|
|
@@ -287,8 +286,8 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
287
286
|
this.deleteSelectedButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, _event => {
|
|
288
287
|
void this.deleteButtonClicked(null);
|
|
289
288
|
});
|
|
290
|
-
this.deleteSelectedButton.element.setAttribute(
|
|
291
|
-
|
|
289
|
+
this.deleteSelectedButton.element.setAttribute('jslog',
|
|
290
|
+
`${VisualLogging.action('delete-selected').track({click: true})}`);
|
|
292
291
|
|
|
293
292
|
this.clearButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clearObjectStore), 'clear');
|
|
294
293
|
this.clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {
|
|
@@ -434,8 +433,8 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
434
433
|
this.updateData(false);
|
|
435
434
|
}
|
|
436
435
|
|
|
437
|
-
private populateContextMenu(
|
|
438
|
-
|
|
436
|
+
private populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu,
|
|
437
|
+
gridNode: DataGrid.DataGrid.DataGridNode<unknown>): void {
|
|
439
438
|
const node = (gridNode as IDBDataGridNode);
|
|
440
439
|
if (node.valueObjectPresentation) {
|
|
441
440
|
contextMenu.revealSection().appendItem(i18nString(UIStrings.expandRecursively), () => {
|
|
@@ -510,26 +509,7 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
510
509
|
function callback(this: IDBDataView, entries: Entry[], hasMore: boolean): void {
|
|
511
510
|
this.clear();
|
|
512
511
|
this.entries = entries;
|
|
513
|
-
|
|
514
|
-
for (let i = 0; i < entries.length; ++i) {
|
|
515
|
-
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
516
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
517
|
-
const data: any = {};
|
|
518
|
-
data['number'] = i + skipCount;
|
|
519
|
-
data['key'] = entries[i].key;
|
|
520
|
-
data['primary-key'] = entries[i].primaryKey;
|
|
521
|
-
data['value'] = entries[i].value;
|
|
522
|
-
|
|
523
|
-
const node = new IDBDataGridNode(data);
|
|
524
|
-
this.dataGrid.rootNode().appendChild(node);
|
|
525
|
-
if (data['number'] <= selected) {
|
|
526
|
-
selectedNode = node;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
if (selectedNode) {
|
|
531
|
-
selectedNode.select();
|
|
532
|
-
}
|
|
512
|
+
this.populateDataGrid(entries, skipCount, selected);
|
|
533
513
|
this.pageBackButton.setEnabled(Boolean(skipCount));
|
|
534
514
|
this.pageForwardButton.setEnabled(hasMore);
|
|
535
515
|
this.needsRefresh.setVisible(false);
|
|
@@ -539,16 +519,38 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
539
519
|
|
|
540
520
|
const idbKeyRange = key ? window.IDBKeyRange.lowerBound(key) : null;
|
|
541
521
|
if (this.isIndex && this.index) {
|
|
542
|
-
this.model.loadIndexData(
|
|
543
|
-
|
|
544
|
-
callback.bind(this));
|
|
522
|
+
this.model.loadIndexData(this.databaseId, this.objectStore.name, this.index.name, idbKeyRange, skipCount,
|
|
523
|
+
pageSize, callback.bind(this));
|
|
545
524
|
} else {
|
|
546
|
-
this.model.loadObjectStoreData(
|
|
547
|
-
|
|
525
|
+
this.model.loadObjectStoreData(this.databaseId, this.objectStore.name, idbKeyRange, skipCount, pageSize,
|
|
526
|
+
callback.bind(this));
|
|
548
527
|
}
|
|
549
528
|
void this.model.getMetadata(this.databaseId, this.objectStore).then(this.updateSummaryBar.bind(this));
|
|
550
529
|
}
|
|
551
530
|
|
|
531
|
+
private populateDataGrid(entries: Entry[], skipCount: number, selected: number): void {
|
|
532
|
+
let selectedNode: IDBDataGridNode|null = null;
|
|
533
|
+
for (let i = 0; i < entries.length; ++i) {
|
|
534
|
+
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
535
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
536
|
+
const data: any = {};
|
|
537
|
+
data['number'] = i + skipCount;
|
|
538
|
+
data['key'] = entries[i].key;
|
|
539
|
+
data['primary-key'] = entries[i].primaryKey;
|
|
540
|
+
data['value'] = entries[i].value;
|
|
541
|
+
|
|
542
|
+
const node = new IDBDataGridNode(data);
|
|
543
|
+
this.dataGrid.rootNode().appendChild(node);
|
|
544
|
+
if (data['number'] <= selected) {
|
|
545
|
+
selectedNode = node;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if (selectedNode) {
|
|
550
|
+
selectedNode.select();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
552
554
|
private updateSummaryBar(metadata: ObjectStoreMetadata|null): void {
|
|
553
555
|
if (!this.summaryBarElement) {
|
|
554
556
|
this.summaryBarElement = this.element.createChild('div', 'object-store-summary-bar');
|
|
@@ -578,10 +580,10 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
578
580
|
}
|
|
579
581
|
|
|
580
582
|
private async clearButtonClicked(): Promise<void> {
|
|
581
|
-
const ok =
|
|
582
|
-
i18nString(UIStrings.objectStoreWillBeCleared),
|
|
583
|
-
|
|
584
|
-
|
|
583
|
+
const ok =
|
|
584
|
+
await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.objectStoreWillBeCleared),
|
|
585
|
+
i18nString(UIStrings.confirmClearObjectStore, {PH1: this.objectStore.name}),
|
|
586
|
+
this.element, {jslogContext: 'clear-object-store-confirmation'});
|
|
585
587
|
if (ok) {
|
|
586
588
|
this.clearButton.setEnabled(false);
|
|
587
589
|
this.clearingObjectStore = true;
|
|
@@ -141,6 +141,8 @@ export class AdsView extends UI.Widget.Widget {
|
|
|
141
141
|
averageViewportAdCount: 0,
|
|
142
142
|
totalAdCpuTime: 0,
|
|
143
143
|
totalAdNetworkBytes: 0,
|
|
144
|
+
updateAdFrames: [],
|
|
145
|
+
removeAdFrames: [],
|
|
144
146
|
};
|
|
145
147
|
this.requestUpdate();
|
|
146
148
|
}
|
|
@@ -209,6 +211,8 @@ export class AdsView extends UI.Widget.Widget {
|
|
|
209
211
|
averageViewportAdCount: 0,
|
|
210
212
|
totalAdCpuTime: 0,
|
|
211
213
|
totalAdNetworkBytes: 0,
|
|
214
|
+
updateAdFrames: [],
|
|
215
|
+
removeAdFrames: [],
|
|
212
216
|
};
|
|
213
217
|
this.requestUpdate();
|
|
214
218
|
}
|
|
@@ -298,7 +298,7 @@ export class AutofillView extends UI.Widget.VBox {
|
|
|
298
298
|
#matches: AutofillManager.AutofillManager.Match[] = [];
|
|
299
299
|
#highlightedMatches: AutofillManager.AutofillManager.Match[] = [];
|
|
300
300
|
|
|
301
|
-
constructor(autofillManager
|
|
301
|
+
constructor(autofillManager: AutofillManager.AutofillManager.AutofillManager, view = DEFAULT_VIEW) {
|
|
302
302
|
super({useShadowDom: true});
|
|
303
303
|
this.#autofillManager = autofillManager;
|
|
304
304
|
this.#view = view;
|
|
@@ -36,8 +36,9 @@ UI.ViewManager.registerViewExtension({
|
|
|
36
36
|
commandPrompt: i18nLazyString(UIStrings.showAutofill),
|
|
37
37
|
order: 100,
|
|
38
38
|
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
|
|
39
|
-
async loadView() {
|
|
39
|
+
async loadView(universe) {
|
|
40
40
|
const Autofill = await loadAutofillModule();
|
|
41
|
-
|
|
41
|
+
const {autofillManager} = universe;
|
|
42
|
+
return new Autofill.AutofillView.AutofillView(autofillManager);
|
|
42
43
|
},
|
|
43
44
|
});
|
|
@@ -18,8 +18,10 @@ function isLeafNode(node: SDK.AccessibilityModel.AccessibilityNode): boolean {
|
|
|
18
18
|
return node.numChildren() === 0 && node.role()?.value !== 'Iframe';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function getModel(frameId: Protocol.Page.FrameId
|
|
22
|
-
|
|
21
|
+
function getModel(frameId: Protocol.Page.FrameId,
|
|
22
|
+
frameManager: SDK.FrameManager.FrameManager =
|
|
23
|
+
SDK.FrameManager.FrameManager.instance()): SDK.AccessibilityModel.AccessibilityModel {
|
|
24
|
+
const frame = frameManager.getFrame(frameId);
|
|
23
25
|
const model = frame?.resourceTreeModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
|
|
24
26
|
if (!model) {
|
|
25
27
|
throw new Error('Could not instantiate model for frameId');
|
|
@@ -27,8 +29,11 @@ function getModel(frameId: Protocol.Page.FrameId): SDK.AccessibilityModel.Access
|
|
|
27
29
|
return model;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
export async function getRootNode(
|
|
31
|
-
|
|
32
|
+
export async function getRootNode(
|
|
33
|
+
frameId: Protocol.Page.FrameId,
|
|
34
|
+
frameManager: SDK.FrameManager.FrameManager =
|
|
35
|
+
SDK.FrameManager.FrameManager.instance()): Promise<SDK.AccessibilityModel.AccessibilityNode> {
|
|
36
|
+
const model = getModel(frameId, frameManager);
|
|
32
37
|
const root = await model.requestRootNode(frameId);
|
|
33
38
|
if (!root) {
|
|
34
39
|
throw new Error('No accessibility root for frame');
|
|
@@ -49,33 +54,36 @@ function getFrameIdForNodeOrDocument(node: SDK.DOMModel.DOMNode): Protocol.Page.
|
|
|
49
54
|
return frameId;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
|
-
export async function getNodeAndAncestorsFromDOMNode(
|
|
53
|
-
|
|
57
|
+
export async function getNodeAndAncestorsFromDOMNode(
|
|
58
|
+
domNode: SDK.DOMModel.DOMNode,
|
|
59
|
+
frameManager: SDK.FrameManager.FrameManager =
|
|
60
|
+
SDK.FrameManager.FrameManager.instance()): Promise<SDK.AccessibilityModel.AccessibilityNode[]> {
|
|
54
61
|
let frameId = getFrameIdForNodeOrDocument(domNode);
|
|
55
|
-
const model = getModel(frameId);
|
|
62
|
+
const model = getModel(frameId, frameManager);
|
|
56
63
|
const result = await model.requestAndLoadSubTreeToNode(domNode);
|
|
57
64
|
if (!result) {
|
|
58
65
|
throw new Error('Could not retrieve accessibility node for inspected DOM node');
|
|
59
66
|
}
|
|
60
67
|
|
|
61
|
-
const outermostFrameId =
|
|
68
|
+
const outermostFrameId = frameManager.getOutermostFrame()?.id;
|
|
62
69
|
if (!outermostFrameId) {
|
|
63
70
|
return result;
|
|
64
71
|
}
|
|
65
72
|
while (frameId !== outermostFrameId) {
|
|
66
|
-
const node = await
|
|
73
|
+
const node = await frameManager.getFrame(frameId)?.getOwnerDOMNodeOrDocument();
|
|
67
74
|
if (!node) {
|
|
68
75
|
break;
|
|
69
76
|
}
|
|
70
77
|
frameId = getFrameIdForNodeOrDocument(node);
|
|
71
|
-
const model = getModel(frameId);
|
|
78
|
+
const model = getModel(frameId, frameManager);
|
|
72
79
|
const ancestors = await model.requestAndLoadSubTreeToNode(node);
|
|
73
80
|
result.push(...ancestors || []);
|
|
74
81
|
}
|
|
75
82
|
return result;
|
|
76
83
|
}
|
|
77
84
|
|
|
78
|
-
async function getChildren(node: SDK.AccessibilityModel.AccessibilityNode
|
|
85
|
+
async function getChildren(node: SDK.AccessibilityModel.AccessibilityNode,
|
|
86
|
+
frameManager: SDK.FrameManager.FrameManager = SDK.FrameManager.FrameManager.instance()):
|
|
79
87
|
Promise<SDK.AccessibilityModel.AccessibilityNode[]> {
|
|
80
88
|
if (node.role()?.value === 'Iframe') {
|
|
81
89
|
const domNode = await node.deferredDOMNode()?.resolvePromise();
|
|
@@ -86,13 +94,15 @@ async function getChildren(node: SDK.AccessibilityModel.AccessibilityNode):
|
|
|
86
94
|
if (!frameId) {
|
|
87
95
|
throw new Error('No owner frameId on iframe node');
|
|
88
96
|
}
|
|
89
|
-
const localRoot = await getRootNode(frameId);
|
|
97
|
+
const localRoot = await getRootNode(frameId, frameManager);
|
|
90
98
|
return [localRoot];
|
|
91
99
|
}
|
|
92
100
|
return await node.accessibilityModel().requestAXChildren(node.id(), node.getFrameId() || undefined);
|
|
93
101
|
}
|
|
94
102
|
|
|
95
|
-
export async function sdkNodeToAXTreeNodes(
|
|
103
|
+
export async function sdkNodeToAXTreeNodes(
|
|
104
|
+
sdkNode: SDK.AccessibilityModel.AccessibilityNode,
|
|
105
|
+
frameManager: SDK.FrameManager.FrameManager = SDK.FrameManager.FrameManager.instance()): Promise<AXTreeNode[]> {
|
|
96
106
|
const treeNodeData = sdkNode;
|
|
97
107
|
if (isLeafNode(sdkNode)) {
|
|
98
108
|
return [{
|
|
@@ -104,8 +114,9 @@ export async function sdkNodeToAXTreeNodes(sdkNode: SDK.AccessibilityModel.Acces
|
|
|
104
114
|
return [{
|
|
105
115
|
treeNodeData,
|
|
106
116
|
children: async () => {
|
|
107
|
-
const childNodes = await getChildren(sdkNode);
|
|
108
|
-
const childTreeNodes =
|
|
117
|
+
const childNodes = await getChildren(sdkNode, frameManager);
|
|
118
|
+
const childTreeNodes =
|
|
119
|
+
await Promise.all(childNodes.map(childNode => sdkNodeToAXTreeNodes(childNode, frameManager)));
|
|
109
120
|
return childTreeNodes.flat(1);
|
|
110
121
|
},
|
|
111
122
|
id: getNodeId(sdkNode),
|
|
@@ -19,11 +19,14 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
|
|
|
19
19
|
private inspectedDOMNode: SDK.DOMModel.DOMNode|null = null;
|
|
20
20
|
private root: SDK.AccessibilityModel.AccessibilityNode|null = null;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
readonly #frameManager: SDK.FrameManager.FrameManager;
|
|
23
|
+
|
|
24
|
+
constructor(accessibilityTreeComponent: TreeOutline.TreeOutline.TreeOutline<AccessibilityTreeUtils.AXTreeNodeData>,
|
|
25
|
+
frameManager: SDK.FrameManager.FrameManager = SDK.FrameManager.FrameManager.instance()) {
|
|
24
26
|
super();
|
|
25
27
|
this.registerRequiredCSS(accessibilityTreeViewStyles);
|
|
26
28
|
this.accessibilityTreeComponent = accessibilityTreeComponent;
|
|
29
|
+
this.#frameManager = frameManager;
|
|
27
30
|
|
|
28
31
|
const container = this.contentElement.createChild('div');
|
|
29
32
|
|
|
@@ -75,11 +78,11 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
|
|
|
75
78
|
|
|
76
79
|
async refreshAccessibilityTree(): Promise<void> {
|
|
77
80
|
if (!this.root) {
|
|
78
|
-
const frameId =
|
|
81
|
+
const frameId = this.#frameManager.getOutermostFrame()?.id;
|
|
79
82
|
if (!frameId) {
|
|
80
83
|
throw new Error('No top frame');
|
|
81
84
|
}
|
|
82
|
-
this.root = await AccessibilityTreeUtils.getRootNode(frameId);
|
|
85
|
+
this.root = await AccessibilityTreeUtils.getRootNode(frameId, this.#frameManager);
|
|
83
86
|
if (!this.root) {
|
|
84
87
|
throw new Error('No root');
|
|
85
88
|
}
|
|
@@ -90,15 +93,15 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
|
|
|
90
93
|
|
|
91
94
|
async renderTree(): Promise<void> {
|
|
92
95
|
if (!this.root) {
|
|
93
|
-
const frameId =
|
|
96
|
+
const frameId = this.#frameManager.getOutermostFrame()?.id;
|
|
94
97
|
if (frameId) {
|
|
95
|
-
this.root = await AccessibilityTreeUtils.getRootNode(frameId);
|
|
98
|
+
this.root = await AccessibilityTreeUtils.getRootNode(frameId, this.#frameManager);
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
if (!this.root) {
|
|
99
102
|
return;
|
|
100
103
|
}
|
|
101
|
-
const treeData = await AccessibilityTreeUtils.sdkNodeToAXTreeNodes(this.root);
|
|
104
|
+
const treeData = await AccessibilityTreeUtils.sdkNodeToAXTreeNodes(this.root, this.#frameManager);
|
|
102
105
|
this.accessibilityTreeComponent.data = {
|
|
103
106
|
defaultRenderer: AccessibilityTreeUtils.accessibilityNodeRenderer,
|
|
104
107
|
tree: treeData,
|
|
@@ -113,7 +116,7 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
|
|
|
113
116
|
// Given a selected DOM node, asks the model to load the missing subtree from the root to the
|
|
114
117
|
// selected node and then re-renders the tree.
|
|
115
118
|
async loadSubTreeIntoAccessibilityModel(selectedNode: SDK.DOMModel.DOMNode): Promise<void> {
|
|
116
|
-
const ancestors = await AccessibilityTreeUtils.getNodeAndAncestorsFromDOMNode(selectedNode);
|
|
119
|
+
const ancestors = await AccessibilityTreeUtils.getNodeAndAncestorsFromDOMNode(selectedNode, this.#frameManager);
|
|
117
120
|
const inspectedAXNode = ancestors.find(node => node.backendDOMNodeId() === selectedNode.backendNodeId());
|
|
118
121
|
if (!inspectedAXNode) {
|
|
119
122
|
return;
|
|
@@ -160,7 +163,7 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
|
|
|
160
163
|
void this.renderTree();
|
|
161
164
|
return;
|
|
162
165
|
}
|
|
163
|
-
const outermostFrameId =
|
|
166
|
+
const outermostFrameId = this.#frameManager.getOutermostFrame()?.id;
|
|
164
167
|
if (data.root?.getFrameId() !== outermostFrameId) {
|
|
165
168
|
void this.renderTree();
|
|
166
169
|
return;
|
|
@@ -2136,6 +2136,11 @@ export class ElementsTreeOutline extends
|
|
|
2136
2136
|
visibleChildren.push(pickerIconPseudoElement);
|
|
2137
2137
|
}
|
|
2138
2138
|
|
|
2139
|
+
const interestButtonPseudoElement = node.interestButtonPseudoElement();
|
|
2140
|
+
if (interestButtonPseudoElement) {
|
|
2141
|
+
visibleChildren.push(interestButtonPseudoElement);
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2139
2144
|
const backdropPseudoElement = node.backdropPseudoElement();
|
|
2140
2145
|
if (backdropPseudoElement) {
|
|
2141
2146
|
visibleChildren.push(backdropPseudoElement);
|