chrome-devtools-frontend 1.0.1611099 → 1.0.1611825
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/AidaClientTypes.ts +5 -0
- package/front_end/core/host/AidaGcaTranslation.ts +2 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +2 -1
- package/front_end/core/sdk/Target.ts +1 -3
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +4 -0
- package/front_end/generated/protocol.ts +0 -8
- package/front_end/models/web_mcp/WebMCPModel.ts +73 -18
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +30 -7
- package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +8 -4
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +6 -2
- package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +1 -1
- package/front_end/panels/ai_assistance/components/walkthroughView.css +18 -17
- package/front_end/panels/application/WebMCPView.ts +97 -6
- package/front_end/panels/application/webMCPView.css +7 -1
- package/front_end/panels/console/ConsolePinPane.ts +6 -2
- package/front_end/panels/sources/BreakpointEditDialog.ts +6 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +5635 -1498
- package/front_end/third_party/lighthouse/locales/en-GB.json +2 -2
- package/front_end/third_party/lighthouse/locales/en-US.json +14 -2
- package/front_end/third_party/lighthouse/locales/en-XL.json +12 -0
- package/front_end/third_party/lighthouse/report/bundle.d.ts +4 -4
- package/front_end/third_party/lighthouse/report/bundle.js +30 -3
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
- package/front_end/ui/components/markdown_view/CodeBlock.ts +6 -0
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +83 -68
- package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +3 -3
- package/mcp/mcp.ts +2 -1
- package/package.json +1 -1
|
@@ -26,6 +26,11 @@ const UIStrings = {
|
|
|
26
26
|
* @description The title of the button to copy the codeblock from a Markdown view.
|
|
27
27
|
*/
|
|
28
28
|
copy: 'Copy code',
|
|
29
|
+
/**
|
|
30
|
+
* @description Accessible label for the button to copy the code block, referencing the specific content.
|
|
31
|
+
* @example {Data used} PH1
|
|
32
|
+
*/
|
|
33
|
+
copyCodeSnippet: 'Copy {PH1} code snippet',
|
|
29
34
|
/**
|
|
30
35
|
* @description The title of the button after it was pressed and the text was copied to clipboard.
|
|
31
36
|
*/
|
|
@@ -242,6 +247,7 @@ export class CodeBlock extends HTMLElement {
|
|
|
242
247
|
title: i18nString(UIStrings.copy),
|
|
243
248
|
} as Buttons.Button.ButtonData
|
|
244
249
|
}
|
|
250
|
+
.accessibleLabel=${this.#header ? i18nString(UIStrings.copyCodeSnippet, { PH1: this.#header }) : i18nString(UIStrings.copy)}
|
|
245
251
|
@click=${this.#onCopy}
|
|
246
252
|
></devtools-button>
|
|
247
253
|
${this.#copied ? html`<span>${i18nString(UIStrings.copied)}</span>` : Lit.nothing}
|
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
6
6
|
|
|
7
|
+
import '../../../components/settings/settings.js';
|
|
8
|
+
|
|
7
9
|
import * as Common from '../../../../core/common/common.js';
|
|
8
10
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
9
11
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
10
|
-
import
|
|
12
|
+
import {Directives, html, nothing, render, type TemplateResult} from '../../../../ui/lit/lit.js';
|
|
13
|
+
import type * as Settings from '../../../components/settings/settings.js';
|
|
11
14
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
12
15
|
import * as UI from '../../legacy.js';
|
|
13
16
|
|
|
17
|
+
const {createRef, ref} = Directives;
|
|
18
|
+
|
|
14
19
|
const UIStrings = {
|
|
15
20
|
/**
|
|
16
21
|
* @description Note when a setting change will require the user to reload DevTools
|
|
@@ -36,90 +41,100 @@ export function createSettingCheckbox(
|
|
|
36
41
|
return label;
|
|
37
42
|
}
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const settingSelectElement = container.createChild('p');
|
|
44
|
-
settingSelectElement.classList.add('settings-select');
|
|
45
|
-
const label = settingSelectElement.createChild('label');
|
|
46
|
-
const select = settingSelectElement.createChild('select');
|
|
47
|
-
label.textContent = name;
|
|
48
|
-
if (subtitle) {
|
|
49
|
-
container.classList.add('chrome-select-label');
|
|
50
|
-
label.createChild('p').textContent = subtitle;
|
|
51
|
-
}
|
|
52
|
-
select.setAttribute('jslog', `${VisualLogging.dropDown().track({change: true}).context(setting.name)}`);
|
|
53
|
-
UI.ARIAUtils.bindLabelToControl(label, select);
|
|
54
|
-
|
|
55
|
-
for (const option of options) {
|
|
56
|
-
if (option.text && typeof option.value === 'string') {
|
|
57
|
-
select.add(
|
|
58
|
-
UI.UIUtils.createOption(option.text, option.value, Platform.StringUtilities.toKebabCase(option.value)));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
let reloadWarning: HTMLElement|(Element | null) = (null as Element | null);
|
|
63
|
-
if (requiresReload) {
|
|
64
|
-
reloadWarning = container.createChild('p', 'reload-warning hidden');
|
|
65
|
-
reloadWarning.textContent = i18nString(UIStrings.srequiresReload);
|
|
66
|
-
UI.ARIAUtils.markAsAlert(reloadWarning);
|
|
67
|
-
}
|
|
68
|
-
|
|
44
|
+
export function renderSettingSelect(setting: Common.Settings.Setting<unknown>, subtitle?: string): TemplateResult {
|
|
45
|
+
const name = setting.title();
|
|
46
|
+
const options = setting.options();
|
|
47
|
+
const requiresReload = setting.reloadRequired();
|
|
69
48
|
const {deprecation} = setting;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
warning.data = deprecation;
|
|
73
|
-
label.appendChild(warning);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
setting.addChangeListener(settingChanged);
|
|
77
|
-
settingChanged();
|
|
78
|
-
select.addEventListener('change', selectChanged, false);
|
|
79
|
-
return container;
|
|
80
|
-
|
|
81
|
-
function settingChanged(): void {
|
|
82
|
-
const newValue = setting.get();
|
|
83
|
-
for (let i = 0; i < options.length; i++) {
|
|
84
|
-
if (options[i].value === newValue) {
|
|
85
|
-
select.selectedIndex = i;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
select.disabled = setting.disabled();
|
|
89
|
-
}
|
|
49
|
+
const controlId = UI.ARIAUtils.nextId('labelledControl');
|
|
50
|
+
const reloadWarningRef = createRef<HTMLParagraphElement>();
|
|
90
51
|
|
|
91
|
-
|
|
92
|
-
|
|
52
|
+
const onSelectChange = (e: Event): void => {
|
|
53
|
+
const select = e.target as HTMLSelectElement;
|
|
93
54
|
setting.set(options[select.selectedIndex].value);
|
|
94
|
-
if (
|
|
95
|
-
reloadWarning.classList.remove('hidden');
|
|
55
|
+
if (requiresReload) {
|
|
96
56
|
UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
|
|
97
57
|
i18nString(UIStrings.settingsChangedReloadDevTools));
|
|
58
|
+
if (reloadWarningRef.value) {
|
|
59
|
+
reloadWarningRef.value.classList.remove('hidden');
|
|
60
|
+
}
|
|
98
61
|
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
62
|
+
};
|
|
101
63
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
64
|
+
// clang-format off
|
|
65
|
+
return html`
|
|
66
|
+
<div class=${Directives.classMap({'chrome-select-label': Boolean(subtitle)})}>
|
|
67
|
+
<p class="settings-select">
|
|
68
|
+
<label for=${controlId}>
|
|
69
|
+
${name}
|
|
70
|
+
${subtitle ? html`<p>${subtitle}</p>` : nothing}
|
|
71
|
+
${deprecation ? html`<devtools-setting-deprecation-warning .data=${
|
|
72
|
+
deprecation as Common.Settings.Deprecation}></devtools-setting-deprecation-warning>` :
|
|
73
|
+
nothing}
|
|
74
|
+
</label>
|
|
75
|
+
<select
|
|
76
|
+
id=${controlId}
|
|
77
|
+
aria-label=${name}
|
|
78
|
+
.disabled=${setting.disabled()}
|
|
79
|
+
@change=${onSelectChange}
|
|
80
|
+
jslog=${VisualLogging.dropDown().track({change: true}).context(setting.name)}
|
|
81
|
+
>
|
|
82
|
+
${options.map(option => {
|
|
83
|
+
if (option.text && typeof option.value === 'string') {
|
|
84
|
+
return html`
|
|
85
|
+
<option
|
|
86
|
+
value=${option.value}
|
|
87
|
+
?selected=${setting.get() === option.value}
|
|
88
|
+
jslog=${VisualLogging.item(Platform.StringUtilities.toKebabCase(option.value)).track({click: true})}
|
|
89
|
+
>
|
|
90
|
+
${option.text}
|
|
91
|
+
</option>
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
return nothing;
|
|
95
|
+
})}
|
|
96
|
+
</select>
|
|
97
|
+
</p>
|
|
98
|
+
${requiresReload ? html`
|
|
99
|
+
<p ${ref(reloadWarningRef)} class="reload-warning hidden" role="alert" aria-live="polite">
|
|
100
|
+
${i18nString(UIStrings.srequiresReload)}
|
|
101
|
+
</p>` : nothing}
|
|
102
|
+
</div>
|
|
103
|
+
`;
|
|
104
|
+
// clang-format on
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const renderControlForSetting = function(
|
|
108
|
+
setting: Common.Settings.Setting<unknown>, subtitle?: string): TemplateResult|null {
|
|
105
109
|
switch (setting.type()) {
|
|
106
110
|
case Common.Settings.SettingType.BOOLEAN: {
|
|
107
|
-
const
|
|
108
|
-
component.data = {
|
|
109
|
-
setting: setting as Common.Settings.Setting<boolean>,
|
|
110
|
-
};
|
|
111
|
-
component.onchange = () => {
|
|
111
|
+
const onchange = (): void => {
|
|
112
112
|
if (setting.reloadRequired()) {
|
|
113
113
|
UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
|
|
114
114
|
i18nString(UIStrings.settingsChangedReloadDevTools));
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
return
|
|
117
|
+
return html`<setting-checkbox .data=${{
|
|
118
|
+
setting: setting as Common.Settings.Setting<boolean>
|
|
119
|
+
} as Settings.SettingCheckbox.SettingCheckboxData} @change=${onchange}></setting-checkbox>`;
|
|
120
|
+
}
|
|
121
|
+
case Common.Settings.SettingType.ENUM: {
|
|
122
|
+
return renderSettingSelect(setting, subtitle);
|
|
118
123
|
}
|
|
119
|
-
case Common.Settings.SettingType.ENUM:
|
|
120
|
-
return createSettingSelect(uiTitle, setting.options(), setting.reloadRequired(), setting, subtitle);
|
|
121
124
|
default:
|
|
122
125
|
console.error('Invalid setting type: ' + setting.type());
|
|
123
126
|
return null;
|
|
124
127
|
}
|
|
125
128
|
};
|
|
129
|
+
|
|
130
|
+
export const createControlForSetting = function(
|
|
131
|
+
setting: Common.Settings.Setting<unknown>, subtitle?: string): HTMLElement|null {
|
|
132
|
+
const template = renderControlForSetting(setting, subtitle);
|
|
133
|
+
if (template === null) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
const fragment = document.createDocumentFragment();
|
|
137
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
138
|
+
render(template, fragment);
|
|
139
|
+
return fragment.firstElementChild as HTMLElement;
|
|
140
|
+
};
|
|
@@ -2294,6 +2294,7 @@ export const knownContextValues = new Set([
|
|
|
2294
2294
|
'lighthouse.audit.aria-treeitem-name',
|
|
2295
2295
|
'lighthouse.audit.aria-valid-attr',
|
|
2296
2296
|
'lighthouse.audit.aria-valid-attr-value',
|
|
2297
|
+
'lighthouse.audit.baseline',
|
|
2297
2298
|
'lighthouse.audit.bf-cache',
|
|
2298
2299
|
'lighthouse.audit.bootup-time',
|
|
2299
2300
|
'lighthouse.audit.button-name',
|
|
@@ -4333,11 +4334,15 @@ export const knownContextValues = new Set([
|
|
|
4333
4334
|
'webauthn.remove-credential',
|
|
4334
4335
|
'webgl-error-fired',
|
|
4335
4336
|
'webgl-warning-fired',
|
|
4337
|
+
'webmcp.call-inputs',
|
|
4338
|
+
'webmcp.call-outputs',
|
|
4336
4339
|
'webmcp.declarative',
|
|
4337
4340
|
'webmcp.error',
|
|
4338
4341
|
'webmcp.imperative',
|
|
4339
4342
|
'webmcp.pending',
|
|
4343
|
+
'webmcp.status-types',
|
|
4340
4344
|
'webmcp.success',
|
|
4345
|
+
'webmcp.tool-details',
|
|
4341
4346
|
'webp-format-disabled',
|
|
4342
4347
|
'webp-format-disabled-true',
|
|
4343
4348
|
'websocket',
|
|
@@ -76,7 +76,7 @@ export async function startLogging(options?: {
|
|
|
76
76
|
export async function addDocument(document: Document): Promise<void> {
|
|
77
77
|
documents.push(document);
|
|
78
78
|
if (['interactive', 'complete'].includes(document.readyState)) {
|
|
79
|
-
await
|
|
79
|
+
await process();
|
|
80
80
|
}
|
|
81
81
|
document.addEventListener('visibilitychange', scheduleProcessing);
|
|
82
82
|
document.addEventListener('scroll', scheduleProcessing);
|
|
@@ -84,8 +84,8 @@ export async function addDocument(document: Document): Promise<void> {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export async function stopLogging(): Promise<void> {
|
|
87
|
-
logging = false;
|
|
88
87
|
await keyboardLogThrottler.schedule(async () => {}, Common.Throttler.Scheduling.AS_SOON_AS_POSSIBLE);
|
|
88
|
+
logging = false;
|
|
89
89
|
unregisterAllLoggables();
|
|
90
90
|
for (const document of documents) {
|
|
91
91
|
document.removeEventListener('visibilitychange', scheduleProcessing);
|
|
@@ -139,7 +139,7 @@ const viewportRectFor = (element: Element): DOMRect => {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
export async function process(): Promise<void> {
|
|
142
|
-
if (
|
|
142
|
+
if (document.hidden) {
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
const startTime = performance.now();
|
package/mcp/mcp.ts
CHANGED
|
@@ -28,7 +28,7 @@ export {Target} from '../front_end/core/sdk/Target.js';
|
|
|
28
28
|
export {TargetManager} from '../front_end/core/sdk/TargetManager.js';
|
|
29
29
|
export * as Foundation from '../front_end/foundation/foundation.js';
|
|
30
30
|
export * as Protocol from '../front_end/generated/protocol.js';
|
|
31
|
-
export
|
|
31
|
+
export * as NetworkRequestFormatter from '../front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.js';
|
|
32
32
|
export {
|
|
33
33
|
PerformanceInsightFormatter
|
|
34
34
|
} from '../front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.js';
|
|
@@ -55,6 +55,7 @@ export {
|
|
|
55
55
|
export * as MarkdownIssueDescription from '../front_end/models/issues_manager/MarkdownIssueDescription.js';
|
|
56
56
|
export * as StackTrace from '../front_end/models/stack_trace/stack_trace.js';
|
|
57
57
|
export * as TraceEngine from '../front_end/models/trace/trace.js';
|
|
58
|
+
export {IgnoreListManager} from '../front_end/models/workspace/IgnoreListManager.js';
|
|
58
59
|
export * as Marked from '../front_end/third_party/marked/marked.js';
|
|
59
60
|
|
|
60
61
|
installInspectorFrontendHost(new McpHostBindings());
|
package/package.json
CHANGED