chrome-devtools-frontend 1.0.1531367 → 1.0.1532884
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/AUTHORS +3 -0
- package/front_end/core/platform/ArrayUtilities.ts +1 -1
- package/front_end/core/protocol_client/ConnectionTransport.ts +26 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +24 -42
- package/front_end/core/protocol_client/protocol_client.ts +2 -10
- package/front_end/core/root/Runtime.ts +0 -2
- package/front_end/core/sdk/ChildTargetManager.ts +3 -3
- package/front_end/core/sdk/Connections.ts +8 -8
- package/front_end/core/sdk/NetworkManager.ts +20 -0
- package/front_end/core/sdk/RehydratingConnection.ts +6 -4
- package/front_end/core/sdk/Target.ts +2 -1
- package/front_end/core/sdk/TargetManager.ts +2 -1
- package/front_end/entrypoints/node_app/NodeMain.ts +1 -1
- package/front_end/generated/ARIAProperties.js +1301 -174
- package/front_end/generated/Deprecation.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.js +1 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +1 -1
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +4 -3
- package/front_end/models/issues_manager/BounceTrackingIssue.ts +4 -3
- package/front_end/models/issues_manager/ClientHintIssue.ts +4 -3
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +4 -3
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +5 -3
- package/front_end/models/issues_manager/CookieIssue.ts +4 -4
- package/front_end/models/issues_manager/CorsIssue.ts +3 -3
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +2 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +4 -3
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +4 -3
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +4 -3
- package/front_end/models/issues_manager/GenericIssue.ts +3 -3
- package/front_end/models/issues_manager/HeavyAdIssue.ts +3 -3
- package/front_end/models/issues_manager/IssuesManager.ts +3 -3
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +5 -3
- package/front_end/models/issues_manager/MixedContentIssue.ts +4 -3
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +5 -3
- package/front_end/models/issues_manager/PropertyRuleIssue.ts +4 -3
- package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -3
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +5 -3
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -3
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +5 -3
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +5 -3
- package/front_end/models/issues_manager/UnencodedDigestIssue.ts +5 -3
- package/front_end/models/issues_manager/UserReidentificationIssue.ts +4 -3
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/trace/extras/TraceTree.ts +13 -3
- package/front_end/models/trace/insights/ForcedReflow.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +16 -3
- package/front_end/panels/console/ConsoleInsightTeaser.ts +40 -48
- package/front_end/panels/console/consoleInsightTeaser.css +13 -0
- package/front_end/panels/lighthouse/LighthousePanel.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -1
- package/front_end/panels/network/{BlockedURLsPane.ts → RequestConditionsDrawer.ts} +78 -28
- package/front_end/panels/network/network-meta.ts +33 -9
- package/front_end/panels/network/network.ts +3 -3
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +18 -6
- package/front_end/panels/recorder/components/stepView.css +2 -2
- package/front_end/panels/sources/SourcesPanel.ts +10 -9
- package/front_end/panels/sources/SourcesSearchScope.ts +5 -0
- package/front_end/panels/timeline/TimelinePanel.ts +1 -2
- package/front_end/panels/timeline/TimingsTrackAppender.ts +10 -8
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +2 -8
- package/front_end/panels/timeline/components/insights/ForcedReflow.ts +2 -2
- 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/api/HTTPRequest.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +20 -14
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +2 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.js +30 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPResponse.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- 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.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +22 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +20 -14
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +2 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.js +31 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPResponse.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts.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/lib/types.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/package.json +5 -4
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +24 -14
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +16 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/bidi/core/Request.ts +35 -5
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +20 -0
- package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +6 -2
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +2 -1
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/JSHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +5 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +31 -5
- package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +3 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/package.json +1 -1
- /package/front_end/panels/network/{blockedURLsPane.css → requestConditionsDrawer.css} +0 -0
|
@@ -397,6 +397,7 @@ export class BottomUpRootNode extends Node {
|
|
|
397
397
|
const root = this;
|
|
398
398
|
const startTime = this.startTime;
|
|
399
399
|
const endTime = this.endTime;
|
|
400
|
+
const idStack: string[] = [];
|
|
400
401
|
const nodeById = new Map<string, Node>();
|
|
401
402
|
const selfTimeStack: number[] = [endTime - startTime];
|
|
402
403
|
const firstNodeStack: boolean[] = [];
|
|
@@ -460,6 +461,13 @@ export class BottomUpRootNode extends Node {
|
|
|
460
461
|
if (forceGroupIdCallback && eventGroupIdCallback) {
|
|
461
462
|
id = `${id}-${eventGroupIdCallback(e)}`;
|
|
462
463
|
}
|
|
464
|
+
|
|
465
|
+
idStack.push(id);
|
|
466
|
+
|
|
467
|
+
// For an event 'X' that contains another event 'X' (resolving to the same node
|
|
468
|
+
// id), we need to measure `totalTime` from the start of the outermost 'X' to
|
|
469
|
+
// its corresponding end. This logic ensures we don't double-count the duration
|
|
470
|
+
// of the inner event.
|
|
463
471
|
const noNodeOnStack = !totalTimeById.has(id);
|
|
464
472
|
if (noNodeOnStack) {
|
|
465
473
|
totalTimeById.set(id, duration);
|
|
@@ -468,10 +476,11 @@ export class BottomUpRootNode extends Node {
|
|
|
468
476
|
}
|
|
469
477
|
|
|
470
478
|
function onEndEvent(event: Types.Events.Event): void {
|
|
471
|
-
|
|
472
|
-
if (
|
|
473
|
-
|
|
479
|
+
const id = idStack.pop();
|
|
480
|
+
if (!id) {
|
|
481
|
+
return;
|
|
474
482
|
}
|
|
483
|
+
|
|
475
484
|
let node = nodeById.get(id);
|
|
476
485
|
if (!node) {
|
|
477
486
|
node = new BottomUpNode(root, id, event, false, root);
|
|
@@ -484,6 +493,7 @@ export class BottomUpRootNode extends Node {
|
|
|
484
493
|
node.totalTime += totalTimeById.get(id) || 0;
|
|
485
494
|
totalTimeById.delete(id);
|
|
486
495
|
}
|
|
496
|
+
// TODO: this may be wrong. See the skipped test in TraceTree.test.ts.
|
|
487
497
|
if (firstNodeStack.length) {
|
|
488
498
|
node.setHasChildren(true);
|
|
489
499
|
}
|
|
@@ -31,7 +31,7 @@ export const UIStrings = {
|
|
|
31
31
|
/**
|
|
32
32
|
* @description Title of a list to provide related stack trace data
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
reflowCallFrames: 'Call frames that trigger reflow',
|
|
35
35
|
/**
|
|
36
36
|
* @description Text to describe the top time-consuming function call
|
|
37
37
|
*/
|
|
@@ -1091,7 +1091,16 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1091
1091
|
// Node picker is using linkifier.
|
|
1092
1092
|
}
|
|
1093
1093
|
|
|
1094
|
-
|
|
1094
|
+
#canExecuteQuery(): boolean {
|
|
1095
|
+
const isBrandedBuild = Boolean(Root.Runtime.hostConfig.aidaAvailability?.enabled);
|
|
1096
|
+
const isBlockedByAge = Boolean(Root.Runtime.hostConfig.aidaAvailability?.blockedByAge);
|
|
1097
|
+
const isAidaAvailable = Boolean(this.#aidaAvailability === Host.AidaClient.AidaAccessPreconditions.AVAILABLE);
|
|
1098
|
+
const isUserOptedIn = Boolean(this.#aiAssistanceEnabledSetting?.getIfNotDisabled());
|
|
1099
|
+
|
|
1100
|
+
return isBrandedBuild && isAidaAvailable && isUserOptedIn && !isBlockedByAge;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
async handleAction(actionId: string, opts?: Record<string, unknown>): Promise<void> {
|
|
1095
1104
|
if (this.#isLoading && !opts?.['prompt']) {
|
|
1096
1105
|
// If running some queries already, and this action doesn't contain a predefined prompt, focus the input with the abort
|
|
1097
1106
|
// button and do nothing.
|
|
@@ -1160,13 +1169,17 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1160
1169
|
this.#updateConversationState({agent});
|
|
1161
1170
|
const predefinedPrompt = opts?.['prompt'];
|
|
1162
1171
|
if (predefinedPrompt && typeof predefinedPrompt === 'string') {
|
|
1172
|
+
if (!this.#canExecuteQuery()) {
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1163
1176
|
this.#imageInput = undefined;
|
|
1164
1177
|
this.#isTextInputEmpty = true;
|
|
1165
1178
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceQuerySubmitted);
|
|
1166
1179
|
if (this.#blockedByCrossOrigin) {
|
|
1167
1180
|
this.#handleNewChatRequest();
|
|
1168
1181
|
}
|
|
1169
|
-
|
|
1182
|
+
await this.#startConversation(predefinedPrompt);
|
|
1170
1183
|
} else {
|
|
1171
1184
|
this.#viewOutput.chatView?.focusTextInput();
|
|
1172
1185
|
}
|
|
@@ -1671,7 +1684,7 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
|
1671
1684
|
}
|
|
1672
1685
|
|
|
1673
1686
|
const widget = (await view.widget()) as AiAssistancePanel;
|
|
1674
|
-
widget.handleAction(actionId, opts);
|
|
1687
|
+
void widget.handleAction(actionId, opts);
|
|
1675
1688
|
})();
|
|
1676
1689
|
return true;
|
|
1677
1690
|
}
|
|
@@ -115,51 +115,6 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
const showPlaceholder = !Boolean(input.mainText);
|
|
118
|
-
const renderFooter = (): Lit.LitTemplate => {
|
|
119
|
-
// clang-format off
|
|
120
|
-
return html`
|
|
121
|
-
<div class="tooltip-footer">
|
|
122
|
-
${input.hasTellMeMoreButton ? html`
|
|
123
|
-
<devtools-button
|
|
124
|
-
title=${lockedString(UIStringsNotTranslate.tellMeMore)}
|
|
125
|
-
.jslogContext=${'insights-teaser-tell-me-more'},
|
|
126
|
-
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
127
|
-
@click=${input.onTellMeMoreClick}
|
|
128
|
-
>
|
|
129
|
-
<devtools-icon class="lightbulb-icon" name="lightbulb-spark"></devtools-icon>
|
|
130
|
-
${lockedString(UIStringsNotTranslate.tellMeMore)}
|
|
131
|
-
</devtools-button>
|
|
132
|
-
` : Lit.nothing}
|
|
133
|
-
${showPlaceholder ? Lit.nothing : html`
|
|
134
|
-
<devtools-button
|
|
135
|
-
.iconName=${'info'}
|
|
136
|
-
.variant=${Buttons.Button.Variant.ICON}
|
|
137
|
-
aria-details=${'teaser-info-tooltip-' + input.uuid}
|
|
138
|
-
aria-label=${lockedString(UIStringsNotTranslate.learnDataUsage)}
|
|
139
|
-
></devtools-button>
|
|
140
|
-
<devtools-tooltip id=${'teaser-info-tooltip-' + input.uuid} variant="rich">
|
|
141
|
-
<div class="info-tooltip-text">${lockedString(UIStringsNotTranslate.infoTooltipText)}</div>
|
|
142
|
-
<div class="learn-more">
|
|
143
|
-
<x-link
|
|
144
|
-
class="devtools-link"
|
|
145
|
-
title=${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}
|
|
146
|
-
href=${DATA_USAGE_URL}
|
|
147
|
-
jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('explain.teaser.learn-more')}
|
|
148
|
-
>${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}</x-link>
|
|
149
|
-
</div>
|
|
150
|
-
</devtools-tooltip>
|
|
151
|
-
`}
|
|
152
|
-
<devtools-checkbox
|
|
153
|
-
aria-label=${lockedString(UIStringsNotTranslate.dontShow)}
|
|
154
|
-
@change=${input.dontShowChanged}
|
|
155
|
-
jslog=${VisualLogging.toggle('explain.teaser.dont-show').track({ change: true })}>
|
|
156
|
-
${lockedString(UIStringsNotTranslate.dontShow)}
|
|
157
|
-
</devtools-checkbox>
|
|
158
|
-
</div>
|
|
159
|
-
`;
|
|
160
|
-
// clang-format on
|
|
161
|
-
};
|
|
162
|
-
|
|
163
118
|
// clang-format off
|
|
164
119
|
render(html`
|
|
165
120
|
<style>${consoleInsightTeaserStyles}</style>
|
|
@@ -185,7 +140,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
185
140
|
class="loader"
|
|
186
141
|
style="clip-path: url(${'#clipPath-' + input.uuid});"
|
|
187
142
|
>
|
|
188
|
-
<svg width="100%" height="
|
|
143
|
+
<svg width="100%" height="58">
|
|
189
144
|
<defs>
|
|
190
145
|
<clipPath id=${'clipPath-' + input.uuid}>
|
|
191
146
|
<rect x="0" y="0" width="100%" height="12" rx="8"></rect>
|
|
@@ -197,10 +152,47 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
197
152
|
</div>
|
|
198
153
|
` : html`
|
|
199
154
|
<h2>${input.headerText}</h2>
|
|
200
|
-
<div>${input.mainText}</div>
|
|
155
|
+
<div class="main-text">${input.mainText}</div>
|
|
201
156
|
`
|
|
202
157
|
}
|
|
203
|
-
|
|
158
|
+
<div class="tooltip-footer">
|
|
159
|
+
${input.hasTellMeMoreButton ? html`
|
|
160
|
+
<devtools-button
|
|
161
|
+
title=${lockedString(UIStringsNotTranslate.tellMeMore)}
|
|
162
|
+
.jslogContext=${'insights-teaser-tell-me-more'},
|
|
163
|
+
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
164
|
+
@click=${input.onTellMeMoreClick}
|
|
165
|
+
>
|
|
166
|
+
<devtools-icon class="lightbulb-icon" name="lightbulb-spark"></devtools-icon>
|
|
167
|
+
${lockedString(UIStringsNotTranslate.tellMeMore)}
|
|
168
|
+
</devtools-button>
|
|
169
|
+
` : Lit.nothing}
|
|
170
|
+
${showPlaceholder ? Lit.nothing : html`
|
|
171
|
+
<devtools-button
|
|
172
|
+
.iconName=${'info'}
|
|
173
|
+
.variant=${Buttons.Button.Variant.ICON}
|
|
174
|
+
aria-details=${'teaser-info-tooltip-' + input.uuid}
|
|
175
|
+
.accessibleLabel=${lockedString(UIStringsNotTranslate.learnDataUsage)}
|
|
176
|
+
></devtools-button>
|
|
177
|
+
<devtools-tooltip id=${'teaser-info-tooltip-' + input.uuid} variant="rich">
|
|
178
|
+
<div class="info-tooltip-text">${lockedString(UIStringsNotTranslate.infoTooltipText)}</div>
|
|
179
|
+
<div class="learn-more">
|
|
180
|
+
<x-link
|
|
181
|
+
class="devtools-link"
|
|
182
|
+
title=${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}
|
|
183
|
+
href=${DATA_USAGE_URL}
|
|
184
|
+
jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('explain.teaser.learn-more')}
|
|
185
|
+
>${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}</x-link>
|
|
186
|
+
</div>
|
|
187
|
+
</devtools-tooltip>
|
|
188
|
+
`}
|
|
189
|
+
<devtools-checkbox
|
|
190
|
+
aria-label=${lockedString(UIStringsNotTranslate.dontShow)}
|
|
191
|
+
@change=${input.dontShowChanged}
|
|
192
|
+
jslog=${VisualLogging.toggle('explain.teaser.dont-show').track({ change: true })}>
|
|
193
|
+
${lockedString(UIStringsNotTranslate.dontShow)}
|
|
194
|
+
</devtools-checkbox>
|
|
195
|
+
</div>
|
|
204
196
|
</div>
|
|
205
197
|
</devtools-tooltip>
|
|
206
198
|
`, target);
|
|
@@ -51,6 +51,19 @@
|
|
|
51
51
|
h2 {
|
|
52
52
|
font: var(--sys-typescale-body4-bold);
|
|
53
53
|
margin: 0 0 var(--sys-size-3);
|
|
54
|
+
line-clamp: 1;
|
|
55
|
+
-webkit-line-clamp: 1;
|
|
56
|
+
display: -webkit-box;
|
|
57
|
+
-webkit-box-orient: vertical;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.main-text {
|
|
62
|
+
line-clamp: 4;
|
|
63
|
+
-webkit-line-clamp: 4;
|
|
64
|
+
display: -webkit-box;
|
|
65
|
+
-webkit-box-orient: vertical;
|
|
66
|
+
overflow: hidden;
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
.lightbulb-icon {
|
|
@@ -328,7 +328,7 @@ export class LighthousePanel extends UI.Panel.Panel {
|
|
|
328
328
|
this.reportSelector.prepend(optionElement);
|
|
329
329
|
this.refreshToolbarUI();
|
|
330
330
|
this.renderReport(lighthouseResult);
|
|
331
|
-
this.
|
|
331
|
+
(this.auditResultsElement.querySelector('.lh-topbar__url') as HTMLElement | null)?.focus();
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
private handleDrop(dataTransfer: DataTransfer): void {
|
|
@@ -60,7 +60,7 @@ export interface LighthouseRun {
|
|
|
60
60
|
export class ProtocolService {
|
|
61
61
|
private mainSessionId?: string;
|
|
62
62
|
private rootTargetId?: string;
|
|
63
|
-
private parallelConnection?: ProtocolClient.
|
|
63
|
+
private parallelConnection?: ProtocolClient.ConnectionTransport.ConnectionTransport;
|
|
64
64
|
private lighthouseWorkerPromise?: Promise<Worker>;
|
|
65
65
|
private lighthouseMessageUpdateCallback?: ((arg0: string) => void);
|
|
66
66
|
private removeDialogHandler?: () => void;
|
|
@@ -19,7 +19,7 @@ import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/
|
|
|
19
19
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
20
20
|
import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
|
|
21
21
|
|
|
22
|
-
import
|
|
22
|
+
import requestConditionsDrawerStyles from './requestConditionsDrawer.css.js';
|
|
23
23
|
|
|
24
24
|
const {ref} = Directives;
|
|
25
25
|
|
|
@@ -28,6 +28,10 @@ const UIStrings = {
|
|
|
28
28
|
* @description Text to enable blocking of network requests
|
|
29
29
|
*/
|
|
30
30
|
enableNetworkRequestBlocking: 'Enable network request blocking',
|
|
31
|
+
/**
|
|
32
|
+
* @description Text to enable blocking of network requests
|
|
33
|
+
*/
|
|
34
|
+
enableBlockingAndThrottling: 'Enable blocking and throttling',
|
|
31
35
|
/**
|
|
32
36
|
* @description Tooltip text that appears when hovering over the plus button in the Blocked URLs Pane of the Network panel
|
|
33
37
|
*/
|
|
@@ -36,15 +40,23 @@ const UIStrings = {
|
|
|
36
40
|
* @description Accessible label for the button to add request blocking patterns in the network request blocking tool
|
|
37
41
|
*/
|
|
38
42
|
addNetworkRequestBlockingPattern: 'Add network request blocking pattern',
|
|
43
|
+
/**
|
|
44
|
+
* @description Accessible label for the button to add request blocking patterns in the network request blocking tool
|
|
45
|
+
*/
|
|
46
|
+
addPatternLabel: 'Add network request throttling or blocking pattern',
|
|
39
47
|
/**
|
|
40
48
|
* @description Text that shows in the network request blocking panel if no pattern has yet been added.
|
|
41
49
|
*/
|
|
42
50
|
noNetworkRequestsBlocked: 'No blocked network requests',
|
|
51
|
+
/**
|
|
52
|
+
* @description Text that shows in the network request blocking panel if no pattern has yet been added.
|
|
53
|
+
*/
|
|
54
|
+
noPattern: 'No request throttling or blocking patterns',
|
|
43
55
|
/**
|
|
44
56
|
* @description Text that shows in the network request blocking panel if no pattern has yet been added.
|
|
45
57
|
* @example {Add pattern} PH1
|
|
46
58
|
*/
|
|
47
|
-
addPatternToBlock: 'Add a pattern
|
|
59
|
+
addPatternToBlock: 'Add a pattern by clicking on the "{PH1}" button.',
|
|
48
60
|
/**
|
|
49
61
|
* @description Text in Blocked URLs Pane of the Network panel
|
|
50
62
|
* @example {4} PH1
|
|
@@ -57,7 +69,7 @@ const UIStrings = {
|
|
|
57
69
|
/**
|
|
58
70
|
* @description Text in Blocked URLs Pane of the Network panel
|
|
59
71
|
*/
|
|
60
|
-
|
|
72
|
+
textEditPattern: 'Text pattern to block or throttle matching requests; use URLPattern syntax.',
|
|
61
73
|
/**
|
|
62
74
|
* @description Error text for empty list widget input in Request Blocking tool
|
|
63
75
|
*/
|
|
@@ -87,8 +99,16 @@ const UIStrings = {
|
|
|
87
99
|
* @description Message to be announced for a when list item is removed from list widget
|
|
88
100
|
*/
|
|
89
101
|
learnMore: 'Learn more',
|
|
102
|
+
/**
|
|
103
|
+
* @description Aria label on a button moving an entry up
|
|
104
|
+
*/
|
|
105
|
+
increasePriority: 'Increase priority',
|
|
106
|
+
/**
|
|
107
|
+
* @description Aria label on a button moving an entry down
|
|
108
|
+
*/
|
|
109
|
+
decreasePriority: 'Decrease priority',
|
|
90
110
|
} as const;
|
|
91
|
-
const str_ = i18n.i18n.registerUIStrings('panels/network/
|
|
111
|
+
const str_ = i18n.i18n.registerUIStrings('panels/network/RequestConditionsDrawer.ts', UIStrings);
|
|
92
112
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
93
113
|
|
|
94
114
|
const NETWORK_REQUEST_BLOCKING_EXPLANATION_URL =
|
|
@@ -106,23 +126,27 @@ interface ViewInput {
|
|
|
106
126
|
}
|
|
107
127
|
type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
108
128
|
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
129
|
+
const individualThrottlingEnabled = Boolean(Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled);
|
|
109
130
|
render(
|
|
110
131
|
// clang-format off
|
|
111
132
|
html`
|
|
112
|
-
<style>${
|
|
133
|
+
<style>${RequestConditionsDrawer}</style>
|
|
113
134
|
<devtools-toolbar jslog=${VisualLogging.toolbar()}>
|
|
114
135
|
<devtools-checkbox
|
|
115
136
|
?checked=${input.enabled}
|
|
116
137
|
@click=${input.toggleEnabled}
|
|
117
138
|
.jslogContext=${'network.enable-request-blocking'}>
|
|
118
|
-
${i18nString(UIStrings.
|
|
139
|
+
${individualThrottlingEnabled ? i18nString(UIStrings.enableBlockingAndThrottling)
|
|
140
|
+
: i18nString(UIStrings.enableNetworkRequestBlocking)}
|
|
119
141
|
</devtools-checkbox>
|
|
120
142
|
<div class="toolbar-divider"></div>
|
|
121
143
|
<devtools-button ${bindToAction('network.add-network-request-blocking-pattern')}></devtools-button>
|
|
122
144
|
<devtools-button ${bindToAction('network.remove-all-network-request-blocking-patterns')}></devtools-button>
|
|
123
145
|
</devtools-toolbar>
|
|
124
146
|
<div class=empty-state ${ref(e => input.list.setEmptyPlaceholder(e ?? null))}>
|
|
125
|
-
<span class=empty-state-header>${
|
|
147
|
+
<span class=empty-state-header>${individualThrottlingEnabled
|
|
148
|
+
? i18nString(UIStrings.noPattern)
|
|
149
|
+
: i18nString(UIStrings.noNetworkRequestsBlocked)}</span>
|
|
126
150
|
<div class=empty-state-description>
|
|
127
151
|
<span>${i18nString(UIStrings.addPatternToBlock, {PH1: i18nString(UIStrings.addPattern)})}</span>
|
|
128
152
|
<x-link
|
|
@@ -137,7 +161,8 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
137
161
|
@click=${input.addPattern}
|
|
138
162
|
class=add-button
|
|
139
163
|
.jslogContext=${'network.add-network-request-blocking-pattern'}
|
|
140
|
-
aria-label=${i18nString(UIStrings.
|
|
164
|
+
aria-label=${individualThrottlingEnabled ? i18nString(UIStrings.addPatternLabel)
|
|
165
|
+
: i18nString(UIStrings.addNetworkRequestBlockingPattern)}
|
|
141
166
|
.variant=${Buttons.Button.Variant.TONAL}>
|
|
142
167
|
${i18nString(UIStrings.addPattern)}
|
|
143
168
|
</devtools-button>
|
|
@@ -158,7 +183,7 @@ function learnMore(): LitTemplate {
|
|
|
158
183
|
</x-link>`;
|
|
159
184
|
}
|
|
160
185
|
|
|
161
|
-
export class
|
|
186
|
+
export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
162
187
|
UI.ListWidget.Delegate<SDK.NetworkManager.RequestCondition> {
|
|
163
188
|
private manager: SDK.NetworkManager.MultitargetNetworkManager;
|
|
164
189
|
private readonly list: UI.ListWidget.ListWidget<SDK.NetworkManager.RequestCondition>;
|
|
@@ -178,7 +203,7 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
178
203
|
SDK.NetworkManager.MultitargetNetworkManager.Events.BLOCKED_PATTERNS_CHANGED, this.update, this);
|
|
179
204
|
|
|
180
205
|
this.list = new UI.ListWidget.ListWidget(this);
|
|
181
|
-
this.list.registerRequiredCSS(
|
|
206
|
+
this.list.registerRequiredCSS(requestConditionsDrawerStyles);
|
|
182
207
|
this.list.element.classList.add('blocked-urls');
|
|
183
208
|
|
|
184
209
|
this.editor = null;
|
|
@@ -236,6 +261,18 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
236
261
|
const {enabled, originalOrUpgradedURLPattern, constructorStringOrWildcardURL, wildcardURL} = condition;
|
|
237
262
|
|
|
238
263
|
if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
|
|
264
|
+
const moveUp = (e: Event): void => {
|
|
265
|
+
if (this.manager.requestConditions.conditionsEnabled) {
|
|
266
|
+
e.consume(true);
|
|
267
|
+
this.manager.requestConditions.increasePriority(condition);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const moveDown = (e: Event): void => {
|
|
271
|
+
if (this.manager.requestConditions.conditionsEnabled) {
|
|
272
|
+
e.consume(true);
|
|
273
|
+
this.manager.requestConditions.decreasePriority(condition);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
239
276
|
render(
|
|
240
277
|
// clang-format off
|
|
241
278
|
html`
|
|
@@ -245,17 +282,19 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
245
282
|
?checked=${enabled}
|
|
246
283
|
?disabled=${!editable || !originalOrUpgradedURLPattern}
|
|
247
284
|
.jslog=${VisualLogging.toggle().track({ change: true })}>
|
|
248
|
-
<devtools-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
285
|
+
<devtools-button
|
|
286
|
+
.iconName=${'arrow-down'}
|
|
287
|
+
.variant=${Buttons.Button.Variant.ICON}
|
|
288
|
+
.title=${i18nString(UIStrings.increasePriority)}
|
|
289
|
+
.jslogContext=${'increase-priority'}
|
|
290
|
+
@click=${moveDown}></devtools-button>
|
|
291
|
+
<devtools-button
|
|
292
|
+
.iconName=${'arrow-up'}
|
|
293
|
+
.variant=${Buttons.Button.Variant.ICON}
|
|
294
|
+
.title=${i18nString(UIStrings.decreasePriority)}
|
|
295
|
+
.jslogContext=${'decrease-priority'}
|
|
296
|
+
@click=${moveUp}>
|
|
297
|
+
</devtools-button>
|
|
259
298
|
${originalOrUpgradedURLPattern ? html`
|
|
260
299
|
<devtools-tooltip variant=rich jslogcontext=url-pattern id=url-pattern-${index}>
|
|
261
300
|
<div>hash: ${originalOrUpgradedURLPattern.hash}</div>
|
|
@@ -292,6 +331,17 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
292
331
|
aria-details=url-pattern-${index}>
|
|
293
332
|
${constructorStringOrWildcardURL}
|
|
294
333
|
</div>
|
|
334
|
+
<devtools-widget
|
|
335
|
+
class=conditions-selector
|
|
336
|
+
?disabled=${!editable}
|
|
337
|
+
.widgetConfig=${UI.Widget.widgetConfig(
|
|
338
|
+
MobileThrottling.NetworkThrottlingSelector.NetworkThrottlingSelectorWidget, {
|
|
339
|
+
variant:
|
|
340
|
+
MobileThrottling.NetworkThrottlingSelector.NetworkThrottlingSelect.Variant.INDIVIDUAL_REQUEST_CONDITIONS,
|
|
341
|
+
jslogContext: 'request-conditions',
|
|
342
|
+
onConditionsChanged,
|
|
343
|
+
currentConditions: condition.conditions,
|
|
344
|
+
})}></devtools-widget>
|
|
295
345
|
<div class=blocked-url-count>${i18nString(UIStrings.dBlocked, {PH1: count})}</div>`,
|
|
296
346
|
// clang-format on
|
|
297
347
|
element);
|
|
@@ -357,7 +407,7 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
357
407
|
const titles = content.createChild('div', 'blocked-url-edit-row');
|
|
358
408
|
const label = titles.createChild('div');
|
|
359
409
|
if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
|
|
360
|
-
label.textContent = i18nString(UIStrings.
|
|
410
|
+
label.textContent = i18nString(UIStrings.textEditPattern);
|
|
361
411
|
label.append(UI.XLink.XLink.create(
|
|
362
412
|
PATTERN_API_DOCS_URL, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more'));
|
|
363
413
|
} else {
|
|
@@ -446,30 +496,30 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
|
|
|
446
496
|
}
|
|
447
497
|
}
|
|
448
498
|
override wasShown(): void {
|
|
449
|
-
UI.Context.Context.instance().setFlavor(
|
|
499
|
+
UI.Context.Context.instance().setFlavor(RequestConditionsDrawer, this);
|
|
450
500
|
super.wasShown();
|
|
451
501
|
}
|
|
452
502
|
|
|
453
503
|
override willHide(): void {
|
|
454
504
|
super.willHide();
|
|
455
|
-
UI.Context.Context.instance().setFlavor(
|
|
505
|
+
UI.Context.Context.instance().setFlavor(RequestConditionsDrawer, null);
|
|
456
506
|
}
|
|
457
507
|
}
|
|
458
508
|
|
|
459
509
|
export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
460
510
|
handleAction(context: UI.Context.Context, actionId: string): boolean {
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
511
|
+
const drawer = context.flavor(RequestConditionsDrawer);
|
|
512
|
+
if (drawer === null) {
|
|
463
513
|
return false;
|
|
464
514
|
}
|
|
465
515
|
switch (actionId) {
|
|
466
516
|
case 'network.add-network-request-blocking-pattern': {
|
|
467
|
-
|
|
517
|
+
drawer.addPattern();
|
|
468
518
|
return true;
|
|
469
519
|
}
|
|
470
520
|
|
|
471
521
|
case 'network.remove-all-network-request-blocking-patterns': {
|
|
472
|
-
|
|
522
|
+
drawer.removeAllPatterns();
|
|
473
523
|
return true;
|
|
474
524
|
}
|
|
475
525
|
}
|
|
@@ -27,10 +27,18 @@ const UIStrings = {
|
|
|
27
27
|
* @description Command for showing the 'Network request blocking' tool
|
|
28
28
|
*/
|
|
29
29
|
showNetworkRequestBlocking: 'Show Network request blocking',
|
|
30
|
+
/**
|
|
31
|
+
* @description Command for showing the 'Network request blocking' tool
|
|
32
|
+
*/
|
|
33
|
+
showRequestConditions: 'Show Request conditions',
|
|
30
34
|
/**
|
|
31
35
|
* @description Title of the 'Network request blocking' tool in the bottom drawer
|
|
32
36
|
*/
|
|
33
37
|
networkRequestBlocking: 'Network request blocking',
|
|
38
|
+
/**
|
|
39
|
+
* @description Title of the 'Request conditions' tool in the bottom drawer
|
|
40
|
+
*/
|
|
41
|
+
networkRequestConditions: 'Request conditions',
|
|
34
42
|
/**
|
|
35
43
|
* @description Command for showing the 'Network conditions' tool
|
|
36
44
|
*/
|
|
@@ -123,6 +131,14 @@ const UIStrings = {
|
|
|
123
131
|
* @description Title of an action in the Network request blocking panel to clear all URL patterns.
|
|
124
132
|
*/
|
|
125
133
|
removeAllNetworkRequestBlockingPatterns: 'Remove all network request blocking patterns',
|
|
134
|
+
/**
|
|
135
|
+
* @description Title of an action in the Network request blocking panel to add a new URL pattern to the blocklist.
|
|
136
|
+
*/
|
|
137
|
+
addNetworkRequestBlockingOrThrottlingPattern: 'Add network request blocking or throttling pattern',
|
|
138
|
+
/**
|
|
139
|
+
* @description Title of an action in the Network request blocking panel to clear all URL patterns.
|
|
140
|
+
*/
|
|
141
|
+
removeAllNetworkRequestBlockingOrThrottlingPatterns: 'Remove all network request blocking or throttling patterns',
|
|
126
142
|
/**
|
|
127
143
|
* @description Title of an action in the Network panel (and title of a setting in the Network category)
|
|
128
144
|
* that enables options in the UI to copy or export HAR (not translatable) with sensitive data.
|
|
@@ -142,6 +158,7 @@ const UIStrings = {
|
|
|
142
158
|
} as const;
|
|
143
159
|
const str_ = i18n.i18n.registerUIStrings('panels/network/network-meta.ts', UIStrings);
|
|
144
160
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
161
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
145
162
|
let loadedNetworkModule: (typeof Network|undefined);
|
|
146
163
|
|
|
147
164
|
const isNode = Root.Runtime.Runtime.isNode();
|
|
@@ -173,16 +190,20 @@ UI.ViewManager.registerViewExtension({
|
|
|
173
190
|
},
|
|
174
191
|
});
|
|
175
192
|
|
|
193
|
+
const individualThrottlingEnabled = (): boolean =>
|
|
194
|
+
Boolean(Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled);
|
|
176
195
|
UI.ViewManager.registerViewExtension({
|
|
177
196
|
location: UI.ViewManager.ViewLocationValues.DRAWER_VIEW,
|
|
178
197
|
id: 'network.blocked-urls',
|
|
179
|
-
commandPrompt:
|
|
180
|
-
|
|
198
|
+
commandPrompt: () => individualThrottlingEnabled() ? i18nString(UIStrings.showRequestConditions) :
|
|
199
|
+
i18nString(UIStrings.showNetworkRequestBlocking),
|
|
200
|
+
title: () => individualThrottlingEnabled() ? i18nString(UIStrings.networkRequestConditions) :
|
|
201
|
+
i18nString(UIStrings.networkRequestBlocking),
|
|
181
202
|
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
|
|
182
203
|
order: 60,
|
|
183
204
|
async loadView() {
|
|
184
205
|
const Network = await loadNetworkModule();
|
|
185
|
-
return new Network.
|
|
206
|
+
return new Network.RequestConditionsDrawer.RequestConditionsDrawer();
|
|
186
207
|
},
|
|
187
208
|
});
|
|
188
209
|
|
|
@@ -329,28 +350,31 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
329
350
|
UI.ActionRegistration.registerActionExtension({
|
|
330
351
|
actionId: 'network.add-network-request-blocking-pattern',
|
|
331
352
|
category: UI.ActionRegistration.ActionCategory.NETWORK,
|
|
332
|
-
title:
|
|
353
|
+
title: () => individualThrottlingEnabled() ? i18nString(UIStrings.addNetworkRequestBlockingOrThrottlingPattern) :
|
|
354
|
+
i18nString(UIStrings.addNetworkRequestBlockingPattern),
|
|
333
355
|
iconClass: UI.ActionRegistration.IconClass.PLUS,
|
|
334
356
|
contextTypes() {
|
|
335
|
-
return maybeRetrieveContextTypes(Network => [Network.
|
|
357
|
+
return maybeRetrieveContextTypes(Network => [Network.RequestConditionsDrawer.RequestConditionsDrawer]);
|
|
336
358
|
},
|
|
337
359
|
async loadActionDelegate() {
|
|
338
360
|
const Network = await loadNetworkModule();
|
|
339
|
-
return new Network.
|
|
361
|
+
return new Network.RequestConditionsDrawer.ActionDelegate();
|
|
340
362
|
},
|
|
341
363
|
});
|
|
342
364
|
|
|
343
365
|
UI.ActionRegistration.registerActionExtension({
|
|
344
366
|
actionId: 'network.remove-all-network-request-blocking-patterns',
|
|
345
367
|
category: UI.ActionRegistration.ActionCategory.NETWORK,
|
|
346
|
-
title:
|
|
368
|
+
title: () => individualThrottlingEnabled() ?
|
|
369
|
+
i18nString(UIStrings.removeAllNetworkRequestBlockingOrThrottlingPatterns) :
|
|
370
|
+
i18nString(UIStrings.removeAllNetworkRequestBlockingPatterns),
|
|
347
371
|
iconClass: UI.ActionRegistration.IconClass.CLEAR,
|
|
348
372
|
contextTypes() {
|
|
349
|
-
return maybeRetrieveContextTypes(Network => [Network.
|
|
373
|
+
return maybeRetrieveContextTypes(Network => [Network.RequestConditionsDrawer.RequestConditionsDrawer]);
|
|
350
374
|
},
|
|
351
375
|
async loadActionDelegate() {
|
|
352
376
|
const Network = await loadNetworkModule();
|
|
353
|
-
return new Network.
|
|
377
|
+
return new Network.RequestConditionsDrawer.ActionDelegate();
|
|
354
378
|
},
|
|
355
379
|
});
|
|
356
380
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import './BinaryResourceView.js';
|
|
6
|
-
import './
|
|
6
|
+
import './RequestConditionsDrawer.js';
|
|
7
7
|
import './EventSourceMessagesView.js';
|
|
8
8
|
import './NetworkConfigView.js';
|
|
9
9
|
import './NetworkDataGridNode.js';
|
|
@@ -28,7 +28,6 @@ import './NetworkOverview.js';
|
|
|
28
28
|
import './NetworkPanel.js';
|
|
29
29
|
|
|
30
30
|
import * as BinaryResourceView from './BinaryResourceView.js';
|
|
31
|
-
import * as BlockedURLsPane from './BlockedURLsPane.js';
|
|
32
31
|
import * as EventSourceMessagesView from './EventSourceMessagesView.js';
|
|
33
32
|
import * as NetworkConfigView from './NetworkConfigView.js';
|
|
34
33
|
import * as NetworkDataGridNode from './NetworkDataGridNode.js';
|
|
@@ -41,6 +40,7 @@ import * as NetworkOverview from './NetworkOverview.js';
|
|
|
41
40
|
import * as NetworkPanel from './NetworkPanel.js';
|
|
42
41
|
import * as NetworkSearchScope from './NetworkSearchScope.js';
|
|
43
42
|
import * as NetworkWaterfallColumn from './NetworkWaterfallColumn.js';
|
|
43
|
+
import * as RequestConditionsDrawer from './RequestConditionsDrawer.js';
|
|
44
44
|
import * as RequestCookiesView from './RequestCookiesView.js';
|
|
45
45
|
import * as RequestHTMLView from './RequestHTMLView.js';
|
|
46
46
|
import * as RequestInitiatorView from './RequestInitiatorView.js';
|
|
@@ -54,7 +54,6 @@ import * as SignedExchangeInfoView from './SignedExchangeInfoView.js';
|
|
|
54
54
|
|
|
55
55
|
export {
|
|
56
56
|
BinaryResourceView,
|
|
57
|
-
BlockedURLsPane,
|
|
58
57
|
EventSourceMessagesView,
|
|
59
58
|
NetworkConfigView,
|
|
60
59
|
NetworkDataGridNode,
|
|
@@ -67,6 +66,7 @@ export {
|
|
|
67
66
|
NetworkPanel,
|
|
68
67
|
NetworkSearchScope,
|
|
69
68
|
NetworkWaterfallColumn,
|
|
69
|
+
RequestConditionsDrawer,
|
|
70
70
|
RequestCookiesView,
|
|
71
71
|
RequestHTMLView,
|
|
72
72
|
RequestInitiatorView,
|