chrome-devtools-frontend 1.0.1519267 → 1.0.1520535
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/config/owner/COMMON_OWNERS +1 -2
- package/config/typescript/tsconfig.eslint.json +12 -1
- package/docs/ui_engineering.md +1011 -0
- package/front_end/core/host/GdpClient.ts +26 -5
- package/front_end/core/sdk/NetworkManager.ts +1 -0
- package/front_end/core/sdk/NetworkRequest.ts +10 -0
- package/front_end/entrypoints/main/MainImpl.ts +6 -1
- package/front_end/entrypoints/main/main-meta.ts +3 -3
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +50 -48
- package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +4 -4
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +128 -30
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +98 -63
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +317 -640
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +36 -21
- package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +75 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +14 -6
- package/front_end/models/ai_assistance/performance/AIContext.ts +62 -7
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +5 -5
- package/front_end/models/badges/Badge.ts +6 -1
- package/front_end/models/badges/StarterBadge.ts +5 -0
- package/front_end/models/badges/UserBadges.ts +5 -4
- package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +14 -7
- package/front_end/panels/ai_assistance/PatchWidget.ts +17 -55
- package/front_end/panels/ai_assistance/components/ChatView.ts +45 -69
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +47 -1
- package/front_end/panels/ai_assistance/components/chatView.css +13 -1
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/animation/animationTimeline.css +4 -0
- package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -5
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +5 -0
- package/front_end/panels/common/aiCodeCompletionTeaser.css +6 -1
- package/front_end/panels/console/ConsolePrompt.ts +6 -0
- package/front_end/panels/console/ConsoleView.ts +4 -2
- package/front_end/panels/coverage/CoverageListView.ts +146 -198
- package/front_end/panels/coverage/CoverageView.ts +48 -18
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -0
- package/front_end/panels/network/NetworkDataGridNode.ts +22 -0
- package/front_end/panels/network/NetworkLogViewColumns.ts +9 -0
- package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -0
- package/front_end/panels/search/SearchResultsPane.ts +48 -15
- package/front_end/panels/search/SearchView.ts +33 -30
- package/front_end/panels/search/searchView.css +0 -2
- package/front_end/panels/settings/components/SyncSection.ts +4 -4
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +1 -4
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -0
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +0 -8
- package/front_end/panels/timeline/TimelineFlameChartView.ts +5 -5
- package/front_end/panels/timeline/TimelinePanel.ts +2 -0
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +56 -4
- package/front_end/panels/timeline/components/exportTraceOptions.css +5 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +8 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +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/node/BrowserLauncher.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js +15 -16
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.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/es5-iife/puppeteer-core-browser.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +15 -16
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js.map +1 -1
- package/front_end/third_party/puppeteer/package/package.json +3 -2
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/PipeTransport.ts +15 -17
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/Function.ts +1 -1
- package/front_end/tsconfig.json +12 -1
- package/front_end/ui/legacy/InspectorView.ts +86 -13
- package/front_end/ui/legacy/TabbedPane.ts +2 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +6 -0
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/package.json +1 -1
@@ -30,7 +30,7 @@ export const createFunction = (
|
|
30
30
|
export function stringifyFunction(fn: (...args: never) => unknown): string {
|
31
31
|
let value = fn.toString();
|
32
32
|
if (
|
33
|
-
value.match(/^(async )*function
|
33
|
+
value.match(/^(async )*function(\(|\s)/) ||
|
34
34
|
value.match(/^(async )*function\s*\*\s*/)
|
35
35
|
) {
|
36
36
|
return value;
|
package/front_end/tsconfig.json
CHANGED
@@ -3,7 +3,18 @@
|
|
3
3
|
"compilerOptions": {
|
4
4
|
"allowUmdGlobalAccess": true,
|
5
5
|
"outDir": "ignored",
|
6
|
-
"
|
6
|
+
"target": "ES2023",
|
7
|
+
"lib": [
|
8
|
+
"ES2023",
|
9
|
+
"ES2024.Promise",
|
10
|
+
"ESNext.Iterator",
|
11
|
+
"ESNext.Collection",
|
12
|
+
"ESNext.Array",
|
13
|
+
"dom",
|
14
|
+
"dom.iterable",
|
15
|
+
"webworker",
|
16
|
+
"webworker.iterable"
|
17
|
+
],
|
7
18
|
"plugins": [
|
8
19
|
{
|
9
20
|
"name": "ts-lit-plugin",
|
@@ -18,7 +18,7 @@ import * as ARIAUtils from './ARIAUtils.js';
|
|
18
18
|
import type {Context} from './Context.js';
|
19
19
|
import type {ContextMenu} from './ContextMenu.js';
|
20
20
|
import {Dialog} from './Dialog.js';
|
21
|
-
import {DockController, DockState} from './DockController.js';
|
21
|
+
import {DockController, DockState, Events as DockControllerEvents} from './DockController.js';
|
22
22
|
import {GlassPane} from './GlassPane.js';
|
23
23
|
import {Infobar, Type as InfobarType} from './Infobar.js';
|
24
24
|
import {KeyboardShortcut} from './KeyboardShortcut.js';
|
@@ -127,8 +127,20 @@ export enum DrawerOrientation {
|
|
127
127
|
UNSET = 'unset',
|
128
128
|
}
|
129
129
|
|
130
|
+
export enum DockMode {
|
131
|
+
BOTTOM = 'bottom',
|
132
|
+
SIDE = 'side', // For LEFT and RIGHT
|
133
|
+
UNDOCKED = 'undocked',
|
134
|
+
}
|
135
|
+
|
136
|
+
export interface DrawerOrientationByDockMode {
|
137
|
+
[DockMode.BOTTOM]: DrawerOrientation;
|
138
|
+
[DockMode.SIDE]: DrawerOrientation;
|
139
|
+
[DockMode.UNDOCKED]: DrawerOrientation;
|
140
|
+
}
|
141
|
+
|
130
142
|
export class InspectorView extends VBox implements ViewLocationResolver {
|
131
|
-
private readonly
|
143
|
+
private readonly drawerOrientationByDockSetting: Common.Settings.Setting<DrawerOrientationByDockMode>;
|
132
144
|
private readonly drawerSplitWidget: SplitWidget;
|
133
145
|
private readonly tabDelegate: InspectorViewTabDelegate;
|
134
146
|
private readonly drawerTabbedLocation: TabbedViewLocation;
|
@@ -151,9 +163,14 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
151
163
|
this.setMinimumSize(MIN_INSPECTOR_WIDTH_HORIZONTAL_DRAWER, MIN_INSPECTOR_HEIGHT);
|
152
164
|
|
153
165
|
// DevTools sidebar is a vertical split of main tab bar panels and a drawer.
|
154
|
-
this.
|
155
|
-
Common.Settings.Settings.instance().createSetting('inspector.drawer-orientation',
|
156
|
-
|
166
|
+
this.drawerOrientationByDockSetting =
|
167
|
+
Common.Settings.Settings.instance().createSetting('inspector.drawer-orientation-by-dock-mode', {
|
168
|
+
[DockMode.BOTTOM]: DrawerOrientation.UNSET,
|
169
|
+
[DockMode.SIDE]: DrawerOrientation.UNSET,
|
170
|
+
[DockMode.UNDOCKED]: DrawerOrientation.UNSET,
|
171
|
+
});
|
172
|
+
const initialOrientation = this.#getOrientationForDockMode();
|
173
|
+
const isVertical = initialOrientation === DrawerOrientation.VERTICAL;
|
157
174
|
this.drawerSplitWidget = new SplitWidget(isVertical, true, 'inspector.drawer-split-view-state', 200, 200);
|
158
175
|
this.drawerSplitWidget.hideSidebar();
|
159
176
|
this.drawerSplitWidget.enableShowModeSaving();
|
@@ -285,6 +302,50 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
285
302
|
inspectorViewInstance = null;
|
286
303
|
}
|
287
304
|
|
305
|
+
onDockSideChangedHandledForTest(): void {
|
306
|
+
}
|
307
|
+
|
308
|
+
#onDockSideChanged(): void {
|
309
|
+
if (!this.drawerVisible()) {
|
310
|
+
this.onDockSideChangedHandledForTest();
|
311
|
+
return;
|
312
|
+
}
|
313
|
+
const newOrientation = this.#getOrientationForDockMode();
|
314
|
+
this.#applyOrientation(newOrientation);
|
315
|
+
this.onDockSideChangedHandledForTest();
|
316
|
+
}
|
317
|
+
|
318
|
+
#getDockMode(): DockMode {
|
319
|
+
const dockSide = DockController.instance().dockSide();
|
320
|
+
if (dockSide === DockState.BOTTOM) {
|
321
|
+
return DockMode.BOTTOM;
|
322
|
+
}
|
323
|
+
if (dockSide === DockState.UNDOCKED) {
|
324
|
+
return DockMode.UNDOCKED;
|
325
|
+
}
|
326
|
+
|
327
|
+
return DockMode.SIDE;
|
328
|
+
}
|
329
|
+
|
330
|
+
#getOrientationForDockMode(): Omit<DrawerOrientation, DrawerOrientation.UNSET> {
|
331
|
+
const dockMode = this.#getDockMode();
|
332
|
+
const orientationSetting = this.drawerOrientationByDockSetting.get();
|
333
|
+
|
334
|
+
let orientation = orientationSetting[dockMode];
|
335
|
+
if (orientation === DrawerOrientation.UNSET) {
|
336
|
+
// Apply defaults: horizontal for side-dock, vertical for bottom-dock.
|
337
|
+
orientation = dockMode === DockMode.BOTTOM ? DrawerOrientation.VERTICAL : DrawerOrientation.HORIZONTAL;
|
338
|
+
}
|
339
|
+
return orientation;
|
340
|
+
}
|
341
|
+
|
342
|
+
#applyOrientation(orientation: Omit<DrawerOrientation, DrawerOrientation.UNSET>): void {
|
343
|
+
const isVertical = orientation === DrawerOrientation.VERTICAL;
|
344
|
+
this.#toggleOrientationButton.setGlyph(isVertical ? 'dock-bottom' : 'dock-right');
|
345
|
+
this.drawerSplitWidget.setVertical(isVertical);
|
346
|
+
this.setDrawerRelatedMinimumSizes();
|
347
|
+
}
|
348
|
+
|
288
349
|
#observedResize(): void {
|
289
350
|
const rect = this.element.getBoundingClientRect();
|
290
351
|
this.element.style.setProperty('--devtools-window-left', `${rect.left}px`);
|
@@ -299,11 +360,15 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
299
360
|
this.#resizeObserver.observe(this.element);
|
300
361
|
this.#observedResize();
|
301
362
|
this.element.ownerDocument.addEventListener('keydown', this.keyDownBound, false);
|
363
|
+
DockController.instance().addEventListener(DockControllerEvents.DOCK_SIDE_CHANGED, this.#onDockSideChanged, this);
|
364
|
+
this.#onDockSideChanged();
|
302
365
|
}
|
303
366
|
|
304
367
|
override willHide(): void {
|
305
368
|
this.#resizeObserver.unobserve(this.element);
|
306
369
|
this.element.ownerDocument.removeEventListener('keydown', this.keyDownBound, false);
|
370
|
+
DockController.instance().removeEventListener(
|
371
|
+
DockControllerEvents.DOCK_SIDE_CHANGED, this.#onDockSideChanged, this);
|
307
372
|
}
|
308
373
|
|
309
374
|
resolveLocation(locationName: string): ViewLocation|null {
|
@@ -421,21 +486,29 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
421
486
|
if (!this.drawerTabbedPane.isShowing()) {
|
422
487
|
return;
|
423
488
|
}
|
424
|
-
|
489
|
+
|
490
|
+
const dockMode = this.#getDockMode();
|
491
|
+
const currentSettings = this.drawerOrientationByDockSetting.get();
|
492
|
+
|
493
|
+
let newOrientation: Omit<DrawerOrientation, DrawerOrientation.UNSET>;
|
425
494
|
if (force) {
|
426
|
-
|
495
|
+
newOrientation = force;
|
427
496
|
} else {
|
428
|
-
|
497
|
+
const currentOrientation = this.#getOrientationForDockMode();
|
498
|
+
newOrientation =
|
499
|
+
currentOrientation === DrawerOrientation.VERTICAL ? DrawerOrientation.HORIZONTAL : DrawerOrientation.VERTICAL;
|
429
500
|
}
|
430
501
|
|
431
|
-
|
432
|
-
this
|
433
|
-
|
434
|
-
this
|
502
|
+
currentSettings[dockMode] = newOrientation as DrawerOrientation;
|
503
|
+
this.drawerOrientationByDockSetting.set(currentSettings);
|
504
|
+
|
505
|
+
this.#applyOrientation(newOrientation);
|
435
506
|
}
|
436
507
|
|
437
508
|
isUserExplicitlyUpdatedDrawerOrientation(): boolean {
|
438
|
-
|
509
|
+
const orientationSetting = this.drawerOrientationByDockSetting.get();
|
510
|
+
const dockMode = this.#getDockMode();
|
511
|
+
return orientationSetting[dockMode] !== DrawerOrientation.UNSET;
|
439
512
|
}
|
440
513
|
|
441
514
|
setDrawerRelatedMinimumSizes(): void {
|
@@ -326,6 +326,8 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
326
326
|
return false;
|
327
327
|
}
|
328
328
|
|
329
|
+
this.lastSelectedOverflowTab = tab;
|
330
|
+
|
329
331
|
const eventData: EventData = {
|
330
332
|
prevTabId: this.currentTab ? this.currentTab.id : undefined,
|
331
333
|
tabId: id,
|
@@ -676,7 +678,6 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
676
678
|
}
|
677
679
|
|
678
680
|
private dropDownMenuItemSelected(tab: TabbedPaneTab): void {
|
679
|
-
this.lastSelectedOverflowTab = tab;
|
680
681
|
this.selectTab(tab.id, true, true);
|
681
682
|
}
|
682
683
|
|
@@ -1700,6 +1700,7 @@ export const knownContextValues = new Set([
|
|
1700
1700
|
'gap-rule-overlap',
|
1701
1701
|
'gap-rule-paint-order',
|
1702
1702
|
'garamond',
|
1703
|
+
'gdp-client-initialize',
|
1703
1704
|
'gdp-profile',
|
1704
1705
|
'gdp-sign-up-dialog',
|
1705
1706
|
'gdp.ai-conversation-count',
|
@@ -1754,6 +1755,7 @@ export const knownContextValues = new Set([
|
|
1754
1755
|
'hardware-concurrency-toggle',
|
1755
1756
|
'has-cross-site-ancestor',
|
1756
1757
|
'has-overrides',
|
1758
|
+
'has-profile',
|
1757
1759
|
'has-touch',
|
1758
1760
|
'hashchange',
|
1759
1761
|
'he',
|
@@ -1901,6 +1903,7 @@ export const knownContextValues = new Set([
|
|
1901
1903
|
'inspector-main.reload',
|
1902
1904
|
'inspector-stylesheet',
|
1903
1905
|
'inspector.drawer-orientation',
|
1906
|
+
'inspector.drawer-orientation-by-dock-mode',
|
1904
1907
|
'installability',
|
1905
1908
|
'installing-entry-inspect',
|
1906
1909
|
'instance-id',
|
@@ -1932,6 +1935,7 @@ export const knownContextValues = new Set([
|
|
1932
1935
|
'invert-filter',
|
1933
1936
|
'ip-protection',
|
1934
1937
|
'is',
|
1938
|
+
'is-ad-related',
|
1935
1939
|
'is-landscape',
|
1936
1940
|
'is-mobile',
|
1937
1941
|
'is-resident-credential',
|
@@ -2643,6 +2647,8 @@ export const knownContextValues = new Set([
|
|
2643
2647
|
'no',
|
2644
2648
|
'no-agent-entrypoint',
|
2645
2649
|
'no-override',
|
2650
|
+
'no-profile-and-eligible',
|
2651
|
+
'no-profile-and-not-eligible',
|
2646
2652
|
'no-throttling',
|
2647
2653
|
'node',
|
2648
2654
|
'node-connection',
|
@@ -61,7 +61,7 @@ export const logClick = (throttler: Common.Throttler.Throttler) => (
|
|
61
61
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.recordClick(clickEvent);
|
62
62
|
processEventForDebugging(
|
63
63
|
'Click', loggingState, {mouseButton: clickEvent.mouseButton, doubleClick: clickEvent.doubleClick});
|
64
|
-
});
|
64
|
+
}, Common.Throttler.Scheduling.DELAYED);
|
65
65
|
};
|
66
66
|
|
67
67
|
export const logHover = (throttler: Common.Throttler.Throttler) => async (event: Event) => {
|
package/package.json
CHANGED