chrome-devtools-frontend 1.0.1582745 → 1.0.1583146
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/root/Runtime.ts +0 -5
- package/front_end/core/sdk/NetworkManager.ts +63 -115
- package/front_end/entrypoint_template.html +1 -5
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +15 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -2
- package/front_end/panels/autofill/AutofillView.ts +4 -8
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +27 -8
- package/front_end/panels/elements/ComputedStyleWidget.ts +41 -29
- package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +487 -426
- package/front_end/panels/elements/EventListenersWidget.ts +2 -4
- package/front_end/panels/elements/PropertiesWidget.ts +1 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -2
- package/front_end/panels/elements/computedStyleWidget.css +30 -0
- package/front_end/panels/network/NetworkLogView.ts +64 -105
- package/front_end/panels/network/RequestConditionsDrawer.ts +40 -131
- package/front_end/panels/network/network-meta.ts +4 -27
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +8 -0
- package/front_end/ui/components/text_editor/config.ts +6 -0
- package/front_end/ui/legacy/Toolbar.ts +12 -4
- package/front_end/ui/legacy/UIUtils.ts +26 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/elements/computedStyleSidebarPane.css +0 -18
|
@@ -23,18 +23,10 @@ const UIStrings = {
|
|
|
23
23
|
* @description Title of the Network tool
|
|
24
24
|
*/
|
|
25
25
|
network: 'Network',
|
|
26
|
-
/**
|
|
27
|
-
* @description Command for showing the 'Network request blocking' tool
|
|
28
|
-
*/
|
|
29
|
-
showNetworkRequestBlocking: 'Show Network request blocking',
|
|
30
26
|
/**
|
|
31
27
|
* @description Command for showing the 'Network request blocking' tool
|
|
32
28
|
*/
|
|
33
29
|
showRequestConditions: 'Show Request conditions',
|
|
34
|
-
/**
|
|
35
|
-
* @description Title of the 'Network request blocking' tool in the bottom drawer
|
|
36
|
-
*/
|
|
37
|
-
networkRequestBlocking: 'Network request blocking',
|
|
38
30
|
/**
|
|
39
31
|
* @description Title of the 'Request conditions' tool in the bottom drawer
|
|
40
32
|
*/
|
|
@@ -123,14 +115,6 @@ const UIStrings = {
|
|
|
123
115
|
* @description Title of a button for clearing the network log
|
|
124
116
|
*/
|
|
125
117
|
clear: 'Clear network log',
|
|
126
|
-
/**
|
|
127
|
-
* @description Title of an action in the Network request blocking panel to add a new URL pattern to the blocklist.
|
|
128
|
-
*/
|
|
129
|
-
addNetworkRequestBlockingPattern: 'Add network request blocking pattern',
|
|
130
|
-
/**
|
|
131
|
-
* @description Title of an action in the Network request blocking panel to clear all URL patterns.
|
|
132
|
-
*/
|
|
133
|
-
removeAllNetworkRequestBlockingPatterns: 'Remove all network request blocking patterns',
|
|
134
118
|
/**
|
|
135
119
|
* @description Title of an action in the Network request blocking panel to add a new URL pattern to the blocklist.
|
|
136
120
|
*/
|
|
@@ -190,15 +174,11 @@ UI.ViewManager.registerViewExtension({
|
|
|
190
174
|
},
|
|
191
175
|
});
|
|
192
176
|
|
|
193
|
-
const individualThrottlingEnabled = (): boolean =>
|
|
194
|
-
Boolean(Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled);
|
|
195
177
|
UI.ViewManager.registerViewExtension({
|
|
196
178
|
location: UI.ViewManager.ViewLocationValues.DRAWER_VIEW,
|
|
197
179
|
id: 'network.blocked-urls',
|
|
198
|
-
commandPrompt: () =>
|
|
199
|
-
|
|
200
|
-
title: () => individualThrottlingEnabled() ? i18nString(UIStrings.networkRequestConditions) :
|
|
201
|
-
i18nString(UIStrings.networkRequestBlocking),
|
|
180
|
+
commandPrompt: () => i18nString(UIStrings.showRequestConditions),
|
|
181
|
+
title: () => i18nString(UIStrings.networkRequestConditions),
|
|
202
182
|
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
|
|
203
183
|
order: 60,
|
|
204
184
|
async loadView() {
|
|
@@ -350,8 +330,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
350
330
|
UI.ActionRegistration.registerActionExtension({
|
|
351
331
|
actionId: 'network.add-network-request-blocking-pattern',
|
|
352
332
|
category: UI.ActionRegistration.ActionCategory.NETWORK,
|
|
353
|
-
title: () =>
|
|
354
|
-
i18nString(UIStrings.addNetworkRequestBlockingPattern),
|
|
333
|
+
title: () => i18nString(UIStrings.addNetworkRequestBlockingOrThrottlingPattern),
|
|
355
334
|
iconClass: UI.ActionRegistration.IconClass.PLUS,
|
|
356
335
|
contextTypes() {
|
|
357
336
|
return maybeRetrieveContextTypes(Network => [Network.RequestConditionsDrawer.RequestConditionsDrawer]);
|
|
@@ -365,9 +344,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
365
344
|
UI.ActionRegistration.registerActionExtension({
|
|
366
345
|
actionId: 'network.remove-all-network-request-blocking-patterns',
|
|
367
346
|
category: UI.ActionRegistration.ActionCategory.NETWORK,
|
|
368
|
-
title: () =>
|
|
369
|
-
i18nString(UIStrings.removeAllNetworkRequestBlockingOrThrottlingPatterns) :
|
|
370
|
-
i18nString(UIStrings.removeAllNetworkRequestBlockingPatterns),
|
|
347
|
+
title: () => i18nString(UIStrings.removeAllNetworkRequestBlockingOrThrottlingPatterns),
|
|
371
348
|
iconClass: UI.ActionRegistration.IconClass.CLEAR,
|
|
372
349
|
contextTypes() {
|
|
373
350
|
return maybeRetrieveContextTypes(Network => [Network.RequestConditionsDrawer.RequestConditionsDrawer]);
|
|
@@ -61,7 +61,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
61
61
|
<input
|
|
62
62
|
class="harmony-input"
|
|
63
63
|
jslog=${VisualLogging.textField().track({keydown: 'Enter', change: true}).context(input.excludePatternSetting.name)}
|
|
64
|
-
${UI.UIUtils.bindToSetting(input.excludePatternSetting)}
|
|
64
|
+
${UI.UIUtils.bindToSetting(input.excludePatternSetting, {jslog: false})}
|
|
65
65
|
id="workspace-setting-folder-exclude-pattern"></input>
|
|
66
66
|
</div>
|
|
67
67
|
<div class="mappings-info">${i18nString(UIStrings.mappingsAreInferredAutomatically)}</div>
|
|
@@ -428,14 +428,14 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
428
428
|
UI.Context.Context.instance().setFlavor(
|
|
429
429
|
StackTrace.StackTrace.DebuggableFrameFlavor,
|
|
430
430
|
StackTrace.StackTrace.DebuggableFrameFlavor.for(debuggerCallFrame));
|
|
431
|
+
} else {
|
|
432
|
+
void Common.Revealer.reveal(uiLocation);
|
|
431
433
|
}
|
|
432
434
|
if (oldItem !== item) {
|
|
433
435
|
if (oldItem) {
|
|
434
436
|
this.refreshItem(oldItem);
|
|
435
437
|
}
|
|
436
438
|
this.refreshItem(item);
|
|
437
|
-
} else {
|
|
438
|
-
void Common.Revealer.reveal(uiLocation);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
acceptAiAutoCompleteSuggestion,
|
|
19
19
|
aiAutoCompleteSuggestion,
|
|
20
20
|
aiAutoCompleteSuggestionState,
|
|
21
|
+
AiSuggestionSource,
|
|
21
22
|
hasActiveAiSuggestion,
|
|
22
23
|
setAiAutoCompleteSuggestion,
|
|
23
24
|
showCompletionHint,
|
|
@@ -201,6 +202,12 @@ export class AiCodeCompletionProvider {
|
|
|
201
202
|
if (!this.#aiCodeCompletion || !this.#editor || !hasActiveAiSuggestion(this.#editor.state)) {
|
|
202
203
|
return false;
|
|
203
204
|
}
|
|
205
|
+
if (this.#editor.state.field(aiAutoCompleteSuggestionState)?.source === AiSuggestionSource.GENERATION) {
|
|
206
|
+
// If the suggestion is from code generation, we don't want to
|
|
207
|
+
// dismiss it here. The user should use the code generation
|
|
208
|
+
// provider's keymap to dismiss the suggestion.
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
204
211
|
this.#editor.dispatch({
|
|
205
212
|
effects: setAiAutoCompleteSuggestion.of(null),
|
|
206
213
|
});
|
|
@@ -347,6 +354,7 @@ export class AiCodeCompletionProvider {
|
|
|
347
354
|
startTime,
|
|
348
355
|
clearCachedRequest: this.clearCache.bind(this),
|
|
349
356
|
onImpression: this.#aiCodeCompletion?.registerUserImpression.bind(this.#aiCodeCompletion),
|
|
357
|
+
source: AiSuggestionSource.COMPLETION,
|
|
350
358
|
})
|
|
351
359
|
});
|
|
352
360
|
}
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
acceptAiAutoCompleteSuggestion,
|
|
20
20
|
aiAutoCompleteSuggestion,
|
|
21
21
|
aiAutoCompleteSuggestionState,
|
|
22
|
+
AiSuggestionSource,
|
|
22
23
|
hasActiveAiSuggestion,
|
|
23
24
|
setAiAutoCompleteSuggestion,
|
|
24
25
|
} from './config.js';
|
|
@@ -159,6 +160,12 @@ export class AiCodeGenerationProvider {
|
|
|
159
160
|
return false;
|
|
160
161
|
}
|
|
161
162
|
if (hasActiveAiSuggestion(this.#editor.state)) {
|
|
163
|
+
if (this.#editor.state.field(aiAutoCompleteSuggestionState)?.source === AiSuggestionSource.COMPLETION) {
|
|
164
|
+
// If the suggestion is from code completion, we don't want to
|
|
165
|
+
// dismiss it here. The user should use the code completion
|
|
166
|
+
// provider's keymap to dismiss the suggestion.
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
162
169
|
this.#dismissTeaserAndSuggestion();
|
|
163
170
|
return true;
|
|
164
171
|
}
|
|
@@ -341,6 +348,7 @@ export class AiCodeGenerationProvider {
|
|
|
341
348
|
sampleId: topSample.sampleId,
|
|
342
349
|
startTime,
|
|
343
350
|
onImpression: this.#aiCodeGeneration?.registerUserImpression.bind(this.#aiCodeGeneration),
|
|
351
|
+
source: AiSuggestionSource.GENERATION,
|
|
344
352
|
}),
|
|
345
353
|
setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.ACTIVE)
|
|
346
354
|
]
|
|
@@ -483,6 +483,11 @@ export function contentIncludingHint(view: CM.EditorView): string {
|
|
|
483
483
|
|
|
484
484
|
export const setAiAutoCompleteSuggestion = CM.StateEffect.define<ActiveSuggestion|null>();
|
|
485
485
|
|
|
486
|
+
export const enum AiSuggestionSource {
|
|
487
|
+
COMPLETION = 'completion',
|
|
488
|
+
GENERATION = 'generation',
|
|
489
|
+
}
|
|
490
|
+
|
|
486
491
|
export interface ActiveSuggestion {
|
|
487
492
|
text: string;
|
|
488
493
|
from: number;
|
|
@@ -491,6 +496,7 @@ export interface ActiveSuggestion {
|
|
|
491
496
|
startTime: number;
|
|
492
497
|
onImpression: (rpcGlobalId: Host.AidaClient.RpcGlobalId, latency: number, sampleId?: number) => void;
|
|
493
498
|
clearCachedRequest?: () => void;
|
|
499
|
+
source: AiSuggestionSource;
|
|
494
500
|
}
|
|
495
501
|
|
|
496
502
|
export const aiAutoCompleteSuggestionState = CM.StateField.define<ActiveSuggestion|null>({
|
|
@@ -835,7 +835,7 @@ export class ToolbarInputElement extends HTMLElement {
|
|
|
835
835
|
|
|
836
836
|
item?: ToolbarInput;
|
|
837
837
|
datalist: HTMLDataListElement|null = null;
|
|
838
|
-
value: string|undefined = undefined;
|
|
838
|
+
#value: string|undefined = undefined;
|
|
839
839
|
#disabled = false;
|
|
840
840
|
|
|
841
841
|
connectedCallback(): void {
|
|
@@ -862,8 +862,8 @@ export class ToolbarInputElement extends HTMLElement {
|
|
|
862
862
|
/* shrinkFactor=*/ undefined, tooltip, this.datalist ? this.#onAutocomplete.bind(this) : undefined,
|
|
863
863
|
/* dynamicCompletions=*/ undefined, jslogContext, this);
|
|
864
864
|
}
|
|
865
|
-
if (this
|
|
866
|
-
this.item.setValue(this
|
|
865
|
+
if (this.#value) {
|
|
866
|
+
this.item.setValue(this.#value);
|
|
867
867
|
}
|
|
868
868
|
if (this.#disabled) {
|
|
869
869
|
this.item.setEnabled(false);
|
|
@@ -894,7 +894,7 @@ export class ToolbarInputElement extends HTMLElement {
|
|
|
894
894
|
if (this.item && this.item.value() !== newValue) {
|
|
895
895
|
this.item.setValue(newValue, true);
|
|
896
896
|
} else {
|
|
897
|
-
this
|
|
897
|
+
this.#value = newValue;
|
|
898
898
|
}
|
|
899
899
|
} else if (name === 'disabled') {
|
|
900
900
|
this.#disabled = typeof newValue === 'string';
|
|
@@ -904,6 +904,14 @@ export class ToolbarInputElement extends HTMLElement {
|
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
|
|
907
|
+
get value(): string {
|
|
908
|
+
return this.item ? this.item.value() : (this.#value ?? '');
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
set value(value: string) {
|
|
912
|
+
this.setAttribute('value', value);
|
|
913
|
+
}
|
|
914
|
+
|
|
907
915
|
set disabled(disabled: boolean) {
|
|
908
916
|
if (disabled) {
|
|
909
917
|
this.setAttribute('disabled', '');
|
|
@@ -2193,13 +2193,29 @@ export const bindCheckboxImpl = function(
|
|
|
2193
2193
|
};
|
|
2194
2194
|
};
|
|
2195
2195
|
|
|
2196
|
+
export type BindToSettingOpts = ((newSettingValue: string) => boolean)|{
|
|
2197
|
+
validator?: (newSettingValue: string) => boolean,
|
|
2198
|
+
jslog?: boolean,
|
|
2199
|
+
};
|
|
2196
2200
|
export const bindToSetting =
|
|
2197
2201
|
(settingOrName: string|Common.Settings.Setting<boolean|string>|Common.Settings.RegExpSetting,
|
|
2198
|
-
|
|
2202
|
+
optionsOrValidator?: BindToSettingOpts): ReturnType<typeof Directives.ref> => {
|
|
2199
2203
|
const setting = typeof settingOrName === 'string' ?
|
|
2200
2204
|
Common.Settings.Settings.instance().moduleSetting(settingOrName) :
|
|
2201
2205
|
settingOrName;
|
|
2202
2206
|
|
|
2207
|
+
let stringValidator: ((newSettingValue: string) => boolean)|undefined;
|
|
2208
|
+
let jslog = true;
|
|
2209
|
+
if (typeof optionsOrValidator === 'function') {
|
|
2210
|
+
stringValidator = optionsOrValidator;
|
|
2211
|
+
} else if (optionsOrValidator) {
|
|
2212
|
+
stringValidator = optionsOrValidator.validator;
|
|
2213
|
+
if (optionsOrValidator.jslog !== undefined) {
|
|
2214
|
+
jslog = optionsOrValidator.jslog;
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
const jslogBuilder = jslog ? VisualLogging.toggle(setting.name).track({change: true}) : null;
|
|
2203
2219
|
// We can't use `setValue` as the change listener directly, otherwise we won't
|
|
2204
2220
|
// be able to remove it again.
|
|
2205
2221
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2214,6 +2230,9 @@ export const bindToSetting =
|
|
|
2214
2230
|
setting.removeChangeListener(settingChanged);
|
|
2215
2231
|
return;
|
|
2216
2232
|
}
|
|
2233
|
+
if (jslogBuilder) {
|
|
2234
|
+
e.setAttribute('jslog', jslogBuilder.toString());
|
|
2235
|
+
}
|
|
2217
2236
|
|
|
2218
2237
|
setting.addChangeListener(settingChanged);
|
|
2219
2238
|
setValue =
|
|
@@ -2229,6 +2248,9 @@ export const bindToSetting =
|
|
|
2229
2248
|
return;
|
|
2230
2249
|
}
|
|
2231
2250
|
|
|
2251
|
+
if (jslogBuilder) {
|
|
2252
|
+
e.setAttribute('jslog', jslogBuilder.toString());
|
|
2253
|
+
}
|
|
2232
2254
|
setting.addChangeListener(settingChanged);
|
|
2233
2255
|
setValue = bindInput(e as HTMLInputElement, setting.set.bind(setting), (value: string) => {
|
|
2234
2256
|
try {
|
|
@@ -2249,6 +2271,9 @@ export const bindToSetting =
|
|
|
2249
2271
|
return;
|
|
2250
2272
|
}
|
|
2251
2273
|
|
|
2274
|
+
if (jslogBuilder) {
|
|
2275
|
+
e.setAttribute('jslog', jslogBuilder.toString());
|
|
2276
|
+
}
|
|
2252
2277
|
setting.addChangeListener(settingChanged);
|
|
2253
2278
|
setValue = bindInput(
|
|
2254
2279
|
e as HTMLInputElement, setting.set.bind(setting), stringValidator ?? (() => true), /* numeric */ false);
|
|
@@ -1271,6 +1271,7 @@ export const knownContextValues = new Set([
|
|
|
1271
1271
|
'device-bound-sessions-empty',
|
|
1272
1272
|
'device-bound-sessions-preserve-log',
|
|
1273
1273
|
'device-bound-sessions-request',
|
|
1274
|
+
'device-bound-sessions-root',
|
|
1274
1275
|
'device-fold',
|
|
1275
1276
|
'device-frame-enable',
|
|
1276
1277
|
'device-mode',
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2015 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
|
-
.styles-sidebar-pane-toolbar {
|
|
8
|
-
border-bottom: 1px solid var(--sys-color-divider);
|
|
9
|
-
flex-shrink: 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.styles-sidebar-computed-style-widget {
|
|
13
|
-
min-height: auto;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.styles-pane-toolbar {
|
|
17
|
-
width: 100%;
|
|
18
|
-
}
|