chrome-devtools-frontend 1.0.1581708 → 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/core/sdk/RemoteObject.ts +7 -1
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +9 -24
- package/front_end/entrypoints/greendev_floaty/floaty.css +1 -1
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +2 -0
- package/front_end/generated/protocol.ts +0 -6
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +17 -9
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -6
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +66 -2
- package/front_end/models/greendev/Prototypes.ts +1 -10
- package/front_end/models/issues_manager/ConnectionAllowlistIssue.ts +75 -0
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +0 -30
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -4
- package/front_end/panels/ai_assistance/components/ChatInput.ts +7 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -2
- package/front_end/panels/application/preloading/PreloadingView.ts +8 -1
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +4 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -1
- package/front_end/panels/application/preloading/components/PreloadingString.ts +12 -3
- package/front_end/panels/application/preloading/helper/PreloadingForward.ts +14 -0
- package/front_end/panels/autofill/AutofillView.ts +4 -8
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +37 -3
- package/front_end/panels/changes/ChangesSidebar.ts +2 -6
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +27 -8
- package/front_end/panels/console/ConsoleSidebar.ts +3 -11
- 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/lighthouse/LighthouseStartView.ts +3 -5
- package/front_end/panels/lighthouse/lighthouseStartView.css +6 -0
- package/front_end/panels/network/NetworkLogView.ts +67 -108
- package/front_end/panels/network/RequestConditionsDrawer.ts +40 -131
- package/front_end/panels/network/RequestInitiatorView.ts +19 -8
- package/front_end/panels/network/network-meta.ts +4 -27
- package/front_end/panels/settings/AISettingsTab.ts +1 -5
- package/front_end/panels/settings/SettingsScreen.ts +0 -51
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +4 -1
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +13 -16
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -1
- 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 +16 -8
- package/front_end/ui/legacy/Treeoutline.ts +4 -4
- package/front_end/ui/legacy/UIUtils.ts +35 -4
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +6 -11
- package/front_end/ui/legacy/components/utils/Linkifier.ts +4 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataHttpNotFound.md +0 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataInvalidResponse.md +0 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataNoResponse.md +0 -1
- package/front_end/panels/elements/computedStyleSidebarPane.css +0 -18
|
@@ -10,7 +10,6 @@ import '../../ui/components/tooltips/tooltips.js';
|
|
|
10
10
|
import type * as Common from '../../core/common/common.js';
|
|
11
11
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
12
12
|
import * as Platform from '../../core/platform/platform.js';
|
|
13
|
-
import * as Root from '../../core/root/root.js';
|
|
14
13
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
15
14
|
import * as Logs from '../../models/logs/logs.js';
|
|
16
15
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
@@ -28,34 +27,18 @@ const {ref, live} = Directives;
|
|
|
28
27
|
const {widgetConfig} = UI.Widget;
|
|
29
28
|
|
|
30
29
|
const UIStrings = {
|
|
31
|
-
/**
|
|
32
|
-
* @description Text to enable blocking of network requests
|
|
33
|
-
*/
|
|
34
|
-
enableNetworkRequestBlocking: 'Enable network request blocking',
|
|
35
30
|
/**
|
|
36
31
|
* @description Text to enable blocking of network requests
|
|
37
32
|
*/
|
|
38
33
|
enableBlockingAndThrottling: 'Enable blocking and throttling',
|
|
39
|
-
/**
|
|
40
|
-
* @description Tooltip text that appears when hovering over the plus button in the Blocked URLs Pane of the Network panel
|
|
41
|
-
*/
|
|
42
|
-
addPattern: 'Add pattern',
|
|
43
34
|
/**
|
|
44
35
|
* @description Tooltip text that appears when hovering over the plus button in the Blocked URLs Pane of the Network panel
|
|
45
36
|
*/
|
|
46
37
|
addRule: 'Add rule',
|
|
47
|
-
/**
|
|
48
|
-
* @description Accessible label for the button to add request blocking patterns in the network request blocking tool
|
|
49
|
-
*/
|
|
50
|
-
addNetworkRequestBlockingPattern: 'Add network request blocking pattern',
|
|
51
38
|
/**
|
|
52
39
|
* @description Accessible label for the button to add request blocking patterns in the network request blocking tool
|
|
53
40
|
*/
|
|
54
41
|
addPatternLabel: 'Add network request throttling or blocking pattern',
|
|
55
|
-
/**
|
|
56
|
-
* @description Text that shows in the network request blocking panel if no pattern has yet been added.
|
|
57
|
-
*/
|
|
58
|
-
noNetworkRequestsBlocked: 'No blocked network requests',
|
|
59
42
|
/**
|
|
60
43
|
* @description Text that shows in the network request blocking panel if no pattern has yet been added.
|
|
61
44
|
*/
|
|
@@ -66,25 +49,11 @@ const UIStrings = {
|
|
|
66
49
|
*/
|
|
67
50
|
noThrottlingOrBlockingPattern:
|
|
68
51
|
`To throttle or block a network request, add a rule here manually or via the network panel's context menu. {PH1}`,
|
|
69
|
-
/**
|
|
70
|
-
* @description Text that shows in the network request blocking panel if no pattern has yet been added.
|
|
71
|
-
* @example {Add pattern} PH1
|
|
72
|
-
*/
|
|
73
|
-
addPatternToBlock: 'Add a pattern by clicking on the "{PH1}" button.',
|
|
74
|
-
/**
|
|
75
|
-
* @description Text in Blocked URLs Pane of the Network panel
|
|
76
|
-
* @example {4} PH1
|
|
77
|
-
*/
|
|
78
|
-
dBlocked: '{PH1} blocked',
|
|
79
52
|
/**
|
|
80
53
|
* @description Text in Blocked URLs Pane of the Network panel
|
|
81
54
|
* @example {4} PH1
|
|
82
55
|
*/
|
|
83
56
|
dAffected: '{PH1} affected',
|
|
84
|
-
/**
|
|
85
|
-
* @description Text in Blocked URLs Pane of the Network panel
|
|
86
|
-
*/
|
|
87
|
-
textPatternToBlockMatching: 'Text pattern to block matching requests; use * for wildcard',
|
|
88
57
|
/**
|
|
89
58
|
* @description Text in Blocked URLs Pane of the Network panel
|
|
90
59
|
*/
|
|
@@ -178,7 +147,6 @@ interface ViewInput {
|
|
|
178
147
|
}
|
|
179
148
|
type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
180
149
|
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
181
|
-
const individualThrottlingEnabled = Boolean(Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled);
|
|
182
150
|
render(
|
|
183
151
|
// clang-format off
|
|
184
152
|
html`
|
|
@@ -187,31 +155,24 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
187
155
|
?checked=${input.enabled}
|
|
188
156
|
@click=${input.toggleEnabled}
|
|
189
157
|
.jslogContext=${'network.enable-request-blocking'}>
|
|
190
|
-
${
|
|
191
|
-
: i18nString(UIStrings.enableNetworkRequestBlocking)}
|
|
158
|
+
${i18nString(UIStrings.enableBlockingAndThrottling)}
|
|
192
159
|
</devtools-checkbox>
|
|
193
160
|
<div class="toolbar-divider"></div>
|
|
194
161
|
<devtools-button ${bindToAction('network.add-network-request-blocking-pattern')}></devtools-button>
|
|
195
162
|
<devtools-button ${bindToAction('network.remove-all-network-request-blocking-patterns')}></devtools-button>
|
|
196
163
|
</devtools-toolbar>
|
|
197
164
|
<div class=empty-state ${ref(e => input.list.setEmptyPlaceholder(e ?? null))}>
|
|
198
|
-
<span class=empty-state-header>${
|
|
199
|
-
? i18nString(UIStrings.noPattern)
|
|
200
|
-
: i18nString(UIStrings.noNetworkRequestsBlocked)}</span>
|
|
165
|
+
<span class=empty-state-header>${i18nString(UIStrings.noPattern)}</span>
|
|
201
166
|
<div class=empty-state-description>
|
|
202
|
-
${
|
|
203
|
-
? uiI18n.getFormatLocalizedStringTemplate(str_, UIStrings.noThrottlingOrBlockingPattern, {PH1: learnMore()})
|
|
204
|
-
: html`<span>${i18nString(UIStrings.addPatternToBlock,
|
|
205
|
-
{PH1: i18nString(UIStrings.addPattern)})}</span>${learnMore()}`}
|
|
167
|
+
${uiI18n.getFormatLocalizedStringTemplate(str_, UIStrings.noThrottlingOrBlockingPattern, {PH1: learnMore()})}
|
|
206
168
|
</div>
|
|
207
169
|
<devtools-button
|
|
208
170
|
@click=${input.addPattern}
|
|
209
171
|
class=add-button
|
|
210
172
|
.jslogContext=${'network.add-network-request-blocking-pattern'}
|
|
211
|
-
title=${
|
|
212
|
-
: i18nString(UIStrings.addNetworkRequestBlockingPattern)}
|
|
173
|
+
title=${i18nString(UIStrings.addPatternLabel)}
|
|
213
174
|
.variant=${Buttons.Button.Variant.TONAL}>
|
|
214
|
-
${
|
|
175
|
+
${i18nString(UIStrings.addRule)}
|
|
215
176
|
</devtools-button>
|
|
216
177
|
</div>
|
|
217
178
|
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(UI.Widget.VBox)}>
|
|
@@ -227,35 +188,11 @@ interface AffectedCountViewInput {
|
|
|
227
188
|
}
|
|
228
189
|
type AffectedCountView = (input: AffectedCountViewInput, output: object, target: HTMLElement) => void;
|
|
229
190
|
export const AFFECTED_COUNT_DEFAULT_VIEW: AffectedCountView = (input, output, target) => {
|
|
230
|
-
|
|
231
|
-
render(html`${i18nString(UIStrings.dAffected, {PH1: input.count})}`, target);
|
|
232
|
-
} else {
|
|
233
|
-
render(html`${i18nString(UIStrings.dBlocked, {PH1: input.count})}`, target);
|
|
234
|
-
}
|
|
191
|
+
render(html`${i18nString(UIStrings.dAffected, {PH1: input.count})}`, target);
|
|
235
192
|
};
|
|
236
193
|
|
|
237
194
|
function matchesUrl(conditions: SDK.NetworkManager.RequestCondition, url: string): boolean {
|
|
238
|
-
|
|
239
|
-
let pos = 0;
|
|
240
|
-
const parts = pattern.split('*');
|
|
241
|
-
for (let index = 0; index < parts.length; index++) {
|
|
242
|
-
const part = parts[index];
|
|
243
|
-
if (!part.length) {
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
pos = url.indexOf(part, pos);
|
|
247
|
-
if (pos === -1) {
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
pos += part.length;
|
|
251
|
-
}
|
|
252
|
-
return true;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return Boolean(
|
|
256
|
-
Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled ?
|
|
257
|
-
conditions.originalOrUpgradedURLPattern?.test(url) :
|
|
258
|
-
(conditions.wildcardURL && matchesPattern(conditions.wildcardURL, url)));
|
|
195
|
+
return Boolean(conditions.originalOrUpgradedURLPattern?.test(url));
|
|
259
196
|
}
|
|
260
197
|
|
|
261
198
|
export class AffectedCountWidget extends UI.Widget.Widget {
|
|
@@ -290,9 +227,8 @@ export class AffectedCountWidget extends UI.Widget.Widget {
|
|
|
290
227
|
return;
|
|
291
228
|
}
|
|
292
229
|
|
|
293
|
-
const count =
|
|
294
|
-
|
|
295
|
-
this.#drawer.throttledRequestsCount(this.#condition);
|
|
230
|
+
const count = this.#condition.isBlocking ? this.#drawer.blockedRequestsCount(this.#condition) :
|
|
231
|
+
this.#drawer.throttledRequestsCount(this.#condition);
|
|
296
232
|
|
|
297
233
|
this.#view({count}, {}, this.element);
|
|
298
234
|
}
|
|
@@ -420,23 +356,22 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
420
356
|
|
|
421
357
|
const {enabled, originalOrUpgradedURLPattern, constructorStringOrWildcardURL, wildcardURL} = condition;
|
|
422
358
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
// clang-format off
|
|
359
|
+
const moveUp = (e: Event): void => {
|
|
360
|
+
if (this.manager.requestConditions.conditionsEnabled) {
|
|
361
|
+
UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedUp));
|
|
362
|
+
e.consume(true);
|
|
363
|
+
this.manager.requestConditions.increasePriority(condition);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
const moveDown = (e: Event): void => {
|
|
367
|
+
if (this.manager.requestConditions.conditionsEnabled) {
|
|
368
|
+
UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedDown));
|
|
369
|
+
e.consume(true);
|
|
370
|
+
this.manager.requestConditions.decreasePriority(condition);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
render(
|
|
374
|
+
// clang-format off
|
|
440
375
|
html`
|
|
441
376
|
<input class=blocked-url-checkbox
|
|
442
377
|
@change=${toggle}
|
|
@@ -512,23 +447,8 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
512
447
|
<devtools-widget
|
|
513
448
|
?disabled=${!editable || !originalOrUpgradedURLPattern}
|
|
514
449
|
.widgetConfig=${widgetConfig(AffectedCountWidget, {condition, drawer: this})}></devtools-widget>`,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
} else {
|
|
518
|
-
render(
|
|
519
|
-
// clang-format off
|
|
520
|
-
html`
|
|
521
|
-
<input class=blocked-url-checkbox
|
|
522
|
-
@change=${toggle}
|
|
523
|
-
type=checkbox
|
|
524
|
-
.checked=${condition.enabled}
|
|
525
|
-
.disabled=${!editable}
|
|
526
|
-
jslog=${VisualLogging.toggle().track({ change: true })}>
|
|
527
|
-
<div @click=${toggle} class=blocked-url-label>${wildcardURL}</div>
|
|
528
|
-
<devtools-widget .widgetConfig=${widgetConfig(AffectedCountWidget, {condition, drawer: this})}></devtools-widget>`,
|
|
529
|
-
// clang-format on
|
|
530
|
-
element);
|
|
531
|
-
}
|
|
450
|
+
// clang-format on
|
|
451
|
+
element);
|
|
532
452
|
}
|
|
533
453
|
|
|
534
454
|
private toggleEnabled(): void {
|
|
@@ -543,9 +463,7 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
543
463
|
|
|
544
464
|
beginEdit(pattern: SDK.NetworkManager.RequestCondition): UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition> {
|
|
545
465
|
this.editor = this.createEditor();
|
|
546
|
-
this.editor.control('url').value =
|
|
547
|
-
pattern.constructorStringOrWildcardURL :
|
|
548
|
-
pattern.wildcardURL ?? '';
|
|
466
|
+
this.editor.control('url').value = pattern.constructorStringOrWildcardURL;
|
|
549
467
|
return this.editor;
|
|
550
468
|
}
|
|
551
469
|
|
|
@@ -553,9 +471,7 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
553
471
|
item: SDK.NetworkManager.RequestCondition, editor: UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>,
|
|
554
472
|
isNew: boolean): void {
|
|
555
473
|
const constructorString = editor.control('url').value as SDK.NetworkManager.URLPatternConstructorString;
|
|
556
|
-
const pattern =
|
|
557
|
-
SDK.NetworkManager.RequestURLPattern.create(constructorString) :
|
|
558
|
-
constructorString;
|
|
474
|
+
const pattern = SDK.NetworkManager.RequestURLPattern.create(constructorString);
|
|
559
475
|
if (!pattern) {
|
|
560
476
|
throw new Error('Failed to parse pattern');
|
|
561
477
|
}
|
|
@@ -574,14 +490,10 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
574
490
|
const content = editor.contentElement();
|
|
575
491
|
const titles = content.createChild('div', 'blocked-url-edit-row');
|
|
576
492
|
const label = titles.createChild('label');
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
label.textContent = i18nString(UIStrings.textEditPattern);
|
|
582
|
-
} else {
|
|
583
|
-
label.textContent = i18nString(UIStrings.textPatternToBlockMatching);
|
|
584
|
-
}
|
|
493
|
+
const learnMore = Link.create(PATTERN_API_DOCS_URL, i18nString(UIStrings.learnMore), undefined, 'learn-more');
|
|
494
|
+
learnMore.title = i18nString(UIStrings.learnMoreLabel);
|
|
495
|
+
titles.append('\xA0', learnMore);
|
|
496
|
+
label.textContent = i18nString(UIStrings.textEditPattern);
|
|
585
497
|
const fields = content.createChild('div', 'blocked-url-edit-row');
|
|
586
498
|
const validator =
|
|
587
499
|
(_item: SDK.NetworkManager.RequestCondition, _index: number, input: UI.ListWidget.EditorControl): {
|
|
@@ -594,14 +506,12 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
594
506
|
if (this.manager.requestConditions.has(input.value)) {
|
|
595
507
|
return {errorMessage: i18nString(UIStrings.patternAlreadyExists), valid: false};
|
|
596
508
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
return {errorMessage: i18nString(UIStrings.patternFailedWithRegExpGroups), valid: false};
|
|
604
|
-
}
|
|
509
|
+
const isValid = SDK.NetworkManager.RequestURLPattern.isValidPattern(input.value);
|
|
510
|
+
switch (isValid) {
|
|
511
|
+
case SDK.NetworkManager.RequestURLPatternValidity.FAILED_TO_PARSE:
|
|
512
|
+
return {errorMessage: i18nString(UIStrings.patternFailedToParse), valid: false};
|
|
513
|
+
case SDK.NetworkManager.RequestURLPatternValidity.HAS_REGEXP_GROUPS:
|
|
514
|
+
return {errorMessage: i18nString(UIStrings.patternFailedWithRegExpGroups), valid: false};
|
|
605
515
|
}
|
|
606
516
|
return {valid: true, errorMessage: undefined};
|
|
607
517
|
};
|
|
@@ -613,8 +523,7 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
613
523
|
|
|
614
524
|
update(): void {
|
|
615
525
|
const enabled = this.manager.requestConditions.conditionsEnabled;
|
|
616
|
-
const newItems = Array.from(this.manager.requestConditions.conditions
|
|
617
|
-
pattern => Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled || pattern.wildcardURL));
|
|
526
|
+
const newItems = Array.from(this.manager.requestConditions.conditions);
|
|
618
527
|
|
|
619
528
|
let oldIndex = 0;
|
|
620
529
|
for (; oldIndex < newItems.length; ++oldIndex) {
|
|
@@ -37,7 +37,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/network/RequestInitiatorView.ts
|
|
|
37
37
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
38
38
|
export interface ViewInput {
|
|
39
39
|
initiatorGraph: Logs.NetworkLog.InitiatorGraph;
|
|
40
|
-
|
|
40
|
+
stackTrace: StackTrace.StackTrace.StackTrace|null;
|
|
41
41
|
request: SDK.NetworkRequest.NetworkRequest;
|
|
42
42
|
linkifier: Components.Linkifier.Linkifier;
|
|
43
43
|
target?: SDK.Target.Target;
|
|
@@ -45,7 +45,7 @@ export interface ViewInput {
|
|
|
45
45
|
|
|
46
46
|
export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
|
|
47
47
|
const hasInitiatorData =
|
|
48
|
-
input.initiatorGraph.initiators.size > 1 || input.initiatorGraph.initiated.size > 1 || input.
|
|
48
|
+
input.initiatorGraph.initiators.size > 1 || input.initiatorGraph.initiated.size > 1 || input.stackTrace;
|
|
49
49
|
|
|
50
50
|
if (!hasInitiatorData) {
|
|
51
51
|
render(
|
|
@@ -59,6 +59,9 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const renderStackTraceSection = (): Lit.TemplateResult => {
|
|
62
|
+
if (!input.stackTrace) {
|
|
63
|
+
return html`${nothing}`;
|
|
64
|
+
}
|
|
62
65
|
return html`
|
|
63
66
|
<li role="treeitem" class="request-initiator-view-section-title" aria-expanded="true">
|
|
64
67
|
${i18nString(UIStrings.requestCallStack)}
|
|
@@ -67,7 +70,8 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
67
70
|
<devtools-widget .widgetConfig=${widgetConfig(Components.JSPresentationUtils.StackTracePreviewContent, {
|
|
68
71
|
target: input.target,
|
|
69
72
|
linkifier: input.linkifier,
|
|
70
|
-
options: {
|
|
73
|
+
options: {tabStops: true},
|
|
74
|
+
stackTrace: input.stackTrace,
|
|
71
75
|
})}></devtools-widget>
|
|
72
76
|
</li>
|
|
73
77
|
</ul>
|
|
@@ -146,7 +150,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
146
150
|
${requestInitiatorViewTreeStyles}
|
|
147
151
|
</style>
|
|
148
152
|
<ul role="tree">
|
|
149
|
-
${
|
|
153
|
+
${renderStackTraceSection()}
|
|
150
154
|
${
|
|
151
155
|
(input.initiatorGraph.initiators.size > 1 || input.initiatorGraph.initiated.size > 1) ?
|
|
152
156
|
renderInitiatorChain(input.initiatorGraph) :
|
|
@@ -198,15 +202,22 @@ export class RequestInitiatorView extends UI.Widget.VBox {
|
|
|
198
202
|
return {preview, stackTrace};
|
|
199
203
|
}
|
|
200
204
|
|
|
201
|
-
override performUpdate(): void {
|
|
205
|
+
override async performUpdate(): Promise<void> {
|
|
202
206
|
const initiatorGraph = Logs.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(this.request);
|
|
203
|
-
const
|
|
207
|
+
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
204
208
|
const networkManager = SDK.NetworkManager.NetworkManager.forRequest(this.request);
|
|
205
|
-
const target = networkManager
|
|
209
|
+
const target = networkManager?.target() ?? targetManager.primaryPageTarget() ?? targetManager.rootTarget();
|
|
210
|
+
|
|
211
|
+
const rawStack = this.request.initiator()?.stack;
|
|
212
|
+
let stackTrace: StackTrace.StackTrace.StackTrace|null = null;
|
|
213
|
+
if (rawStack && target) {
|
|
214
|
+
stackTrace = await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()
|
|
215
|
+
.createStackTraceFromProtocolRuntime(rawStack, target);
|
|
216
|
+
}
|
|
206
217
|
|
|
207
218
|
const viewInput: ViewInput = {
|
|
208
219
|
initiatorGraph,
|
|
209
|
-
|
|
220
|
+
stackTrace,
|
|
210
221
|
request: this.request,
|
|
211
222
|
linkifier: this.linkifier,
|
|
212
223
|
target: target || undefined,
|
|
@@ -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]);
|
|
@@ -10,7 +10,6 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
10
|
import type * as Platform from '../../core/platform/platform.js';
|
|
11
11
|
import * as Root from '../../core/root/root.js';
|
|
12
12
|
import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
|
|
13
|
-
import * as AiCodeGeneration from '../../models/ai_code_generation/ai_code_generation.js';
|
|
14
13
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
15
14
|
import * as Input from '../../ui/components/input/input.js';
|
|
16
15
|
import * as Switch from '../../ui/components/switch/switch.js';
|
|
@@ -537,10 +536,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
537
536
|
}
|
|
538
537
|
|
|
539
538
|
if (this.#aiCodeCompletionSetting) {
|
|
540
|
-
const
|
|
541
|
-
const isAiCodeGenerationEnabled =
|
|
542
|
-
AiCodeGeneration.AiCodeGeneration.AiCodeGeneration.isAiCodeGenerationEnabled(devtoolsLocale.locale);
|
|
543
|
-
const settingItems = isAiCodeGenerationEnabled ?
|
|
539
|
+
const settingItems = Root.Runtime.hostConfig.devToolsAiCodeGeneration?.enabled ?
|
|
544
540
|
[
|
|
545
541
|
{iconName: 'code', text: i18nString(UIStrings.asYouTypeRelevantDataIsBeingSentToGoogle)}, {
|
|
546
542
|
iconName: 'text-analysis',
|
|
@@ -631,16 +631,6 @@ const GREENDEV_VIEW: View = (input, _output, target) => {
|
|
|
631
631
|
${renderPrototypeCheckboxes(input.settings, ['aiAnnotations', 'inDevToolsFloaty', 'copyToGemini'])}
|
|
632
632
|
</div>
|
|
633
633
|
</devtools-card>
|
|
634
|
-
|
|
635
|
-
<devtools-card .heading=${'GreenDev widgets'}>
|
|
636
|
-
<div class="experiments-warning-subsection">
|
|
637
|
-
<devtools-icon .name=${'warning'}></devtools-icon>
|
|
638
|
-
<span>${i18nString(UIStrings.greenDevUnstable)}</span>
|
|
639
|
-
</div>
|
|
640
|
-
<div class="settings-experiments-block greendev-widgets">
|
|
641
|
-
${renderWidgetOptions(input.settings)}
|
|
642
|
-
</div>
|
|
643
|
-
</devtools-card>
|
|
644
634
|
</div>
|
|
645
635
|
`, target);
|
|
646
636
|
// clang-format on
|
|
@@ -649,50 +639,9 @@ const GREENDEV_VIEW: View = (input, _output, target) => {
|
|
|
649
639
|
const GREENDEV_PROTOTYPE_NAMES: Record<keyof GreenDev.GreenDevSettings, string> = {
|
|
650
640
|
inDevToolsFloaty: 'In DevTools context picker',
|
|
651
641
|
aiAnnotations: 'AI auto-annotations',
|
|
652
|
-
inlineWidgets: 'Inline widgets in AI Assistance',
|
|
653
|
-
artifactViewer: 'Widgets in the Artifact viewer',
|
|
654
642
|
copyToGemini: 'Copy changes to AI Prompt'
|
|
655
643
|
};
|
|
656
644
|
|
|
657
|
-
function renderWidgetOptions(settings: GreenDev.GreenDevSettings): TemplateResult {
|
|
658
|
-
function onChange(nowActiveRadio: 'inlineWidgets'|'artifactViewer'|'none') {
|
|
659
|
-
return () => {
|
|
660
|
-
switch (nowActiveRadio) {
|
|
661
|
-
case 'inlineWidgets': {
|
|
662
|
-
settings.artifactViewer.set(false);
|
|
663
|
-
settings.inlineWidgets.set(true);
|
|
664
|
-
break;
|
|
665
|
-
}
|
|
666
|
-
case 'artifactViewer': {
|
|
667
|
-
settings.artifactViewer.set(true);
|
|
668
|
-
settings.inlineWidgets.set(false);
|
|
669
|
-
break;
|
|
670
|
-
}
|
|
671
|
-
case 'none': {
|
|
672
|
-
settings.artifactViewer.set(false);
|
|
673
|
-
settings.inlineWidgets.set(false);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
|
|
678
|
-
i18nString(UIStrings.settingsChangedReloadDevTools));
|
|
679
|
-
};
|
|
680
|
-
}
|
|
681
|
-
// clang-format off
|
|
682
|
-
return html`
|
|
683
|
-
<p class="settings-experiment">
|
|
684
|
-
<label><input type="radio" name="widgets-choice" @change=${onChange('inlineWidgets')}>${GREENDEV_PROTOTYPE_NAMES['inlineWidgets']}</label>
|
|
685
|
-
</p>
|
|
686
|
-
<p class="settings-experiment">
|
|
687
|
-
<label><input type="radio" name="widgets-choice" @change=${onChange('artifactViewer')}>${GREENDEV_PROTOTYPE_NAMES['artifactViewer']}</label>
|
|
688
|
-
</p>
|
|
689
|
-
<p class="settings-experiment">
|
|
690
|
-
<label><input type="radio" name="widgets-choice" @change=${onChange('none')}>None</label>
|
|
691
|
-
</p>
|
|
692
|
-
`;
|
|
693
|
-
// clang-format on
|
|
694
|
-
}
|
|
695
|
-
|
|
696
645
|
function renderPrototypeCheckboxes(
|
|
697
646
|
settings: GreenDev.GreenDevSettings,
|
|
698
647
|
keys: Array<keyof GreenDev.GreenDevSettings>,
|
|
@@ -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
|
|
|
@@ -48,7 +48,10 @@ export class AnimationsTrackAppender implements TrackAppender {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
#appendTrackHeaderAtLevel(currentLevel: number, expanded?: boolean): void {
|
|
51
|
-
const style = buildGroupStyle({
|
|
51
|
+
const style = buildGroupStyle({
|
|
52
|
+
useFirstLineForOverview: false,
|
|
53
|
+
collapsible: PerfUI.FlameChart.GroupCollapsibleState.IF_MULTI_ROW,
|
|
54
|
+
});
|
|
52
55
|
const group = buildTrackHeader(
|
|
53
56
|
VisualLoggingTrackName.ANIMATIONS, currentLevel, i18nString(UIStrings.animations), style,
|
|
54
57
|
/* selectable= */ true, expanded);
|
|
@@ -71,7 +71,7 @@ export class InteractionsTrackAppender implements TrackAppender {
|
|
|
71
71
|
#appendTrackHeaderAtLevel(currentLevel: number, expanded?: boolean): void {
|
|
72
72
|
const trackIsCollapsible = this.#parsedTrace.data.UserInteractions.interactionEvents.length > 0;
|
|
73
73
|
const style = buildGroupStyle({
|
|
74
|
-
collapsible: trackIsCollapsible ? PerfUI.FlameChart.GroupCollapsibleState.
|
|
74
|
+
collapsible: trackIsCollapsible ? PerfUI.FlameChart.GroupCollapsibleState.IF_MULTI_ROW :
|
|
75
75
|
PerfUI.FlameChart.GroupCollapsibleState.NEVER,
|
|
76
76
|
useDecoratorsForOverview: true,
|
|
77
77
|
});
|
|
@@ -2502,24 +2502,21 @@ export class TimelineDetailsContentHelper {
|
|
|
2502
2502
|
return null;
|
|
2503
2503
|
}
|
|
2504
2504
|
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
callFrameContents.stackTrace = stackTrace;
|
|
2512
|
-
} else {
|
|
2513
|
-
// I _think_ this only happens during tests.
|
|
2514
|
-
// See "TimelineFlameChartView > shows the details for a selected main thread event".
|
|
2515
|
-
// For now, just defer to the still-supported legacy runtime stack trace. When
|
|
2516
|
-
// that is removed, we could instead create a stub StackTrace ourselves, even
|
|
2517
|
-
// without a `target`.
|
|
2518
|
-
callFrameContents = new LegacyComponents.JSPresentationUtils.StackTracePreviewContent(
|
|
2519
|
-
undefined, this.target ?? undefined, this.#linkifier,
|
|
2520
|
-
{runtimeStackTrace, tabStops: true, showColumnNumber: true});
|
|
2505
|
+
// Fallback to the main page/root target. Maybe the main page has a source map we need.
|
|
2506
|
+
// Worst case the stack is identity mapped.
|
|
2507
|
+
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
2508
|
+
const target = this.target ?? targetManager.primaryPageTarget() ?? targetManager.rootTarget();
|
|
2509
|
+
if (!target) {
|
|
2510
|
+
return null;
|
|
2521
2511
|
}
|
|
2522
2512
|
|
|
2513
|
+
const stackTrace =
|
|
2514
|
+
await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().createStackTraceFromProtocolRuntime(
|
|
2515
|
+
runtimeStackTrace, target);
|
|
2516
|
+
const callFrameContents = new LegacyComponents.JSPresentationUtils.StackTracePreviewContent(
|
|
2517
|
+
undefined, target, this.#linkifier, {tabStops: true, showColumnNumber: true});
|
|
2518
|
+
callFrameContents.stackTrace = stackTrace;
|
|
2519
|
+
|
|
2523
2520
|
await callFrameContents.updateComplete;
|
|
2524
2521
|
if (!callFrameContents.hasContent()) {
|
|
2525
2522
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: https://chromium.googlesource.com/chromium/src
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 294287c423bbeff3981714f04e193960f503e773
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|