chrome-devtools-frontend 1.0.1582745 → 1.0.1585538
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/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
- package/front_end/core/root/Runtime.ts +12 -11
- package/front_end/core/sdk/CSSMatchedStyles.ts +3 -0
- package/front_end/core/sdk/CSSMetadata.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +63 -115
- package/front_end/entrypoint_template.html +1 -5
- package/front_end/entrypoints/main/MainImpl.ts +1 -0
- package/front_end/generated/Deprecation.ts +21 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -3
- package/front_end/generated/SupportedCSSProperties.js +6 -2
- package/front_end/generated/protocol-mapping.d.ts +2 -1
- package/front_end/generated/protocol-proxy-api.d.ts +2 -1
- package/front_end/generated/protocol.ts +14 -0
- package/front_end/models/ai_assistance/AiConversation.ts +34 -2
- package/front_end/models/ai_assistance/BuiltInAi.ts +1 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +3 -10
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +17 -9
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +5 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +16 -8
- package/front_end/models/computed_style/ComputedStyleModel.ts +20 -15
- package/front_end/models/greendev/Prototypes.ts +1 -5
- package/front_end/models/issues_manager/CorsIssue.ts +2 -9
- package/front_end/models/issues_manager/descriptions/corsLocalNetworkAccessPermissionDenied.md +2 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +20 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +28 -39
- package/front_end/panels/ai_assistance/components/ChatInput.ts +73 -95
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -2
- package/front_end/panels/ai_assistance/components/ChatView.ts +0 -2
- package/front_end/panels/autofill/AutofillView.ts +4 -8
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +37 -8
- package/front_end/panels/console/ConsoleView.ts +1 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +18 -11
- package/front_end/panels/elements/ComputedStyleWidget.ts +80 -48
- package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +18 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +459 -435
- package/front_end/panels/elements/EventListenersWidget.ts +2 -4
- package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -3
- 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 +25 -0
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +0 -8
- package/front_end/panels/network/NetworkLogView.ts +64 -105
- package/front_end/panels/network/RequestConditionsDrawer.ts +168 -233
- package/front_end/panels/network/network-meta.ts +4 -27
- package/front_end/panels/settings/SettingsScreen.ts +12 -4
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +6 -9
- package/front_end/panels/sources/CallStackSidebarPane.ts +6 -8
- package/front_end/panels/sources/DebuggerPlugin.ts +2 -1
- package/front_end/panels/sources/GoToLineQuickOpen.ts +0 -4
- package/front_end/panels/sources/OpenFileQuickOpen.ts +0 -4
- package/front_end/panels/sources/OutlineQuickOpen.ts +0 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -1
- package/front_end/panels/sources/sources-meta.ts +9 -6
- package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -12
- package/front_end/panels/timeline/TimelinePanel.ts +35 -15
- package/front_end/panels/timeline/components/Sidebar.ts +21 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -20
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +8 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +4 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/encoding.ts +5 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +3 -0
- package/front_end/ui/components/linkifier/LinkifierUtils.ts +3 -0
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +29 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +42 -18
- package/front_end/ui/components/text_editor/config.ts +6 -0
- package/front_end/ui/legacy/InspectorView.ts +41 -15
- package/front_end/ui/legacy/Toolbar.ts +12 -4
- package/front_end/ui/legacy/UIUtils.ts +56 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +4 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +2 -1
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +8 -2
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +8 -8
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +12 -9
- package/front_end/ui/legacy/components/utils/Linkifier.ts +116 -87
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/mcp/HostBindings.ts +3 -0
- package/package.json +1 -1
- package/front_end/models/issues_manager/descriptions/corsInsecurePrivateNetwork.md +0 -10
- package/front_end/models/issues_manager/descriptions/corsPreflightAllowPrivateNetworkError.md +0 -10
- package/front_end/models/issues_manager/descriptions/corsPrivateNetworkPermissionDenied.md +0 -10
- package/front_end/panels/elements/computedStyleSidebarPane.css +0 -18
- package/front_end/ui/legacy/Floaty.ts +0 -438
- package/front_end/ui/legacy/floaty.css +0 -77
|
@@ -105,8 +105,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
105
105
|
<devtools-toolbar class="event-listener-toolbar" role="presentation">
|
|
106
106
|
<devtools-button ${bindToAction(input.refreshEventListenersActionName)}></devtools-button>
|
|
107
107
|
<devtools-checkbox title=${i18nString(UIStrings.showListenersOnTheAncestors)}
|
|
108
|
-
${bindToSetting(input.showForAncestorsSetting)}
|
|
109
|
-
jslog=${VisualLogging.toggle('show-event-listeners-for-ancestors').track({ change: true })}>
|
|
108
|
+
${bindToSetting(input.showForAncestorsSetting)}>
|
|
110
109
|
${i18nString(UIStrings.ancestors)}
|
|
111
110
|
</devtools-checkbox>
|
|
112
111
|
<select class="dispatch-filter"
|
|
@@ -120,8 +119,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
120
119
|
</option>`)}
|
|
121
120
|
</select>
|
|
122
121
|
<devtools-checkbox title=${i18nString(UIStrings.resolveEventListenersBoundWith)}
|
|
123
|
-
${bindToSetting(input.showFrameworkListenersSetting)}
|
|
124
|
-
jslog=${VisualLogging.toggle('show-frameowkr-listeners').track({ change: true })}>
|
|
122
|
+
${bindToSetting(input.showFrameworkListenersSetting)}>
|
|
125
123
|
${i18nString(UIStrings.frameworkListeners)}
|
|
126
124
|
</devtools-checkbox>
|
|
127
125
|
</devtools-toolbar>
|
|
@@ -45,7 +45,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export class NodeStackTraceWidget extends UI.Widget.VBox {
|
|
48
|
-
readonly #linkifier = new Components.Linkifier.Linkifier(
|
|
48
|
+
readonly #linkifier = new Components.Linkifier.Linkifier(UI.UIUtils.MaxLengthForDisplayedURLsInConsole);
|
|
49
49
|
readonly #view: View;
|
|
50
50
|
|
|
51
51
|
constructor(view = DEFAULT_VIEW) {
|
|
@@ -81,5 +81,3 @@ export class NodeStackTraceWidget extends UI.Widget.VBox {
|
|
|
81
81
|
this.#view(input, {}, this.contentElement);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
export const MaxLengthForLinks = 40;
|
|
@@ -86,8 +86,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
86
86
|
<div class="hbox properties-widget-toolbar">
|
|
87
87
|
<devtools-toolbar class="styles-pane-toolbar" role="presentation">
|
|
88
88
|
<devtools-toolbar-input type="filter" @change=${input.onFilterChanged} style="flex-grow:1; flex-shrink:1"></devtools-toolbar-input>
|
|
89
|
-
<devtools-checkbox title=${i18nString(UIStrings.showAllTooltip)} ${bindToSetting(getShowAllPropertiesSetting())}
|
|
90
|
-
jslog=${VisualLogging.toggle('show-all-properties').track({change: true})}>
|
|
89
|
+
<devtools-checkbox title=${i18nString(UIStrings.showAllTooltip)} ${bindToSetting(getShowAllPropertiesSetting())}>
|
|
91
90
|
${i18nString(UIStrings.showAll)}
|
|
92
91
|
</devtools-checkbox>
|
|
93
92
|
</devtools-toolbar>
|
|
@@ -2155,6 +2155,9 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
|
|
2157
2157
|
renderedPropertyText(): string {
|
|
2158
|
+
if (!this.#isConnected()) {
|
|
2159
|
+
return '';
|
|
2160
|
+
}
|
|
2158
2161
|
if (!this.nameElement || !this.valueElement) {
|
|
2159
2162
|
return '';
|
|
2160
2163
|
}
|
|
@@ -2895,8 +2898,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2895
2898
|
const regex = new RegExp(propertyNamePattern, 'i');
|
|
2896
2899
|
await computedStyleWidget.filterComputedStyles(regex);
|
|
2897
2900
|
|
|
2898
|
-
computedStyleWidget.
|
|
2899
|
-
computedStyleWidget.input.element.focus();
|
|
2901
|
+
computedStyleWidget.setFilterInput(this.property.name);
|
|
2900
2902
|
}
|
|
2901
2903
|
|
|
2902
2904
|
private copyCssDeclarationAsJs(): void {
|
|
@@ -3434,7 +3436,17 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3434
3436
|
styleTextAppliedForTest(): void {
|
|
3435
3437
|
}
|
|
3436
3438
|
|
|
3439
|
+
// If the item isn't connected to the DOM, then reading its innerText will
|
|
3440
|
+
// also include any invisible text (e.g. sources, styles), so we don't want
|
|
3441
|
+
// to do that.
|
|
3442
|
+
#isConnected(): boolean {
|
|
3443
|
+
return this.listItemElement.isConnected;
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3437
3446
|
applyStyleText(styleText: string, majorChange: boolean, property?: SDK.CSSProperty.CSSProperty|null): Promise<void> {
|
|
3447
|
+
if (!this.#isConnected()) {
|
|
3448
|
+
return Promise.resolve();
|
|
3449
|
+
}
|
|
3438
3450
|
return this.applyStyleThrottler.schedule(this.innerApplyStyleText.bind(this, styleText, majorChange, property));
|
|
3439
3451
|
}
|
|
3440
3452
|
|
|
@@ -3445,6 +3457,10 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3445
3457
|
return;
|
|
3446
3458
|
}
|
|
3447
3459
|
|
|
3460
|
+
if (!this.#isConnected()) {
|
|
3461
|
+
return;
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3448
3464
|
const oldStyleRange = this.style.range;
|
|
3449
3465
|
if (!oldStyleRange) {
|
|
3450
3466
|
return;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
.styles-sidebar-pane-toolbar {
|
|
9
|
+
border-bottom: 1px solid var(--sys-color-divider);
|
|
10
|
+
flex-shrink: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.styles-pane-toolbar {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
devtools-tree-outline {
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
devtools-toolbar-input[type="filter"] {
|
|
22
|
+
flex-grow: 1;
|
|
23
|
+
flex-shrink: 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -253,8 +253,7 @@ export abstract class AffectedResourcesView extends UI.TreeOutline.TreeElement {
|
|
|
253
253
|
const sourceCodeLocation = document.createElement('td');
|
|
254
254
|
sourceCodeLocation.classList.add('affected-source-location');
|
|
255
255
|
if (sourceLocation) {
|
|
256
|
-
const
|
|
257
|
-
const linkifier = new Components.Linkifier.Linkifier(maxLengthForDisplayedURLs);
|
|
256
|
+
const linkifier = new Components.Linkifier.Linkifier(UI.UIUtils.MaxLengthForDisplayedURLsInConsole);
|
|
258
257
|
const sourceAnchor = linkifier.linkifyScriptLocation(
|
|
259
258
|
target || null, sourceLocation.scriptId || null, sourceLocation.url as Platform.DevToolsPath.UrlString,
|
|
260
259
|
sourceLocation.lineNumber, {columnNumber: sourceLocation.columnNumber, inlineFrameIndex: 0});
|
|
@@ -1185,14 +1185,6 @@ export class NetworkRequestNode extends NetworkNode {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
|
|
1187
1187
|
override select(suppressSelectedEvent?: boolean): void {
|
|
1188
|
-
const id = this.request()?.requestId();
|
|
1189
|
-
if (id) {
|
|
1190
|
-
const floatyHandled =
|
|
1191
|
-
UI.Floaty.onFloatyClick({type: UI.Floaty.FloatyContextTypes.NETWORK_REQUEST, data: {requestId: id}});
|
|
1192
|
-
if (floatyHandled) {
|
|
1193
|
-
return;
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
1188
|
super.select(suppressSelectedEvent);
|
|
1197
1189
|
this.parentView().dispatchEventToListeners(Events.RequestSelected, this.requestInternal);
|
|
1198
1190
|
}
|
|
@@ -39,7 +39,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
39
39
|
import * as Host from '../../core/host/host.js';
|
|
40
40
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
41
41
|
import * as Platform from '../../core/platform/platform.js';
|
|
42
|
-
import * as Root from '../../core/root/root.js';
|
|
43
42
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
44
43
|
import * as Protocol from '../../generated/protocol.js';
|
|
45
44
|
import * as Annotations from '../../models/annotations/annotations.js';
|
|
@@ -1722,21 +1721,21 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1722
1721
|
}
|
|
1723
1722
|
|
|
1724
1723
|
UI.Context.Context.instance().setFlavor(SDK.NetworkRequest.NetworkRequest, request);
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1724
|
+
const action = UI.ActionRegistry.ActionRegistry.instance().getAction(openAiAssistanceId);
|
|
1725
|
+
const submenu = contextMenu.footerSection().appendSubMenuItem(action.title(), false, openAiAssistanceId);
|
|
1726
|
+
submenu.defaultSection().appendAction(openAiAssistanceId, i18nString(UIStrings.startAChat));
|
|
1727
|
+
appendSubmenuPromptAction(
|
|
1728
|
+
submenu, action, i18nString(UIStrings.explainPurpose), 'What is the purpose of this request?',
|
|
1729
|
+
openAiAssistanceId + '.purpose');
|
|
1730
|
+
appendSubmenuPromptAction(
|
|
1731
|
+
submenu, action, i18nString(UIStrings.explainSlowness), 'Why is this request taking so long?',
|
|
1732
|
+
openAiAssistanceId + '.slowness');
|
|
1733
|
+
appendSubmenuPromptAction(
|
|
1734
|
+
submenu, action, i18nString(UIStrings.explainFailures), 'Why is the request failing?',
|
|
1735
|
+
openAiAssistanceId + '.failures');
|
|
1736
|
+
appendSubmenuPromptAction(
|
|
1737
|
+
submenu, action, i18nString(UIStrings.assessSecurityHeaders), 'Are there any security headers present?',
|
|
1738
|
+
openAiAssistanceId + '.security');
|
|
1740
1739
|
}
|
|
1741
1740
|
copyMenu.defaultSection().appendItem(
|
|
1742
1741
|
i18nString(UIStrings.copyURL),
|
|
@@ -1854,98 +1853,58 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1854
1853
|
const maxBlockedURLLength = 20;
|
|
1855
1854
|
const manager = SDK.NetworkManager.MultitargetNetworkManager.instance();
|
|
1856
1855
|
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
manager.requestConditions.conditionsEnabled = true;
|
|
1856
|
+
function removeRequestCondition(pattern: SDK.NetworkManager.RequestURLPattern): void {
|
|
1857
|
+
const entry = manager.requestConditions.findCondition(pattern.constructorString);
|
|
1858
|
+
if (entry) {
|
|
1859
|
+
manager.requestConditions.delete(entry);
|
|
1862
1860
|
void UI.ViewManager.ViewManager.instance().showView('network.blocked-urls');
|
|
1863
1861
|
}
|
|
1862
|
+
}
|
|
1864
1863
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
if (urlWithoutScheme && !manager.requestConditions.has(urlWithoutScheme)) {
|
|
1875
|
-
contextMenu.debugSection().appendItem(
|
|
1876
|
-
i18nString(UIStrings.blockRequestUrl), addBlockedURL.bind(null, urlWithoutScheme),
|
|
1877
|
-
{jslogContext: 'block-request-url'});
|
|
1878
|
-
} else if (urlWithoutScheme) {
|
|
1879
|
-
const croppedURL = Platform.StringUtilities.trimMiddle(urlWithoutScheme, maxBlockedURLLength);
|
|
1880
|
-
contextMenu.debugSection().appendItem(
|
|
1881
|
-
i18nString(UIStrings.unblockS, {PH1: croppedURL}), removeBlockedURL.bind(null, urlWithoutScheme),
|
|
1882
|
-
{jslogContext: 'unblock'});
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
const domain = request.parsedURL.domain();
|
|
1886
|
-
if (domain && !manager.requestConditions.has(domain)) {
|
|
1887
|
-
contextMenu.debugSection().appendItem(
|
|
1888
|
-
i18nString(UIStrings.blockRequestDomain), addBlockedURL.bind(null, domain),
|
|
1889
|
-
{jslogContext: 'block-request-domain'});
|
|
1890
|
-
} else if (domain) {
|
|
1891
|
-
const croppedDomain = Platform.StringUtilities.trimMiddle(domain, maxBlockedURLLength);
|
|
1892
|
-
contextMenu.debugSection().appendItem(
|
|
1893
|
-
i18nString(UIStrings.unblockS, {PH1: croppedDomain}), removeBlockedURL.bind(null, domain),
|
|
1894
|
-
{jslogContext: 'unblock'});
|
|
1895
|
-
}
|
|
1896
|
-
} else {
|
|
1897
|
-
function removeRequestCondition(pattern: SDK.NetworkManager.RequestURLPattern): void {
|
|
1898
|
-
const entry = manager.requestConditions.findCondition(pattern.constructorString);
|
|
1899
|
-
if (entry) {
|
|
1900
|
-
manager.requestConditions.delete(entry);
|
|
1901
|
-
void UI.ViewManager.ViewManager.instance().showView('network.blocked-urls');
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
function addRequestCondition(
|
|
1906
|
-
pattern: SDK.NetworkManager.RequestURLPattern,
|
|
1907
|
-
conditions: SDK.NetworkManager.ThrottlingConditions,
|
|
1908
|
-
): void {
|
|
1909
|
-
const entry = manager.requestConditions.findCondition(pattern.constructorString);
|
|
1910
|
-
if (entry) {
|
|
1911
|
-
entry.conditions = conditions;
|
|
1912
|
-
} else {
|
|
1913
|
-
manager.requestConditions.add(SDK.NetworkManager.RequestCondition.create(pattern, conditions));
|
|
1914
|
-
}
|
|
1915
|
-
manager.requestConditions.conditionsEnabled = true;
|
|
1916
|
-
void UI.ViewManager.ViewManager.instance().showView('network.blocked-urls');
|
|
1864
|
+
function addRequestCondition(
|
|
1865
|
+
pattern: SDK.NetworkManager.RequestURLPattern,
|
|
1866
|
+
conditions: SDK.NetworkManager.ThrottlingConditions,
|
|
1867
|
+
): void {
|
|
1868
|
+
const entry = manager.requestConditions.findCondition(pattern.constructorString);
|
|
1869
|
+
if (entry) {
|
|
1870
|
+
entry.conditions = conditions;
|
|
1871
|
+
} else {
|
|
1872
|
+
manager.requestConditions.add(SDK.NetworkManager.RequestCondition.create(pattern, conditions));
|
|
1917
1873
|
}
|
|
1874
|
+
manager.requestConditions.conditionsEnabled = true;
|
|
1875
|
+
void UI.ViewManager.ViewManager.instance().showView('network.blocked-urls');
|
|
1876
|
+
}
|
|
1918
1877
|
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1878
|
+
const blockingMenu =
|
|
1879
|
+
contextMenu.debugSection().appendSubMenuItem(i18nString(UIStrings.blockRequests), /* disabled=*/ true);
|
|
1880
|
+
const throttlingMenu =
|
|
1881
|
+
contextMenu.debugSection().appendSubMenuItem(i18nString(UIStrings.throttleRequests), /* disabled=*/ true);
|
|
1882
|
+
|
|
1883
|
+
const urlWithoutScheme = request.parsedURL.urlWithoutScheme();
|
|
1884
|
+
const urlPattern = urlWithoutScheme &&
|
|
1885
|
+
SDK.NetworkManager.RequestURLPattern.create(
|
|
1886
|
+
`*://${urlWithoutScheme}` as SDK.NetworkManager.URLPatternConstructorString);
|
|
1887
|
+
if (urlPattern) {
|
|
1888
|
+
throttlingMenu.setEnabled(true);
|
|
1889
|
+
blockingMenu.setEnabled(true);
|
|
1890
|
+
const existingConditions = manager.requestConditions.findCondition(urlPattern.constructorString);
|
|
1891
|
+
const isBlocking = existingConditions?.conditions === SDK.NetworkManager.BlockingConditions;
|
|
1892
|
+
const isThrottling = existingConditions &&
|
|
1893
|
+
existingConditions.conditions !== SDK.NetworkManager.BlockingConditions &&
|
|
1894
|
+
existingConditions.conditions !== SDK.NetworkManager.NoThrottlingConditions;
|
|
1895
|
+
const croppedURL = Platform.StringUtilities.trimMiddle(urlPattern.constructorString, maxBlockedURLLength);
|
|
1896
|
+
blockingMenu.debugSection().appendItem(
|
|
1897
|
+
isBlocking ? i18nString(UIStrings.unblockS, {PH1: croppedURL}) : i18nString(UIStrings.blockRequestUrl),
|
|
1898
|
+
() => isBlocking ? removeRequestCondition(urlPattern) :
|
|
1899
|
+
addRequestCondition(urlPattern, SDK.NetworkManager.BlockingConditions),
|
|
1900
|
+
{jslogContext: 'block-request-url'});
|
|
1901
|
+
throttlingMenu.debugSection().appendItem(
|
|
1902
|
+
isThrottling ? i18nString(UIStrings.unthrottleS, {PH1: croppedURL}) :
|
|
1903
|
+
i18nString(UIStrings.throttleRequestUrl),
|
|
1904
|
+
() => isThrottling ? removeRequestCondition(urlPattern) :
|
|
1905
|
+
addRequestCondition(urlPattern, SDK.NetworkManager.Slow3GConditions),
|
|
1906
|
+
{jslogContext: 'throttle-request-url'});
|
|
1907
|
+
}
|
|
1949
1908
|
|
|
1950
1909
|
const domain = request.parsedURL.domain();
|
|
1951
1910
|
const domainPattern = domain &&
|
|
@@ -1971,7 +1930,6 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1971
1930
|
() => isThrottling ? removeRequestCondition(domainPattern) :
|
|
1972
1931
|
addRequestCondition(domainPattern, SDK.NetworkManager.Slow3GConditions),
|
|
1973
1932
|
{jslogContext: 'throttle-request-domain'});
|
|
1974
|
-
}
|
|
1975
1933
|
}
|
|
1976
1934
|
|
|
1977
1935
|
if (SDK.NetworkManager.NetworkManager.canReplayRequest(request)) {
|
|
@@ -2758,7 +2716,8 @@ export class MoreFiltersDropDownUI extends Common.ObjectWrapper.ObjectWrapper<UI
|
|
|
2758
2716
|
this.updateActiveFiltersCount();
|
|
2759
2717
|
|
|
2760
2718
|
this.dropDownButton = new UI.Toolbar.ToolbarMenuButton(
|
|
2761
|
-
this.showMoreFiltersContextMenu.bind(this),
|
|
2719
|
+
this.showMoreFiltersContextMenu.bind(this),
|
|
2720
|
+
/* isIconDropdown=*/ false, /* useSoftMenu=*/ true,
|
|
2762
2721
|
/* jslogContext=*/ undefined, /* iconName=*/ undefined,
|
|
2763
2722
|
/* keepOpen=*/ true);
|
|
2764
2723
|
this.dropDownButton.setTitle(i18nString(UIStrings.showOnlyHideRequests));
|