chrome-devtools-frontend 1.0.1646286 → 1.0.1649421
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/SECURITY.md +1 -1
- package/extension-api/ExtensionAPI.d.ts +26 -0
- package/front_end/core/common/Debouncer.ts +9 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +3 -1
- package/front_end/core/sdk/CSSMetadata.ts +1 -0
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +65 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -1
- package/front_end/generated/SupportedCSSProperties.js +739 -21
- package/front_end/generated/protocol.ts +26 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +14 -9
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -3
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -0
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +45 -0
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/network.md +16 -0
- package/front_end/models/ai_assistance/skills/styling.md +1 -1
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +118 -0
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +124 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +2 -0
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -0
- package/front_end/models/emulation/EmulatedDevices.ts +430 -12
- package/front_end/models/extensions/ExtensionAPI.ts +47 -21
- package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +40 -1
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +228 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +39 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +4 -0
- package/front_end/panels/application/CookieItemsView.ts +55 -6
- package/front_end/panels/application/DOMStorageItemsView.ts +43 -8
- package/front_end/panels/application/KeyValueStorageItemsView.ts +17 -9
- package/front_end/panels/application/WebMCPTreeElement.ts +8 -0
- package/front_end/panels/elements/StylePropertyTreeElement.ts +73 -16
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +9 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +22 -8
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +309 -182
- package/front_end/panels/layer_viewer/paintProfiler.css +27 -23
- package/front_end/panels/layers/LayerPaintProfilerView.ts +86 -29
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +210 -356
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +7 -0
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +5 -5
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +122 -0
- package/front_end/panels/timeline/components/components.ts +2 -0
- package/front_end/panels/timeline/components/networkTrackWidget.css +31 -0
- package/front_end/panels/timeline/timeline.ts +2 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +17 -2
- package/front_end/ui/components/buttons/floatingButton.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +1 -1
- package/front_end/ui/legacy/TextPrompt.ts +24 -18
- package/front_end/ui/legacy/Treeoutline.ts +31 -4
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +50 -24
- package/front_end/ui/legacy/components/utils/Linkifier.ts +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
- package/package.json +1 -1
|
@@ -50,8 +50,6 @@ import dataGridAiButtonStyles from '../data_grid/dataGridAiButton.css.js';
|
|
|
50
50
|
|
|
51
51
|
import cookiesTableStyles from './cookiesTable.css.js';
|
|
52
52
|
|
|
53
|
-
const STORAGE_FLOATING_BUTTON_ACTION_ID = 'ai-assistance.storage-floating-button';
|
|
54
|
-
|
|
55
53
|
export interface ViewInput {
|
|
56
54
|
data: CookieData[];
|
|
57
55
|
selectedKey?: string;
|
|
@@ -176,6 +174,10 @@ const UIStrings = {
|
|
|
176
174
|
* @description Text to be show in the Partition Key column in case it is an opaque origin.
|
|
177
175
|
*/
|
|
178
176
|
opaquePartitionKey: '(opaque)',
|
|
177
|
+
/**
|
|
178
|
+
* @description Tooltip for the disabled AI button on HttpOnly cookies, explaining why they cannot be debugged.
|
|
179
|
+
*/
|
|
180
|
+
httpOnlyCookiesCannotBeAdded: 'HttpOnly cookies cannot be added as context',
|
|
179
181
|
} as const;
|
|
180
182
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/cookie_table/CookiesTable.ts', UIStrings);
|
|
181
183
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -194,6 +196,10 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
194
196
|
#refreshCallback?: (() => void);
|
|
195
197
|
#selectedCallback?: ((arg0: SDK.Cookie.Cookie|null) => void);
|
|
196
198
|
#deleteCallback?: ((arg0: SDK.Cookie.Cookie, arg1: () => void) => void);
|
|
199
|
+
#aiButtonIsEnabled = false;
|
|
200
|
+
#onAiButtonClick?: (cookie: SDK.Cookie.Cookie, event: Event) => void;
|
|
201
|
+
#onPopulateAiContextMenu?: (cookie: SDK.Cookie.Cookie, contextMenu: UI.ContextMenu.ContextMenu) => void;
|
|
202
|
+
#aiButtonTitle?: string;
|
|
197
203
|
private lastEditedColumnId: string|null;
|
|
198
204
|
private data: CookieData[] = [];
|
|
199
205
|
private cookies: SDK.Cookie.Cookie[] = [];
|
|
@@ -273,7 +279,9 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
273
279
|
SourcePort
|
|
274
280
|
</th>` : ''}
|
|
275
281
|
</tr>
|
|
276
|
-
${repeat(this.data, cookie => cookie.key, cookie =>
|
|
282
|
+
${repeat(this.data, cookie => cookie.key, cookie => {
|
|
283
|
+
const isHttpOnly = cookie['http-only'] === 'true';
|
|
284
|
+
return html`
|
|
277
285
|
<tr ?selected=${cookie.key === input.selectedKey}
|
|
278
286
|
?inactive=${cookie.inactive}
|
|
279
287
|
?dirty=${cookie.dirty}
|
|
@@ -283,12 +291,13 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
283
291
|
@delete=${()=> input.onDelete(cookie)}
|
|
284
292
|
@contextmenu=${(e: CustomEvent<UI.ContextMenu.ContextMenu>) => input.onContextMenu(cookie, e.detail)}
|
|
285
293
|
@select=${() => input.onSelect(cookie.key)}>
|
|
286
|
-
<td>${input.showAiButton
|
|
294
|
+
<td>${input.showAiButton ? html`
|
|
287
295
|
<span class="ai-button-container">
|
|
288
296
|
<devtools-floating-button
|
|
289
297
|
icon-name=${Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled ? 'spark' : 'smart-assistant'}
|
|
290
|
-
title=${ifDefined(input.aiButtonTitle)}
|
|
291
|
-
|
|
298
|
+
title=${ifDefined(isHttpOnly ? i18nString(UIStrings.httpOnlyCookiesCannotBeAdded) : input.aiButtonTitle)}
|
|
299
|
+
?disabled=${isHttpOnly}
|
|
300
|
+
@click=${(e: Event) => !isHttpOnly && input.onAiButtonClick?.(cookie, e)}
|
|
292
301
|
></devtools-floating-button>
|
|
293
302
|
</span>
|
|
294
303
|
` : nothing}${cookie.icons?.name}${cookie.name}</td>
|
|
@@ -297,7 +306,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
297
306
|
<td>${cookie.icons?.path}${cookie.path}</td>
|
|
298
307
|
<td title=${ifDefined(cookie.expiresTooltip)}>${cookie.expires}</td>
|
|
299
308
|
<td>${cookie.size}</td>
|
|
300
|
-
<td data-value=${
|
|
309
|
+
<td data-value=${isHttpOnly}></td>
|
|
301
310
|
<td data-value=${Boolean(cookie.secure)}>${cookie.icons?.secure}</td>
|
|
302
311
|
<td>${cookie.icons?.['same-site']}${cookie['same-site']}</td>
|
|
303
312
|
<td>${cookie['partition-key-site']}</td>
|
|
@@ -307,7 +316,8 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
307
316
|
<td title=${i18nString(UIStrings.sourceSchemeTooltip)}>${cookie['source-scheme']}</td>` : ''}
|
|
308
317
|
${input.portBindingEnabled ? html`
|
|
309
318
|
<td title=${i18nString(UIStrings.sourcePortTooltip)}>${cookie['source-port']}</td>` : ''}
|
|
310
|
-
</tr
|
|
319
|
+
</tr>`;
|
|
320
|
+
})}
|
|
311
321
|
${input.editable ? html`<tr placeholder><tr>` : ''}
|
|
312
322
|
</table>
|
|
313
323
|
</devtools-data-grid>`, target, {host: target});
|
|
@@ -363,6 +373,26 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
363
373
|
this.#selectedCallback = callback;
|
|
364
374
|
}
|
|
365
375
|
|
|
376
|
+
set aiButtonIsEnabled(enabled: boolean) {
|
|
377
|
+
this.#aiButtonIsEnabled = enabled;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
get aiButtonIsEnabled(): boolean {
|
|
381
|
+
return this.#aiButtonIsEnabled;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
set onAiButtonClick(callback: (cookie: SDK.Cookie.Cookie, event: Event) => void) {
|
|
385
|
+
this.#onAiButtonClick = callback;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
set onPopulateAiContextMenu(callback: (cookie: SDK.Cookie.Cookie, contextMenu: UI.ContextMenu.ContextMenu) => void) {
|
|
389
|
+
this.#onPopulateAiContextMenu = callback;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
set aiButtonTitle(title: string|undefined) {
|
|
393
|
+
this.#aiButtonTitle = title;
|
|
394
|
+
}
|
|
395
|
+
|
|
366
396
|
set deleteCallback(callback: (arg0: SDK.Cookie.Cookie, arg1: () => void) => void) {
|
|
367
397
|
this.#deleteCallback = callback;
|
|
368
398
|
}
|
|
@@ -407,6 +437,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
407
437
|
}
|
|
408
438
|
|
|
409
439
|
override performUpdate(): void {
|
|
440
|
+
const onAiButtonClick = this.#onAiButtonClick;
|
|
410
441
|
const input: ViewInput = {
|
|
411
442
|
data: this.data,
|
|
412
443
|
selectedKey: this.selectedKey,
|
|
@@ -420,19 +451,17 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
420
451
|
onDelete: this.onDeleteCookie.bind(this),
|
|
421
452
|
onSelect: this.onSelect.bind(this),
|
|
422
453
|
onContextMenu: this.populateContextMenu.bind(this),
|
|
423
|
-
showAiButton: this
|
|
424
|
-
aiButtonTitle: this
|
|
425
|
-
|
|
426
|
-
|
|
454
|
+
showAiButton: this.#aiButtonIsEnabled,
|
|
455
|
+
aiButtonTitle: this.#aiButtonIsEnabled ? this.#aiButtonTitle : undefined,
|
|
456
|
+
onAiButtonClick: (this.#aiButtonIsEnabled && onAiButtonClick) ?
|
|
457
|
+
(cookieData: CookieData, event: Event) => {
|
|
458
|
+
event.stopPropagation();
|
|
459
|
+
const cookie = this.cookies.find(c => c.key() === cookieData.key);
|
|
460
|
+
if (cookie) {
|
|
461
|
+
onAiButtonClick(cookie, event);
|
|
462
|
+
}
|
|
463
|
+
} :
|
|
427
464
|
undefined,
|
|
428
|
-
onAiButtonClick: (cookie: CookieData, event: Event) => {
|
|
429
|
-
event.stopPropagation();
|
|
430
|
-
this.onSelect(cookie.key);
|
|
431
|
-
const actionRegistry = UI.ActionRegistry.ActionRegistry.instance();
|
|
432
|
-
if (actionRegistry.hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID)) {
|
|
433
|
-
void actionRegistry.getAction(STORAGE_FLOATING_BUTTON_ACTION_ID).execute();
|
|
434
|
-
}
|
|
435
|
-
},
|
|
436
465
|
};
|
|
437
466
|
const output = {};
|
|
438
467
|
this.view(input, output, this.element);
|
|
@@ -443,10 +472,6 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
443
472
|
this.#selectedCallback?.(this.selectedCookie());
|
|
444
473
|
}
|
|
445
474
|
|
|
446
|
-
private isAiButtonEnabled(): boolean {
|
|
447
|
-
return UI.ActionRegistry.ActionRegistry.instance().hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
475
|
private onDeleteCookie(data: CookieData): void {
|
|
451
476
|
const cookie = this.cookies.find(cookie => cookie.key() === data.key);
|
|
452
477
|
if (cookie && this.#deleteCallback) {
|
|
@@ -648,6 +673,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
648
673
|
return;
|
|
649
674
|
}
|
|
650
675
|
const cookie = maybeCookie;
|
|
676
|
+
this.#onPopulateAiContextMenu?.(cookie, contextMenu);
|
|
651
677
|
|
|
652
678
|
contextMenu.revealSection().appendItem(i18nString(UIStrings.showRequestsWithThisCookie), () => {
|
|
653
679
|
const requestFilter = NetworkForward.UIFilter.UIRequestFilter.filters([
|
|
@@ -240,6 +240,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
240
240
|
userMetric: options?.userMetric,
|
|
241
241
|
jslogContext: options?.jslogContext || 'script-location',
|
|
242
242
|
omitOrigin: options?.omitOrigin,
|
|
243
|
+
allowPrivileged: options?.allowPrivileged,
|
|
243
244
|
} satisfies LinkifyURLOptions;
|
|
244
245
|
const {columnNumber, className = ''} = linkifyURLOptions;
|
|
245
246
|
if (sourceURL) {
|
|
@@ -313,6 +314,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
313
314
|
tabStop: options?.tabStop,
|
|
314
315
|
userMetric: options?.userMetric,
|
|
315
316
|
jslogContext: options?.jslogContext || 'script-source-url',
|
|
317
|
+
allowPrivileged: options?.allowPrivileged,
|
|
316
318
|
};
|
|
317
319
|
|
|
318
320
|
return scriptLink || Linkifier.linkifyURL(sourceURL, linkifyURLOptions);
|
|
@@ -593,6 +595,8 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
593
595
|
const lineNumber = options.lineNumber;
|
|
594
596
|
const columnNumber = options.columnNumber;
|
|
595
597
|
const showColumnNumber = options.showColumnNumber;
|
|
598
|
+
const isPrivileged = Common.ParsedURL.schemeIs(url, 'chrome:') || Common.ParsedURL.schemeIs(url, 'file:') ||
|
|
599
|
+
Common.ParsedURL.schemeIs(url, 'devtools:');
|
|
596
600
|
const preventClick = options.preventClick;
|
|
597
601
|
const maxLength = options.maxLength || UI.UIUtils.MaxLengthForDisplayedURLs;
|
|
598
602
|
const bypassURLTrimming = options.bypassURLTrimming;
|
|
@@ -629,6 +633,10 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
629
633
|
linkText += ':' + (columnNumber + 1);
|
|
630
634
|
}
|
|
631
635
|
}
|
|
636
|
+
if (isPrivileged && !options?.allowPrivileged) {
|
|
637
|
+
return html`<span class=${className}>${linkText}</span>`;
|
|
638
|
+
}
|
|
639
|
+
|
|
632
640
|
const title = linkText !== url ? url : '';
|
|
633
641
|
const linkOptions = {
|
|
634
642
|
maxLength,
|
|
@@ -1170,6 +1178,7 @@ interface LinkInfo {
|
|
|
1170
1178
|
}
|
|
1171
1179
|
|
|
1172
1180
|
export interface LinkifyURLOptions {
|
|
1181
|
+
allowPrivileged?: boolean;
|
|
1173
1182
|
text?: string;
|
|
1174
1183
|
className?: string;
|
|
1175
1184
|
lineNumber?: number;
|
|
@@ -1187,6 +1196,7 @@ export interface LinkifyURLOptions {
|
|
|
1187
1196
|
}
|
|
1188
1197
|
|
|
1189
1198
|
export interface LinkifyOptions {
|
|
1199
|
+
allowPrivileged?: boolean;
|
|
1190
1200
|
className?: string;
|
|
1191
1201
|
columnNumber?: number;
|
|
1192
1202
|
showColumnNumber?: boolean;
|
|
@@ -17,8 +17,11 @@ export const knownContextValues = new Set([
|
|
|
17
17
|
'%',
|
|
18
18
|
'*',
|
|
19
19
|
'-alternative-animation-with-timeline',
|
|
20
|
+
'-alternative-line-clamp-shorthand',
|
|
20
21
|
'-alternative-position-try',
|
|
21
22
|
'-alternative-webkit-line-clamp',
|
|
23
|
+
'-alternative-webkit-line-clamp-longhand',
|
|
24
|
+
'-alternative-webkit-line-clamp-shorthand',
|
|
22
25
|
'-epub-caption-side',
|
|
23
26
|
'-epub-text-combine',
|
|
24
27
|
'-epub-text-emphasis',
|
|
@@ -1999,6 +2002,8 @@ export const knownContextValues = new Set([
|
|
|
1999
2002
|
'i-pad-pro',
|
|
2000
2003
|
'i-phone-12-pro',
|
|
2001
2004
|
'i-phone-14-pro-max',
|
|
2005
|
+
'i-phone-15-pro-max',
|
|
2006
|
+
'i-phone-16-pro-max',
|
|
2002
2007
|
'i-phone-se',
|
|
2003
2008
|
'i-phone-xr',
|
|
2004
2009
|
'icons',
|
|
@@ -2834,6 +2839,7 @@ export const knownContextValues = new Set([
|
|
|
2834
2839
|
'network-show-blocked-cookies-only-setting',
|
|
2835
2840
|
'network-show-settings-toolbar',
|
|
2836
2841
|
'network-text-filter',
|
|
2842
|
+
'network-track-widget',
|
|
2837
2843
|
'network-web-socket-message-filter',
|
|
2838
2844
|
'network.ad-blocking-enabled',
|
|
2839
2845
|
'network.ad-blocking-enabled-true',
|
|
@@ -3069,7 +3075,11 @@ export const knownContextValues = new Set([
|
|
|
3069
3075
|
'perspective-origin',
|
|
3070
3076
|
'picture-in-picture',
|
|
3071
3077
|
'ping',
|
|
3078
|
+
'pixel-10',
|
|
3072
3079
|
'pixel-7',
|
|
3080
|
+
'pixel-8',
|
|
3081
|
+
'pixel-9',
|
|
3082
|
+
'pixel-9-pro-xl',
|
|
3073
3083
|
'pl',
|
|
3074
3084
|
'place-content',
|
|
3075
3085
|
'place-items',
|
|
@@ -3157,6 +3167,7 @@ export const knownContextValues = new Set([
|
|
|
3157
3167
|
'profile-view.focus-selected-function',
|
|
3158
3168
|
'profile-view.restore-all-functions',
|
|
3159
3169
|
'profile-view.selected-view',
|
|
3170
|
+
'profiler',
|
|
3160
3171
|
'profiler.clear-all',
|
|
3161
3172
|
'profiler.delete-profile',
|
|
3162
3173
|
'profiler.heap-snapshot-base',
|
|
@@ -3892,7 +3903,9 @@ export const knownContextValues = new Set([
|
|
|
3892
3903
|
'storage',
|
|
3893
3904
|
'storage-bucket',
|
|
3894
3905
|
'storage-buckets',
|
|
3906
|
+
'storage-cookie',
|
|
3895
3907
|
'storage-default',
|
|
3908
|
+
'storage-domstorage',
|
|
3896
3909
|
'storage-items-view.clear-all',
|
|
3897
3910
|
'storage-items-view.delete-selected',
|
|
3898
3911
|
'storage-items-view.refresh',
|
package/package.json
CHANGED