chrome-devtools-frontend 1.0.1642845 → 1.0.1642899
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 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +55 -26
- package/front_end/core/sdk/CSSRule.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -0
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +4 -3
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +4 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +80 -16
- package/front_end/models/ai_assistance/AiConversation.ts +3 -2
- package/front_end/models/ai_assistance/README.md +8 -0
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +50 -35
- package/front_end/models/ai_assistance/agents/AiAgent.ts +16 -0
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +195 -147
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -25
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +24 -305
- package/front_end/models/ai_assistance/ai_assistance.ts +8 -0
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.snapshot.txt +51 -0
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +200 -0
- package/front_end/models/ai_assistance/skills/styling.md +36 -2
- package/front_end/models/ai_assistance/tools/GetStyles.ts +137 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +55 -0
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +34 -0
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +5 -0
- package/front_end/models/live-metrics/LiveMetrics.ts +24 -13
- package/front_end/models/stack_trace/DetailedErrorStackParser.ts +2 -2
- package/front_end/models/stack_trace/StackTrace.ts +4 -1
- package/front_end/models/stack_trace/StackTraceImpl.ts +9 -2
- package/front_end/models/stack_trace/StackTraceModel.ts +17 -4
- package/front_end/models/stack_trace/Trie.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +19 -15
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +16 -0
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/application/DOMStorageItemsView.ts +4 -0
- package/front_end/panels/application/KeyValueStorageItemsView.ts +39 -7
- package/front_end/panels/common/ExtensionServer.ts +26 -15
- package/front_end/panels/elements/StandaloneStylesContainer.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +8 -0
- package/front_end/panels/elements/StylePropertyHighlighter.ts +4 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -5
- package/front_end/panels/elements/StylesContainer.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -4
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +106 -132
- package/front_end/panels/lighthouse/LighthousePanel.ts +4 -3
- package/front_end/panels/network/NetworkLogView.ts +3 -0
- package/front_end/panels/network/networkLogView.css +0 -15
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +36 -3
- package/front_end/ui/legacy/components/data_grid/dataGridAiButton.css +20 -0
- package/front_end/ui/legacy/components/utils/Linkifier.ts +19 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
35
|
*/
|
|
36
36
|
import '../data_grid/data_grid.js';
|
|
37
|
+
import '../../../components/buttons/buttons.js';
|
|
37
38
|
|
|
38
39
|
import * as Common from '../../../../core/common/common.js';
|
|
39
40
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
@@ -43,12 +44,15 @@ import type * as Protocol from '../../../../generated/protocol.js';
|
|
|
43
44
|
import * as IssuesManager from '../../../../models/issues_manager/issues_manager.js';
|
|
44
45
|
import * as NetworkForward from '../../../../panels/network/forward/forward.js';
|
|
45
46
|
import {Icon} from '../../../kit/kit.js';
|
|
46
|
-
import {Directives, html, render} from '../../../lit/lit.js';
|
|
47
|
+
import {Directives, html, nothing, render} from '../../../lit/lit.js';
|
|
47
48
|
import * as UI from '../../legacy.js';
|
|
49
|
+
import dataGridAiButtonStyles from '../data_grid/dataGridAiButton.css.js';
|
|
48
50
|
|
|
49
51
|
import cookiesTableStyles from './cookiesTable.css.js';
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
const STORAGE_FLOATING_BUTTON_ACTION_ID = 'ai-assistance.storage-floating-button';
|
|
54
|
+
|
|
55
|
+
export interface ViewInput {
|
|
52
56
|
data: CookieData[];
|
|
53
57
|
selectedKey?: string;
|
|
54
58
|
editable?: boolean;
|
|
@@ -61,6 +65,9 @@ interface ViewInput {
|
|
|
61
65
|
onDelete: (data: CookieData) => void;
|
|
62
66
|
onContextMenu: (data: CookieData, menu: UI.ContextMenu.ContextMenu) => void;
|
|
63
67
|
onSelect: (key: string|undefined) => void;
|
|
68
|
+
showAiButton?: boolean;
|
|
69
|
+
aiButtonTitle?: string;
|
|
70
|
+
onAiButtonClick?: (cookie: CookieData, event: Event) => void;
|
|
64
71
|
}
|
|
65
72
|
type ViewFunction = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
66
73
|
type AttributeWithIcon = SDK.Cookie.Attribute.NAME|SDK.Cookie.Attribute.VALUE|SDK.Cookie.Attribute.DOMAIN|
|
|
@@ -219,6 +226,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
219
226
|
@deselect=${() => input.onSelect(undefined)}
|
|
220
227
|
>
|
|
221
228
|
<table>
|
|
229
|
+
${input.showAiButton ? html`<style>${dataGridAiButtonStyles}</style>` : nothing}
|
|
222
230
|
<tr>
|
|
223
231
|
<th id=${SDK.Cookie.Attribute.NAME} sortable ?disclosure=${input.editable} ?editable=${input.editable} long weight="24">
|
|
224
232
|
${i18nString(UIStrings.name)}
|
|
@@ -275,7 +283,15 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
275
283
|
@delete=${()=> input.onDelete(cookie)}
|
|
276
284
|
@contextmenu=${(e: CustomEvent<UI.ContextMenu.ContextMenu>) => input.onContextMenu(cookie, e.detail)}
|
|
277
285
|
@select=${() => input.onSelect(cookie.key)}>
|
|
278
|
-
<td>${
|
|
286
|
+
<td>${input.showAiButton && !Boolean(cookie['http-only']) ? html`
|
|
287
|
+
<span class="ai-button-container">
|
|
288
|
+
<devtools-floating-button
|
|
289
|
+
icon-name=${Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled ? 'spark' : 'smart-assistant'}
|
|
290
|
+
title=${ifDefined(input.aiButtonTitle)}
|
|
291
|
+
@click=${(e: Event) => input.onAiButtonClick?.(cookie, e)}
|
|
292
|
+
></devtools-floating-button>
|
|
293
|
+
</span>
|
|
294
|
+
` : nothing}${cookie.icons?.name}${cookie.name}</td>
|
|
279
295
|
<td>${cookie.value}</td>
|
|
280
296
|
<td>${cookie.icons?.domain}${cookie.domain}</td>
|
|
281
297
|
<td>${cookie.icons?.path}${cookie.path}</td>
|
|
@@ -404,6 +420,19 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
404
420
|
onDelete: this.onDeleteCookie.bind(this),
|
|
405
421
|
onSelect: this.onSelect.bind(this),
|
|
406
422
|
onContextMenu: this.populateContextMenu.bind(this),
|
|
423
|
+
showAiButton: this.isAiButtonEnabled(),
|
|
424
|
+
aiButtonTitle: this.isAiButtonEnabled() &&
|
|
425
|
+
UI.ActionRegistry.ActionRegistry.instance().hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID) ?
|
|
426
|
+
UI.ActionRegistry.ActionRegistry.instance().getAction(STORAGE_FLOATING_BUTTON_ACTION_ID).title() :
|
|
427
|
+
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
|
+
},
|
|
407
436
|
};
|
|
408
437
|
const output = {};
|
|
409
438
|
this.view(input, output, this.element);
|
|
@@ -414,6 +443,10 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
414
443
|
this.#selectedCallback?.(this.selectedCookie());
|
|
415
444
|
}
|
|
416
445
|
|
|
446
|
+
private isAiButtonEnabled(): boolean {
|
|
447
|
+
return UI.ActionRegistry.ActionRegistry.instance().hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID);
|
|
448
|
+
}
|
|
449
|
+
|
|
417
450
|
private onDeleteCookie(data: CookieData): void {
|
|
418
451
|
const cookie = this.cookies.find(cookie => cookie.key() === data.key);
|
|
419
452
|
if (cookie && this.#deleteCallback) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 The Chromium Authors
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.data-grid-data-grid-node .ai-button-container {
|
|
8
|
+
display: none;
|
|
9
|
+
float: right;
|
|
10
|
+
|
|
11
|
+
devtools-floating-button {
|
|
12
|
+
position: absolute;
|
|
13
|
+
z-index: 999;
|
|
14
|
+
margin-left: -17px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.data-grid-data-grid-node:hover .ai-button-container {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
}
|
|
@@ -399,7 +399,12 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
399
399
|
jslogContext: options?.jslogContext || 'script-location',
|
|
400
400
|
omitOrigin: options?.omitOrigin,
|
|
401
401
|
} satisfies LinkifyURLOptions;
|
|
402
|
-
const
|
|
402
|
+
const fallbackOptions = {
|
|
403
|
+
...linkifyURLOptions,
|
|
404
|
+
showColumnNumber: frame.isWasm || Boolean(options?.showColumnNumber),
|
|
405
|
+
omitLineAndRenderColumnAsHex: frame.isWasm,
|
|
406
|
+
};
|
|
407
|
+
const fallbackAnchor = Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, fallbackOptions);
|
|
403
408
|
if (!frame.uiSourceCode) {
|
|
404
409
|
const isIgnoreListed = (options?.ignoreListManager ?? Workspace.IgnoreListManager.IgnoreListManager.instance())
|
|
405
410
|
.isUserIgnoreListedURL(frame.url as Platform.DevToolsPath.UrlString);
|
|
@@ -602,6 +607,11 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
602
607
|
const maxLength = options.maxLength || UI.UIUtils.MaxLengthForDisplayedURLs;
|
|
603
608
|
const bypassURLTrimming = options.bypassURLTrimming;
|
|
604
609
|
const omitOrigin = options.omitOrigin;
|
|
610
|
+
const omitLineAndRenderColumnAsHex = options.omitLineAndRenderColumnAsHex;
|
|
611
|
+
|
|
612
|
+
if (omitLineAndRenderColumnAsHex && showColumnNumber === false) {
|
|
613
|
+
throw new Error('omitLineAndRenderColumnAsHex requires showColumnNumber to not be explicitly false');
|
|
614
|
+
}
|
|
605
615
|
|
|
606
616
|
if (!url || Common.ParsedURL.schemeIs(url, 'javascript:')) {
|
|
607
617
|
// clang-format off
|
|
@@ -619,7 +629,11 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
619
629
|
}
|
|
620
630
|
}
|
|
621
631
|
|
|
622
|
-
if (
|
|
632
|
+
if (omitLineAndRenderColumnAsHex && !text) {
|
|
633
|
+
if (typeof columnNumber === 'number') {
|
|
634
|
+
linkText += ':0x' + columnNumber.toString(16);
|
|
635
|
+
}
|
|
636
|
+
} else if (typeof lineNumber === 'number' && !text) {
|
|
623
637
|
linkText += ':' + (lineNumber + 1);
|
|
624
638
|
if (showColumnNumber && typeof columnNumber === 'number') {
|
|
625
639
|
linkText += ':' + (columnNumber + 1);
|
|
@@ -947,7 +961,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
947
961
|
}
|
|
948
962
|
|
|
949
963
|
for (const registration of linkHandlers.values().filter(r => r.handler)) {
|
|
950
|
-
const {title, handler, shouldHandleOpenResource} = registration;
|
|
964
|
+
const {title, origin, handler, shouldHandleOpenResource} = registration;
|
|
951
965
|
if (url && !shouldHandleOpenResource(url, specificSchemeHandlers)) {
|
|
952
966
|
continue;
|
|
953
967
|
}
|
|
@@ -957,7 +971,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
957
971
|
jslogContext: 'open-using',
|
|
958
972
|
handler: handler.bind(null, contentProviderOrUrl, lineNumber, columnNumber),
|
|
959
973
|
};
|
|
960
|
-
if (
|
|
974
|
+
if (origin === Linkifier.linkHandlerSetting().get()) {
|
|
961
975
|
result.unshift(action);
|
|
962
976
|
} else {
|
|
963
977
|
result.push(action);
|
|
@@ -1182,6 +1196,7 @@ export interface LinkifyURLOptions {
|
|
|
1182
1196
|
jslogContext?: string;
|
|
1183
1197
|
omitOrigin?: boolean;
|
|
1184
1198
|
onRef?: (el: HTMLElement) => void;
|
|
1199
|
+
omitLineAndRenderColumnAsHex?: boolean;
|
|
1185
1200
|
}
|
|
1186
1201
|
|
|
1187
1202
|
export interface LinkifyOptions {
|
|
@@ -362,6 +362,7 @@ export const knownContextValues = new Set([
|
|
|
362
362
|
'ai-assistance-v2-opt-in-change-dialog-seen',
|
|
363
363
|
'ai-assistance-v2-opt-in.got-it',
|
|
364
364
|
'ai-assistance-v2-opt-in.manage-settings',
|
|
365
|
+
'ai-assistance.storage-floating-button',
|
|
365
366
|
'ai-code-completion-citations',
|
|
366
367
|
'ai-code-completion-citations.citation-link',
|
|
367
368
|
'ai-code-completion-disclaimer',
|
package/package.json
CHANGED