chrome-devtools-frontend 1.0.1592129 → 1.0.1592362
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
- package/front_end/core/root/ExperimentNames.ts +1 -0
- package/front_end/core/sdk/EmulationModel.ts +41 -1
- package/front_end/entrypoints/main/MainImpl.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +1 -0
- package/front_end/generated/protocol-mapping.d.ts +6 -0
- package/front_end/generated/protocol-proxy-api.d.ts +7 -0
- package/front_end/generated/protocol.ts +16 -0
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +379 -25
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgentOverlay.ts +87 -0
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +8 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +65 -44
- package/front_end/models/computed_style/ComputedStyleModel.ts +40 -6
- package/front_end/models/emulation/DeviceModeModel.ts +47 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -2
- package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +55 -1
- package/front_end/panels/application/CookieItemsView.ts +194 -134
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +1 -1
- package/front_end/panels/application/StorageItemsToolbar.ts +25 -2
- package/front_end/panels/application/cookieItemsView.css +28 -26
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +11 -25
- package/front_end/panels/elements/ElementsPanel.ts +26 -3
- package/front_end/panels/elements/StylePropertyTreeElement.ts +33 -0
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +148 -1
- package/front_end/panels/elements/elements-meta.ts +3 -5
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +6 -0
- package/front_end/panels/emulation/DeviceModeToolbar.ts +25 -0
- package/front_end/panels/timeline/components/metricCard.css +0 -4
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +13 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +44 -24
- package/front_end/ui/visual_logging/Debugging.ts +4 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
|
@@ -826,10 +826,11 @@ export enum DevtoolsExperiments {
|
|
|
826
826
|
'timeline-show-postmessage-events' = 86,
|
|
827
827
|
'timeline-debug-mode' = 93,
|
|
828
828
|
'durable-messages' = 110,
|
|
829
|
+
'jpeg-xl' = 111,
|
|
829
830
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
830
831
|
|
|
831
832
|
// Increment this when new experiments are added.
|
|
832
|
-
MAX_VALUE =
|
|
833
|
+
MAX_VALUE = 112,
|
|
833
834
|
}
|
|
834
835
|
|
|
835
836
|
/** Update DevToolsIssuesPanelIssueExpanded from tools/metrics/histograms/enums.xml if new enum is added. **/
|
|
@@ -559,6 +559,10 @@ export class TargetBase {
|
|
|
559
559
|
this.registerDispatcher('DOMStorage', dispatcher);
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
+
registerEmulationDispatcher(dispatcher: ProtocolProxyApi.EmulationDispatcher): void {
|
|
563
|
+
this.registerDispatcher('Emulation', dispatcher);
|
|
564
|
+
}
|
|
565
|
+
|
|
562
566
|
registerFetchDispatcher(dispatcher: ProtocolProxyApi.FetchDispatcher): void {
|
|
563
567
|
this.registerDispatcher('Fetch', dispatcher);
|
|
564
568
|
}
|
|
@@ -24,6 +24,7 @@ export enum ExperimentName {
|
|
|
24
24
|
TIMELINE_SHOW_POST_MESSAGE_EVENTS = 'timeline-show-postmessage-events',
|
|
25
25
|
TIMELINE_DEBUG_MODE = 'timeline-debug-mode',
|
|
26
26
|
DURABLE_MESSAGES = 'durable-messages',
|
|
27
|
+
JPEG_XL = 'jpeg-xl',
|
|
27
28
|
// Adding or removing an entry from this enum?
|
|
28
29
|
// You will need to update:
|
|
29
30
|
// 1. DevToolsExperiments enum in host/UserMetrics.ts
|
|
@@ -18,7 +18,7 @@ export const enum DataSaverOverride {
|
|
|
18
18
|
DISABLED = 'disabled',
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export class EmulationModel extends SDKModel<
|
|
21
|
+
export class EmulationModel extends SDKModel<EmulationModelEventTypes> implements ProtocolProxyApi.EmulationDispatcher {
|
|
22
22
|
readonly #emulationAgent: ProtocolProxyApi.EmulationApi;
|
|
23
23
|
readonly #deviceOrientationAgent: ProtocolProxyApi.DeviceOrientationApi;
|
|
24
24
|
#cssModel: CSSModel|null;
|
|
@@ -33,11 +33,15 @@ export class EmulationModel extends SDKModel<void> {
|
|
|
33
33
|
enabled: boolean,
|
|
34
34
|
configuration: Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration,
|
|
35
35
|
};
|
|
36
|
+
#screenOrientationLocked: boolean;
|
|
37
|
+
#lockedOrientation: Protocol.Emulation.ScreenOrientation|null;
|
|
36
38
|
|
|
37
39
|
constructor(target: Target) {
|
|
38
40
|
super(target);
|
|
39
41
|
this.#emulationAgent = target.emulationAgent();
|
|
40
42
|
this.#deviceOrientationAgent = target.deviceOrientationAgent();
|
|
43
|
+
this.#screenOrientationLocked = false;
|
|
44
|
+
this.#lockedOrientation = null;
|
|
41
45
|
this.#cssModel = target.model(CSSModel);
|
|
42
46
|
this.#overlayModel = target.model(OverlayModel);
|
|
43
47
|
if (this.#overlayModel) {
|
|
@@ -225,6 +229,7 @@ export class EmulationModel extends SDKModel<void> {
|
|
|
225
229
|
enabled: false,
|
|
226
230
|
configuration: Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Mobile,
|
|
227
231
|
};
|
|
232
|
+
target.registerEmulationDispatcher(this);
|
|
228
233
|
}
|
|
229
234
|
|
|
230
235
|
setTouchEmulationAllowed(touchEmulationAllowed: boolean): void {
|
|
@@ -478,6 +483,41 @@ export class EmulationModel extends SDKModel<void> {
|
|
|
478
483
|
];
|
|
479
484
|
return await this.emulateCSSMedia(type, features);
|
|
480
485
|
}
|
|
486
|
+
|
|
487
|
+
// ProtocolProxyApi.EmulationDispatcher implementation
|
|
488
|
+
|
|
489
|
+
virtualTimeBudgetExpired(): void {
|
|
490
|
+
// No-op for now; not used by the frontend.
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
screenOrientationLockChanged(event: Protocol.Emulation.ScreenOrientationLockChangedEvent): void {
|
|
494
|
+
this.#screenOrientationLocked = event.locked;
|
|
495
|
+
this.#lockedOrientation = event.orientation ?? null;
|
|
496
|
+
this.dispatchEventToListeners(
|
|
497
|
+
EmulationModelEvents.SCREEN_ORIENTATION_LOCK_CHANGED,
|
|
498
|
+
{locked: event.locked, orientation: event.orientation ?? null});
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
isScreenOrientationLocked(): boolean {
|
|
502
|
+
return this.#screenOrientationLocked;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
lockedOrientation(): Protocol.Emulation.ScreenOrientation|null {
|
|
506
|
+
return this.#lockedOrientation;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export const enum EmulationModelEvents {
|
|
511
|
+
SCREEN_ORIENTATION_LOCK_CHANGED = 'ScreenOrientationLockChanged',
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
export interface ScreenOrientationLockChangedEvent {
|
|
515
|
+
locked: boolean;
|
|
516
|
+
orientation: Protocol.Emulation.ScreenOrientation|null;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export interface EmulationModelEventTypes {
|
|
520
|
+
[EmulationModelEvents.SCREEN_ORIENTATION_LOCK_CHANGED]: ScreenOrientationLockChangedEvent;
|
|
481
521
|
}
|
|
482
522
|
|
|
483
523
|
export class Location {
|
|
@@ -431,6 +431,14 @@ export class MainImpl {
|
|
|
431
431
|
requiresChromeRestart: false,
|
|
432
432
|
});
|
|
433
433
|
|
|
434
|
+
Root.Runtime.experiments.registerHostExperiment({
|
|
435
|
+
name: Root.ExperimentNames.ExperimentName.JPEG_XL,
|
|
436
|
+
title: 'JPEG XL support',
|
|
437
|
+
aboutFlag: 'enable-jxl-image-format',
|
|
438
|
+
isEnabled: Root.Runtime.hostConfig.devToolsJpegXlImageFormat?.enabled ?? false,
|
|
439
|
+
requiresChromeRestart: true,
|
|
440
|
+
});
|
|
441
|
+
|
|
434
442
|
Root.Runtime.experiments.enableExperimentsByDefault([
|
|
435
443
|
Root.ExperimentNames.ExperimentName.FULL_ACCESSIBILITY_TREE,
|
|
436
444
|
Root.ExperimentNames.ExperimentName.USE_SOURCE_MAP_SCOPES,
|
|
@@ -508,6 +508,7 @@ inspectorBackend.registerEnum("Emulation.PressureSource", {Cpu: "cpu"});
|
|
|
508
508
|
inspectorBackend.registerEnum("Emulation.PressureState", {Nominal: "nominal", Fair: "fair", Serious: "serious", Critical: "critical"});
|
|
509
509
|
inspectorBackend.registerEnum("Emulation.DisabledImageType", {Avif: "avif", Jxl: "jxl", Webp: "webp"});
|
|
510
510
|
inspectorBackend.registerEvent("Emulation.virtualTimeBudgetExpired", []);
|
|
511
|
+
inspectorBackend.registerEvent("Emulation.screenOrientationLockChanged", ["locked", "orientation"]);
|
|
511
512
|
inspectorBackend.registerCommand("Emulation.canEmulate", [], ["result"], "Tells whether emulation is supported.");
|
|
512
513
|
inspectorBackend.registerCommand("Emulation.clearDeviceMetricsOverride", [], [], "Clears the overridden device metrics.");
|
|
513
514
|
inspectorBackend.registerCommand("Emulation.clearGeolocationOverride", [], [], "Clears the overridden Geolocation Position and Error.");
|
|
@@ -202,6 +202,12 @@ export namespace ProtocolMapping {
|
|
|
202
202
|
* Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
|
|
203
203
|
*/
|
|
204
204
|
'Emulation.virtualTimeBudgetExpired': [];
|
|
205
|
+
/**
|
|
206
|
+
* Fired when a page calls screen.orientation.lock() or screen.orientation.unlock()
|
|
207
|
+
* while device emulation is enabled. This allows the DevTools frontend to update the
|
|
208
|
+
* emulated device orientation accordingly.
|
|
209
|
+
*/
|
|
210
|
+
'Emulation.screenOrientationLockChanged': [Protocol.Emulation.ScreenOrientationLockChangedEvent];
|
|
205
211
|
'FedCm.dialogShown': [Protocol.FedCm.DialogShownEvent];
|
|
206
212
|
/**
|
|
207
213
|
* Triggered when a dialog is closed, either by user action, JS abort,
|
|
@@ -1867,6 +1867,13 @@ declare namespace ProtocolProxyApi {
|
|
|
1867
1867
|
*/
|
|
1868
1868
|
virtualTimeBudgetExpired(): void;
|
|
1869
1869
|
|
|
1870
|
+
/**
|
|
1871
|
+
* Fired when a page calls screen.orientation.lock() or screen.orientation.unlock()
|
|
1872
|
+
* while device emulation is enabled. This allows the DevTools frontend to update the
|
|
1873
|
+
* emulated device orientation accordingly.
|
|
1874
|
+
*/
|
|
1875
|
+
screenOrientationLockChanged(params: Protocol.Emulation.ScreenOrientationLockChangedEvent): void;
|
|
1876
|
+
|
|
1870
1877
|
}
|
|
1871
1878
|
|
|
1872
1879
|
export interface EventBreakpointsApi {
|
|
@@ -7554,6 +7554,22 @@ export namespace Emulation {
|
|
|
7554
7554
|
export interface SetPrimaryScreenRequest {
|
|
7555
7555
|
screenId: ScreenId;
|
|
7556
7556
|
}
|
|
7557
|
+
|
|
7558
|
+
/**
|
|
7559
|
+
* Fired when a page calls screen.orientation.lock() or screen.orientation.unlock()
|
|
7560
|
+
* while device emulation is enabled. This allows the DevTools frontend to update the
|
|
7561
|
+
* emulated device orientation accordingly.
|
|
7562
|
+
*/
|
|
7563
|
+
export interface ScreenOrientationLockChangedEvent {
|
|
7564
|
+
/**
|
|
7565
|
+
* Whether the screen orientation is currently locked.
|
|
7566
|
+
*/
|
|
7567
|
+
locked: boolean;
|
|
7568
|
+
/**
|
|
7569
|
+
* The orientation lock type requested by the page. Only set when locked is true.
|
|
7570
|
+
*/
|
|
7571
|
+
orientation?: ScreenOrientation;
|
|
7572
|
+
}
|
|
7557
7573
|
}
|
|
7558
7574
|
|
|
7559
7575
|
/**
|