chrome-devtools-frontend 1.0.927127 → 1.0.928589
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 +1 -0
- package/config/gni/all_devtools_files.gni +0 -1
- package/config/gni/devtools_grd_files.gni +30 -4
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_preview_feature.svg +3 -0
- package/front_end/Tests.js +2 -3
- package/front_end/core/common/Settings.ts +26 -45
- package/front_end/core/host/UserMetrics.ts +2 -2
- package/front_end/core/i18n/locales/en-US.json +60 -15
- package/front_end/core/i18n/locales/en-XL.json +60 -15
- package/front_end/core/platform/keyboard-utilities.ts +1 -0
- package/front_end/core/root/Runtime.ts +62 -61
- package/front_end/core/sdk/AccessibilityModel.ts +73 -73
- package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
- package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
- package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
- package/front_end/core/sdk/CSSFontFace.ts +10 -10
- package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSMetadata.ts +53 -49
- package/front_end/core/sdk/CSSModel.ts +139 -135
- package/front_end/core/sdk/CSSProperty.ts +18 -18
- package/front_end/core/sdk/CSSRule.ts +15 -15
- package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
- package/front_end/core/sdk/ChildTargetManager.ts +41 -40
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
- package/front_end/core/sdk/Connections.ts +81 -81
- package/front_end/core/sdk/ConsoleModel.ts +68 -68
- package/front_end/core/sdk/Cookie.ts +48 -48
- package/front_end/core/sdk/CookieModel.ts +13 -13
- package/front_end/core/sdk/CookieParser.ts +45 -45
- package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
- package/front_end/core/sdk/DOMModel.ts +264 -252
- package/front_end/core/sdk/DebuggerModel.ts +209 -205
- package/front_end/core/sdk/EmulationModel.ts +76 -76
- package/front_end/core/sdk/FilmStripModel.ts +29 -29
- package/front_end/core/sdk/FrameManager.ts +43 -42
- package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
- package/front_end/core/sdk/IsolateManager.ts +82 -82
- package/front_end/core/sdk/IssuesModel.ts +6 -6
- package/front_end/core/sdk/LayerTreeBase.ts +37 -37
- package/front_end/core/sdk/LogModel.ts +5 -5
- package/front_end/core/sdk/NetworkManager.ts +229 -225
- package/front_end/core/sdk/NetworkRequest.ts +368 -360
- package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
- package/front_end/core/sdk/OverlayModel.ts +155 -153
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
- package/front_end/core/sdk/PageResourceLoader.ts +30 -30
- package/front_end/core/sdk/PaintProfiler.ts +16 -16
- package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
- package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
- package/front_end/core/sdk/RemoteObject.ts +108 -104
- package/front_end/core/sdk/Resource.ts +85 -84
- package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
- package/front_end/core/sdk/RuntimeModel.ts +38 -34
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
- package/front_end/core/sdk/Script.ts +29 -29
- package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
- package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
- package/front_end/core/sdk/SourceMap.ts +40 -36
- package/front_end/core/sdk/SourceMapManager.ts +57 -57
- package/front_end/core/sdk/Target.ts +64 -63
- package/front_end/core/sdk/TargetManager.ts +60 -56
- package/front_end/core/sdk/TracingManager.ts +39 -39
- package/front_end/core/sdk/TracingModel.ts +125 -125
- package/front_end/core/sdk/WebAuthnModel.ts +9 -9
- package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
- package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
- package/front_end/entrypoints/main/MainImpl.ts +7 -2
- package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
- package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
- package/front_end/models/issues_manager/GenericIssue.ts +86 -0
- package/front_end/models/issues_manager/Issue.ts +24 -0
- package/front_end/models/issues_manager/IssuesManager.ts +18 -6
- package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
- package/front_end/panels/console/ConsoleSidebar.ts +0 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
- package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
- package/front_end/panels/elements/components/LayoutPane.ts +5 -1
- package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
- package/front_end/panels/issues/IssueAggregator.ts +16 -0
- package/front_end/panels/issues/IssueKindView.ts +95 -0
- package/front_end/panels/issues/IssueView.ts +6 -0
- package/front_end/panels/issues/IssuesPane.ts +81 -18
- package/front_end/panels/issues/issuesTree.css +8 -3
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -0
- package/front_end/panels/settings/settingsScreen.css +24 -0
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/sources-meta.ts +22 -7
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -4
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
- package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
- package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
- package/front_end/ui/components/docs/text_editor/basic.html +28 -0
- package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
- package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
- package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
- package/front_end/ui/components/text_editor/config.ts +264 -0
- package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
- package/front_end/ui/components/text_editor/theme.ts +113 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
- package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
- package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
- package/front_end/ui/legacy/ARIAUtils.ts +14 -11
- package/front_end/ui/legacy/TabbedPane.ts +32 -3
- package/front_end/ui/legacy/UIUtils.ts +3 -1
- package/front_end/ui/legacy/View.ts +6 -0
- package/front_end/ui/legacy/ViewManager.ts +5 -1
- package/front_end/ui/legacy/ViewRegistration.ts +5 -0
- package/front_end/ui/legacy/XLink.ts +1 -1
- package/front_end/ui/legacy/closeButton.css +6 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
- package/front_end/ui/legacy/filter.css +1 -0
- package/front_end/ui/legacy/tabbedPane.css +24 -0
- package/front_end/ui/legacy/toolbar.css +5 -0
- package/inspector_overlay/main.ts +2 -1
- package/inspector_overlay/tool_screenshot.ts +8 -1
- package/package.json +1 -1
- package/scripts/build/rollup.config.js +9 -0
- package/scripts/migration/class-fields/migrate.js +56 -0
- package/scripts/migration/class-fields/package.json +5 -0
- package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
- package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
1
5
|
/*
|
|
2
6
|
* Copyright (C) 2012 Google Inc. All rights reserved.
|
|
3
7
|
*
|
|
@@ -11,7 +15,7 @@
|
|
|
11
15
|
* copyright notice, this list of conditions and the following disclaimer
|
|
12
16
|
* in the documentation and/or other materials provided with the
|
|
13
17
|
* distribution.
|
|
14
|
-
* * Neither the name of Google Inc. nor the names of its
|
|
18
|
+
* * Neither the #name of Google Inc. nor the names of its
|
|
15
19
|
* contributors may be used to endorse or promote products derived from
|
|
16
20
|
* this software without specific prior written permission.
|
|
17
21
|
*
|
|
@@ -166,7 +170,7 @@ const UIStrings = {
|
|
|
166
170
|
*/
|
|
167
171
|
blockedReasonInvalidPrefix: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05`.',
|
|
168
172
|
/**
|
|
169
|
-
*@description Tooltip to explain why a cookie was blocked when the size of the name plus the size of the value exceeds the max size.
|
|
173
|
+
*@description Tooltip to explain why a cookie was blocked when the size of the #name plus the size of the value exceeds the max size.
|
|
170
174
|
*/
|
|
171
175
|
thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters.',
|
|
172
176
|
/**
|
|
@@ -198,94 +202,94 @@ export enum MIME_TYPE {
|
|
|
198
202
|
|
|
199
203
|
export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
|
|
200
204
|
TextUtils.ContentProvider.ContentProvider {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
205
|
+
#requestIdInternal: string;
|
|
206
|
+
#backendRequestIdInternal?: Protocol.Network.RequestId;
|
|
207
|
+
readonly #documentURLInternal: string;
|
|
208
|
+
readonly #frameIdInternal: Protocol.Page.FrameId|null;
|
|
209
|
+
readonly #loaderIdInternal: Protocol.Network.LoaderId|null;
|
|
210
|
+
readonly #initiatorInternal: Protocol.Network.Initiator|null|undefined;
|
|
211
|
+
#redirectSourceInternal: NetworkRequest|null;
|
|
212
|
+
#preflightRequestInternal: NetworkRequest|null;
|
|
213
|
+
#preflightInitiatorRequestInternal: NetworkRequest|null;
|
|
214
|
+
#isRedirectInternal: boolean;
|
|
215
|
+
#redirectDestinationInternal: NetworkRequest|null;
|
|
216
|
+
#issueTimeInternal: number;
|
|
217
|
+
#startTimeInternal: number;
|
|
218
|
+
#endTimeInternal: number;
|
|
219
|
+
#blockedReasonInternal: Protocol.Network.BlockedReason|undefined;
|
|
220
|
+
#corsErrorStatusInternal: Protocol.Network.CorsErrorStatus|undefined;
|
|
217
221
|
statusCode: number;
|
|
218
222
|
statusText: string;
|
|
219
223
|
requestMethod: string;
|
|
220
224
|
requestTime: number;
|
|
221
225
|
protocol: string;
|
|
222
226
|
mixedContentType: Protocol.Security.MixedContentType;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
#initialPriorityInternal: Protocol.Network.ResourcePriority|null;
|
|
228
|
+
#currentPriority: Protocol.Network.ResourcePriority|null;
|
|
229
|
+
#signedExchangeInfoInternal: Protocol.Network.SignedExchangeInfo|null;
|
|
230
|
+
#webBundleInfoInternal: WebBundleInfo|null;
|
|
231
|
+
#webBundleInnerRequestInfoInternal: WebBundleInnerRequestInfo|null;
|
|
232
|
+
#resourceTypeInternal: Common.ResourceType.ResourceType;
|
|
233
|
+
#contentDataInternal: Promise<ContentData>|null;
|
|
234
|
+
readonly #framesInternal: WebSocketFrame[];
|
|
235
|
+
readonly #eventSourceMessagesInternal: EventSourceMessage[];
|
|
236
|
+
#responseHeaderValues: {
|
|
233
237
|
[x: string]: string|undefined,
|
|
234
238
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
239
|
+
#responseHeadersTextInternal: string;
|
|
240
|
+
#requestHeadersInternal: NameValue[];
|
|
241
|
+
#requestHeaderValues: {
|
|
238
242
|
[x: string]: string|undefined,
|
|
239
243
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
#remoteAddressInternal: string;
|
|
245
|
+
#remoteAddressSpaceInternal: Protocol.Network.IPAddressSpace;
|
|
246
|
+
#referrerPolicyInternal: Protocol.Network.RequestReferrerPolicy|null;
|
|
247
|
+
#securityStateInternal: Protocol.Security.SecurityState;
|
|
248
|
+
#securityDetailsInternal: Protocol.Network.SecurityDetails|null;
|
|
245
249
|
connectionId: string;
|
|
246
250
|
connectionReused: boolean;
|
|
247
251
|
hasNetworkData: boolean;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
#formParametersPromise: Promise<NameValue[]|null>|null;
|
|
253
|
+
#requestFormDataPromise: Promise<string|null>|null;
|
|
254
|
+
#hasExtraRequestInfoInternal: boolean;
|
|
255
|
+
#hasExtraResponseInfoInternal: boolean;
|
|
256
|
+
#blockedRequestCookiesInternal: BlockedCookieWithReason[];
|
|
257
|
+
#includedRequestCookiesInternal: Cookie[];
|
|
258
|
+
#blockedResponseCookiesInternal: BlockedSetCookieWithReason[];
|
|
255
259
|
localizedFailDescription: string|null;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
260
|
+
#urlInternal!: string;
|
|
261
|
+
#responseReceivedTimeInternal!: number;
|
|
262
|
+
#transferSizeInternal!: number;
|
|
263
|
+
#finishedInternal!: boolean;
|
|
264
|
+
#failedInternal!: boolean;
|
|
265
|
+
#canceledInternal!: boolean;
|
|
266
|
+
#preservedInternal!: boolean;
|
|
267
|
+
#mimeTypeInternal!: MIME_TYPE;
|
|
268
|
+
#parsedURLInternal!: Common.ParsedURL.ParsedURL;
|
|
269
|
+
#nameInternal!: string|undefined;
|
|
270
|
+
#pathInternal!: string|undefined;
|
|
271
|
+
#clientSecurityStateInternal!: Protocol.Network.ClientSecurityState|undefined;
|
|
272
|
+
#trustTokenParamsInternal!: Protocol.Network.TrustTokenParams|undefined;
|
|
273
|
+
#trustTokenOperationDoneEventInternal!: Protocol.Network.TrustTokenOperationDoneEvent|undefined;
|
|
274
|
+
#responseCacheStorageCacheName?: string;
|
|
275
|
+
#serviceWorkerResponseSourceInternal?: Protocol.Network.ServiceWorkerResponseSource;
|
|
276
|
+
#wallIssueTime?: number;
|
|
277
|
+
#responseRetrievalTime?: Date;
|
|
278
|
+
#resourceSizeInternal?: number;
|
|
279
|
+
#fromMemoryCache?: boolean;
|
|
280
|
+
#fromDiskCache?: boolean;
|
|
281
|
+
#fromPrefetchCacheInternal?: boolean;
|
|
282
|
+
#fetchedViaServiceWorkerInternal?: boolean;
|
|
283
|
+
#timingInternal?: Protocol.Network.ResourceTiming;
|
|
284
|
+
#requestHeadersTextInternal?: string;
|
|
285
|
+
#responseHeadersInternal?: NameValue[];
|
|
286
|
+
#sortedResponseHeadersInternal?: NameValue[];
|
|
287
|
+
#responseCookiesInternal?: Cookie[];
|
|
288
|
+
#serverTimingsInternal?: ServerTiming[]|null;
|
|
289
|
+
#queryStringInternal?: string|null;
|
|
290
|
+
#parsedQueryParameters?: NameValue[];
|
|
291
|
+
#contentDataProvider?: (() => Promise<ContentData>);
|
|
292
|
+
#isSameSiteInternal: boolean|null;
|
|
289
293
|
|
|
290
294
|
private constructor(
|
|
291
295
|
requestId: string, backendRequestId: Protocol.Network.RequestId|undefined, url: string, documentURL: string,
|
|
@@ -293,23 +297,23 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
293
297
|
initiator: Protocol.Network.Initiator|null) {
|
|
294
298
|
super();
|
|
295
299
|
|
|
296
|
-
this
|
|
297
|
-
this
|
|
300
|
+
this.#requestIdInternal = requestId;
|
|
301
|
+
this.#backendRequestIdInternal = backendRequestId;
|
|
298
302
|
this.setUrl(url);
|
|
299
|
-
this
|
|
300
|
-
this
|
|
301
|
-
this
|
|
302
|
-
this
|
|
303
|
-
this
|
|
304
|
-
this
|
|
305
|
-
this
|
|
306
|
-
this
|
|
307
|
-
this
|
|
308
|
-
this
|
|
309
|
-
this
|
|
310
|
-
this
|
|
311
|
-
this
|
|
312
|
-
this
|
|
303
|
+
this.#documentURLInternal = documentURL;
|
|
304
|
+
this.#frameIdInternal = frameId;
|
|
305
|
+
this.#loaderIdInternal = loaderId;
|
|
306
|
+
this.#initiatorInternal = initiator;
|
|
307
|
+
this.#redirectSourceInternal = null;
|
|
308
|
+
this.#preflightRequestInternal = null;
|
|
309
|
+
this.#preflightInitiatorRequestInternal = null;
|
|
310
|
+
this.#isRedirectInternal = false;
|
|
311
|
+
this.#redirectDestinationInternal = null;
|
|
312
|
+
this.#issueTimeInternal = -1;
|
|
313
|
+
this.#startTimeInternal = -1;
|
|
314
|
+
this.#endTimeInternal = -1;
|
|
315
|
+
this.#blockedReasonInternal = undefined;
|
|
316
|
+
this.#corsErrorStatusInternal = undefined;
|
|
313
317
|
|
|
314
318
|
this.statusCode = 0;
|
|
315
319
|
this.statusText = '';
|
|
@@ -318,47 +322,47 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
318
322
|
this.protocol = '';
|
|
319
323
|
this.mixedContentType = Protocol.Security.MixedContentType.None;
|
|
320
324
|
|
|
321
|
-
this
|
|
322
|
-
this
|
|
325
|
+
this.#initialPriorityInternal = null;
|
|
326
|
+
this.#currentPriority = null;
|
|
323
327
|
|
|
324
|
-
this
|
|
325
|
-
this
|
|
326
|
-
this
|
|
328
|
+
this.#signedExchangeInfoInternal = null;
|
|
329
|
+
this.#webBundleInfoInternal = null;
|
|
330
|
+
this.#webBundleInnerRequestInfoInternal = null;
|
|
327
331
|
|
|
328
|
-
this
|
|
329
|
-
this
|
|
330
|
-
this
|
|
331
|
-
this
|
|
332
|
+
this.#resourceTypeInternal = Common.ResourceType.resourceTypes.Other;
|
|
333
|
+
this.#contentDataInternal = null;
|
|
334
|
+
this.#framesInternal = [];
|
|
335
|
+
this.#eventSourceMessagesInternal = [];
|
|
332
336
|
|
|
333
|
-
this
|
|
334
|
-
this
|
|
337
|
+
this.#responseHeaderValues = {};
|
|
338
|
+
this.#responseHeadersTextInternal = '';
|
|
335
339
|
|
|
336
|
-
this
|
|
337
|
-
this
|
|
340
|
+
this.#requestHeadersInternal = [];
|
|
341
|
+
this.#requestHeaderValues = {};
|
|
338
342
|
|
|
339
|
-
this
|
|
340
|
-
this
|
|
343
|
+
this.#remoteAddressInternal = '';
|
|
344
|
+
this.#remoteAddressSpaceInternal = Protocol.Network.IPAddressSpace.Unknown;
|
|
341
345
|
|
|
342
|
-
this
|
|
346
|
+
this.#referrerPolicyInternal = null;
|
|
343
347
|
|
|
344
|
-
this
|
|
345
|
-
this
|
|
348
|
+
this.#securityStateInternal = Protocol.Security.SecurityState.Unknown;
|
|
349
|
+
this.#securityDetailsInternal = null;
|
|
346
350
|
|
|
347
351
|
this.connectionId = '0';
|
|
348
352
|
this.connectionReused = false;
|
|
349
353
|
this.hasNetworkData = false;
|
|
350
|
-
this
|
|
351
|
-
this
|
|
354
|
+
this.#formParametersPromise = null;
|
|
355
|
+
this.#requestFormDataPromise = (Promise.resolve(null) as Promise<string|null>| null);
|
|
352
356
|
|
|
353
|
-
this
|
|
354
|
-
this
|
|
357
|
+
this.#hasExtraRequestInfoInternal = false;
|
|
358
|
+
this.#hasExtraResponseInfoInternal = false;
|
|
355
359
|
|
|
356
|
-
this
|
|
357
|
-
this
|
|
358
|
-
this
|
|
360
|
+
this.#blockedRequestCookiesInternal = [];
|
|
361
|
+
this.#includedRequestCookiesInternal = [];
|
|
362
|
+
this.#blockedResponseCookiesInternal = [];
|
|
359
363
|
|
|
360
364
|
this.localizedFailDescription = null;
|
|
361
|
-
this
|
|
365
|
+
this.#isSameSiteInternal = null;
|
|
362
366
|
}
|
|
363
367
|
|
|
364
368
|
static create(
|
|
@@ -392,135 +396,135 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
392
396
|
}
|
|
393
397
|
|
|
394
398
|
requestId(): string {
|
|
395
|
-
return this
|
|
399
|
+
return this.#requestIdInternal;
|
|
396
400
|
}
|
|
397
401
|
|
|
398
402
|
backendRequestId(): Protocol.Network.RequestId|undefined {
|
|
399
|
-
return this
|
|
403
|
+
return this.#backendRequestIdInternal;
|
|
400
404
|
}
|
|
401
405
|
|
|
402
406
|
url(): string {
|
|
403
|
-
return this
|
|
407
|
+
return this.#urlInternal;
|
|
404
408
|
}
|
|
405
409
|
|
|
406
410
|
isBlobRequest(): boolean {
|
|
407
|
-
return this
|
|
411
|
+
return this.#urlInternal.startsWith('blob:');
|
|
408
412
|
}
|
|
409
413
|
|
|
410
414
|
setUrl(x: string): void {
|
|
411
|
-
if (this
|
|
415
|
+
if (this.#urlInternal === x) {
|
|
412
416
|
return;
|
|
413
417
|
}
|
|
414
418
|
|
|
415
|
-
this
|
|
416
|
-
this
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
this.#urlInternal = x;
|
|
420
|
+
this.#parsedURLInternal = new Common.ParsedURL.ParsedURL(x);
|
|
421
|
+
this.#queryStringInternal = undefined;
|
|
422
|
+
this.#parsedQueryParameters = undefined;
|
|
423
|
+
this.#nameInternal = undefined;
|
|
424
|
+
this.#pathInternal = undefined;
|
|
421
425
|
}
|
|
422
426
|
|
|
423
427
|
get documentURL(): string {
|
|
424
|
-
return this
|
|
428
|
+
return this.#documentURLInternal;
|
|
425
429
|
}
|
|
426
430
|
|
|
427
431
|
get parsedURL(): Common.ParsedURL.ParsedURL {
|
|
428
|
-
return this
|
|
432
|
+
return this.#parsedURLInternal;
|
|
429
433
|
}
|
|
430
434
|
|
|
431
435
|
get frameId(): Protocol.Page.FrameId|null {
|
|
432
|
-
return this
|
|
436
|
+
return this.#frameIdInternal;
|
|
433
437
|
}
|
|
434
438
|
|
|
435
439
|
get loaderId(): Protocol.Network.LoaderId|null {
|
|
436
|
-
return this
|
|
440
|
+
return this.#loaderIdInternal;
|
|
437
441
|
}
|
|
438
442
|
|
|
439
443
|
setRemoteAddress(ip: string, port: number): void {
|
|
440
|
-
this
|
|
444
|
+
this.#remoteAddressInternal = ip + ':' + port;
|
|
441
445
|
this.dispatchEventToListeners(Events.RemoteAddressChanged, this);
|
|
442
446
|
}
|
|
443
447
|
|
|
444
448
|
remoteAddress(): string {
|
|
445
|
-
return this
|
|
449
|
+
return this.#remoteAddressInternal;
|
|
446
450
|
}
|
|
447
451
|
|
|
448
452
|
remoteAddressSpace(): Protocol.Network.IPAddressSpace {
|
|
449
|
-
return this
|
|
453
|
+
return this.#remoteAddressSpaceInternal;
|
|
450
454
|
}
|
|
451
455
|
|
|
452
456
|
/**
|
|
453
|
-
* The cache name of the CacheStorage from where the response is served via
|
|
457
|
+
* The cache #name of the CacheStorage from where the response is served via
|
|
454
458
|
* the ServiceWorker.
|
|
455
459
|
*/
|
|
456
460
|
getResponseCacheStorageCacheName(): string|undefined {
|
|
457
|
-
return this
|
|
461
|
+
return this.#responseCacheStorageCacheName;
|
|
458
462
|
}
|
|
459
463
|
|
|
460
464
|
setResponseCacheStorageCacheName(x: string): void {
|
|
461
|
-
this
|
|
465
|
+
this.#responseCacheStorageCacheName = x;
|
|
462
466
|
}
|
|
463
467
|
|
|
464
468
|
serviceWorkerResponseSource(): Protocol.Network.ServiceWorkerResponseSource|undefined {
|
|
465
|
-
return this
|
|
469
|
+
return this.#serviceWorkerResponseSourceInternal;
|
|
466
470
|
}
|
|
467
471
|
|
|
468
472
|
setServiceWorkerResponseSource(serviceWorkerResponseSource: Protocol.Network.ServiceWorkerResponseSource): void {
|
|
469
|
-
this
|
|
473
|
+
this.#serviceWorkerResponseSourceInternal = serviceWorkerResponseSource;
|
|
470
474
|
}
|
|
471
475
|
|
|
472
476
|
setReferrerPolicy(referrerPolicy: Protocol.Network.RequestReferrerPolicy): void {
|
|
473
|
-
this
|
|
477
|
+
this.#referrerPolicyInternal = referrerPolicy;
|
|
474
478
|
}
|
|
475
479
|
|
|
476
480
|
referrerPolicy(): Protocol.Network.RequestReferrerPolicy|null {
|
|
477
|
-
return this
|
|
481
|
+
return this.#referrerPolicyInternal;
|
|
478
482
|
}
|
|
479
483
|
|
|
480
484
|
securityState(): Protocol.Security.SecurityState {
|
|
481
|
-
return this
|
|
485
|
+
return this.#securityStateInternal;
|
|
482
486
|
}
|
|
483
487
|
|
|
484
488
|
setSecurityState(securityState: Protocol.Security.SecurityState): void {
|
|
485
|
-
this
|
|
489
|
+
this.#securityStateInternal = securityState;
|
|
486
490
|
}
|
|
487
491
|
|
|
488
492
|
securityDetails(): Protocol.Network.SecurityDetails|null {
|
|
489
|
-
return this
|
|
493
|
+
return this.#securityDetailsInternal;
|
|
490
494
|
}
|
|
491
495
|
|
|
492
496
|
securityOrigin(): string {
|
|
493
|
-
return this
|
|
497
|
+
return this.#parsedURLInternal.securityOrigin();
|
|
494
498
|
}
|
|
495
499
|
|
|
496
500
|
setSecurityDetails(securityDetails: Protocol.Network.SecurityDetails): void {
|
|
497
|
-
this
|
|
501
|
+
this.#securityDetailsInternal = securityDetails;
|
|
498
502
|
}
|
|
499
503
|
|
|
500
504
|
get startTime(): number {
|
|
501
|
-
return this
|
|
505
|
+
return this.#startTimeInternal || -1;
|
|
502
506
|
}
|
|
503
507
|
|
|
504
508
|
setIssueTime(monotonicTime: number, wallTime: number): void {
|
|
505
|
-
this
|
|
506
|
-
this
|
|
507
|
-
this
|
|
509
|
+
this.#issueTimeInternal = monotonicTime;
|
|
510
|
+
this.#wallIssueTime = wallTime;
|
|
511
|
+
this.#startTimeInternal = monotonicTime;
|
|
508
512
|
}
|
|
509
513
|
|
|
510
514
|
issueTime(): number {
|
|
511
|
-
return this
|
|
515
|
+
return this.#issueTimeInternal;
|
|
512
516
|
}
|
|
513
517
|
|
|
514
518
|
pseudoWallTime(monotonicTime: number): number {
|
|
515
|
-
return this
|
|
519
|
+
return this.#wallIssueTime ? this.#wallIssueTime - this.#issueTimeInternal + monotonicTime : monotonicTime;
|
|
516
520
|
}
|
|
517
521
|
|
|
518
522
|
get responseReceivedTime(): number {
|
|
519
|
-
return this
|
|
523
|
+
return this.#responseReceivedTimeInternal || -1;
|
|
520
524
|
}
|
|
521
525
|
|
|
522
526
|
set responseReceivedTime(x: number) {
|
|
523
|
-
this
|
|
527
|
+
this.#responseReceivedTimeInternal = x;
|
|
524
528
|
}
|
|
525
529
|
|
|
526
530
|
/**
|
|
@@ -528,75 +532,75 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
528
532
|
* responses, this is the last time the cache entry was validated.
|
|
529
533
|
*/
|
|
530
534
|
getResponseRetrievalTime(): Date|undefined {
|
|
531
|
-
return this
|
|
535
|
+
return this.#responseRetrievalTime;
|
|
532
536
|
}
|
|
533
537
|
|
|
534
538
|
setResponseRetrievalTime(x: Date): void {
|
|
535
|
-
this
|
|
539
|
+
this.#responseRetrievalTime = x;
|
|
536
540
|
}
|
|
537
541
|
|
|
538
542
|
get endTime(): number {
|
|
539
|
-
return this
|
|
543
|
+
return this.#endTimeInternal || -1;
|
|
540
544
|
}
|
|
541
545
|
|
|
542
546
|
set endTime(x: number) {
|
|
543
547
|
if (this.timing && this.timing.requestTime) {
|
|
544
548
|
// Check against accurate responseReceivedTime.
|
|
545
|
-
this
|
|
549
|
+
this.#endTimeInternal = Math.max(x, this.responseReceivedTime);
|
|
546
550
|
} else {
|
|
547
551
|
// Prefer endTime since it might be from the network stack.
|
|
548
|
-
this
|
|
549
|
-
if (this
|
|
550
|
-
this
|
|
552
|
+
this.#endTimeInternal = x;
|
|
553
|
+
if (this.#responseReceivedTimeInternal > x) {
|
|
554
|
+
this.#responseReceivedTimeInternal = x;
|
|
551
555
|
}
|
|
552
556
|
}
|
|
553
557
|
this.dispatchEventToListeners(Events.TimingChanged, this);
|
|
554
558
|
}
|
|
555
559
|
|
|
556
560
|
get duration(): number {
|
|
557
|
-
if (this
|
|
561
|
+
if (this.#endTimeInternal === -1 || this.#startTimeInternal === -1) {
|
|
558
562
|
return -1;
|
|
559
563
|
}
|
|
560
|
-
return this
|
|
564
|
+
return this.#endTimeInternal - this.#startTimeInternal;
|
|
561
565
|
}
|
|
562
566
|
|
|
563
567
|
get latency(): number {
|
|
564
|
-
if (this
|
|
568
|
+
if (this.#responseReceivedTimeInternal === -1 || this.#startTimeInternal === -1) {
|
|
565
569
|
return -1;
|
|
566
570
|
}
|
|
567
|
-
return this
|
|
571
|
+
return this.#responseReceivedTimeInternal - this.#startTimeInternal;
|
|
568
572
|
}
|
|
569
573
|
|
|
570
574
|
get resourceSize(): number {
|
|
571
|
-
return this
|
|
575
|
+
return this.#resourceSizeInternal || 0;
|
|
572
576
|
}
|
|
573
577
|
|
|
574
578
|
set resourceSize(x: number) {
|
|
575
|
-
this
|
|
579
|
+
this.#resourceSizeInternal = x;
|
|
576
580
|
}
|
|
577
581
|
|
|
578
582
|
get transferSize(): number {
|
|
579
|
-
return this
|
|
583
|
+
return this.#transferSizeInternal || 0;
|
|
580
584
|
}
|
|
581
585
|
|
|
582
586
|
increaseTransferSize(x: number): void {
|
|
583
|
-
this
|
|
587
|
+
this.#transferSizeInternal = (this.#transferSizeInternal || 0) + x;
|
|
584
588
|
}
|
|
585
589
|
|
|
586
590
|
setTransferSize(x: number): void {
|
|
587
|
-
this
|
|
591
|
+
this.#transferSizeInternal = x;
|
|
588
592
|
}
|
|
589
593
|
|
|
590
594
|
get finished(): boolean {
|
|
591
|
-
return this
|
|
595
|
+
return this.#finishedInternal;
|
|
592
596
|
}
|
|
593
597
|
|
|
594
598
|
set finished(x: boolean) {
|
|
595
|
-
if (this
|
|
599
|
+
if (this.#finishedInternal === x) {
|
|
596
600
|
return;
|
|
597
601
|
}
|
|
598
602
|
|
|
599
|
-
this
|
|
603
|
+
this.#finishedInternal = x;
|
|
600
604
|
|
|
601
605
|
if (x) {
|
|
602
606
|
this.dispatchEventToListeners(Events.FinishedLoading, this);
|
|
@@ -604,72 +608,76 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
604
608
|
}
|
|
605
609
|
|
|
606
610
|
get failed(): boolean {
|
|
607
|
-
return this
|
|
611
|
+
return this.#failedInternal;
|
|
608
612
|
}
|
|
609
613
|
|
|
610
614
|
set failed(x: boolean) {
|
|
611
|
-
this
|
|
615
|
+
this.#failedInternal = x;
|
|
612
616
|
}
|
|
613
617
|
|
|
614
618
|
get canceled(): boolean {
|
|
615
|
-
return this
|
|
619
|
+
return this.#canceledInternal;
|
|
616
620
|
}
|
|
617
621
|
|
|
618
622
|
set canceled(x: boolean) {
|
|
619
|
-
this
|
|
623
|
+
this.#canceledInternal = x;
|
|
620
624
|
}
|
|
621
625
|
|
|
622
626
|
get preserved(): boolean {
|
|
623
|
-
return this
|
|
627
|
+
return this.#preservedInternal;
|
|
624
628
|
}
|
|
625
629
|
|
|
626
630
|
set preserved(x: boolean) {
|
|
627
|
-
this
|
|
631
|
+
this.#preservedInternal = x;
|
|
628
632
|
}
|
|
629
633
|
|
|
630
634
|
blockedReason(): Protocol.Network.BlockedReason|undefined {
|
|
631
|
-
return this
|
|
635
|
+
return this.#blockedReasonInternal;
|
|
632
636
|
}
|
|
633
637
|
|
|
634
638
|
setBlockedReason(reason: Protocol.Network.BlockedReason): void {
|
|
635
|
-
this
|
|
639
|
+
this.#blockedReasonInternal = reason;
|
|
636
640
|
}
|
|
637
641
|
|
|
638
642
|
corsErrorStatus(): Protocol.Network.CorsErrorStatus|undefined {
|
|
639
|
-
return this
|
|
643
|
+
return this.#corsErrorStatusInternal;
|
|
640
644
|
}
|
|
641
645
|
|
|
642
646
|
setCorsErrorStatus(corsErrorStatus: Protocol.Network.CorsErrorStatus): void {
|
|
643
|
-
this
|
|
647
|
+
this.#corsErrorStatusInternal = corsErrorStatus;
|
|
644
648
|
}
|
|
645
649
|
|
|
646
650
|
wasBlocked(): boolean {
|
|
647
|
-
return Boolean(this
|
|
651
|
+
return Boolean(this.#blockedReasonInternal);
|
|
648
652
|
}
|
|
649
653
|
|
|
650
654
|
cached(): boolean {
|
|
651
|
-
return (Boolean(this
|
|
655
|
+
return (Boolean(this.#fromMemoryCache) || Boolean(this.#fromDiskCache)) && !this.#transferSizeInternal;
|
|
652
656
|
}
|
|
653
657
|
|
|
654
658
|
cachedInMemory(): boolean {
|
|
655
|
-
return Boolean(this
|
|
659
|
+
return Boolean(this.#fromMemoryCache) && !this.#transferSizeInternal;
|
|
656
660
|
}
|
|
657
661
|
|
|
658
662
|
fromPrefetchCache(): boolean {
|
|
659
|
-
return Boolean(this
|
|
663
|
+
return Boolean(this.#fromPrefetchCacheInternal);
|
|
660
664
|
}
|
|
661
665
|
|
|
662
666
|
setFromMemoryCache(): void {
|
|
663
|
-
this
|
|
664
|
-
|
|
667
|
+
this.#fromMemoryCache = true;
|
|
668
|
+
this.#timingInternal = undefined;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
get fromDiskCache(): boolean|undefined {
|
|
672
|
+
return this.#fromDiskCache;
|
|
665
673
|
}
|
|
666
674
|
|
|
667
675
|
setFromDiskCache(): void {
|
|
668
|
-
this
|
|
676
|
+
this.#fromDiskCache = true;
|
|
669
677
|
}
|
|
670
678
|
|
|
671
679
|
setFromPrefetchCache(): void {
|
|
672
|
-
this
|
|
680
|
+
this.#fromPrefetchCacheInternal = true;
|
|
673
681
|
}
|
|
674
682
|
|
|
675
683
|
/**
|
|
@@ -677,11 +685,11 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
677
685
|
* provided its own response.
|
|
678
686
|
*/
|
|
679
687
|
get fetchedViaServiceWorker(): boolean {
|
|
680
|
-
return Boolean(this
|
|
688
|
+
return Boolean(this.#fetchedViaServiceWorkerInternal);
|
|
681
689
|
}
|
|
682
690
|
|
|
683
691
|
set fetchedViaServiceWorker(x: boolean) {
|
|
684
|
-
this
|
|
692
|
+
this.#fetchedViaServiceWorkerInternal = x;
|
|
685
693
|
}
|
|
686
694
|
|
|
687
695
|
/**
|
|
@@ -696,95 +704,95 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
696
704
|
}
|
|
697
705
|
|
|
698
706
|
get timing(): Protocol.Network.ResourceTiming|undefined {
|
|
699
|
-
return this
|
|
707
|
+
return this.#timingInternal;
|
|
700
708
|
}
|
|
701
709
|
|
|
702
710
|
set timing(timingInfo: Protocol.Network.ResourceTiming|undefined) {
|
|
703
|
-
if (!timingInfo || this
|
|
711
|
+
if (!timingInfo || this.#fromMemoryCache) {
|
|
704
712
|
return;
|
|
705
713
|
}
|
|
706
714
|
// Take startTime and responseReceivedTime from timing data for better accuracy.
|
|
707
715
|
// Timing's requestTime is a baseline in seconds, rest of the numbers there are ticks in millis.
|
|
708
|
-
this
|
|
716
|
+
this.#startTimeInternal = timingInfo.requestTime;
|
|
709
717
|
const headersReceivedTime = timingInfo.requestTime + timingInfo.receiveHeadersEnd / 1000.0;
|
|
710
|
-
if ((this
|
|
711
|
-
this
|
|
718
|
+
if ((this.#responseReceivedTimeInternal || -1) < 0 || this.#responseReceivedTimeInternal > headersReceivedTime) {
|
|
719
|
+
this.#responseReceivedTimeInternal = headersReceivedTime;
|
|
712
720
|
}
|
|
713
|
-
if (this
|
|
714
|
-
this
|
|
721
|
+
if (this.#startTimeInternal > this.#responseReceivedTimeInternal) {
|
|
722
|
+
this.#responseReceivedTimeInternal = this.#startTimeInternal;
|
|
715
723
|
}
|
|
716
724
|
|
|
717
|
-
this
|
|
725
|
+
this.#timingInternal = timingInfo;
|
|
718
726
|
this.dispatchEventToListeners(Events.TimingChanged, this);
|
|
719
727
|
}
|
|
720
728
|
|
|
721
729
|
private setConnectTimingFromExtraInfo(connectTiming: Protocol.Network.ConnectTiming): void {
|
|
722
|
-
this
|
|
730
|
+
this.#startTimeInternal = connectTiming.requestTime;
|
|
723
731
|
this.dispatchEventToListeners(Events.TimingChanged, this);
|
|
724
732
|
}
|
|
725
733
|
|
|
726
734
|
get mimeType(): MIME_TYPE {
|
|
727
|
-
return this
|
|
735
|
+
return this.#mimeTypeInternal;
|
|
728
736
|
}
|
|
729
737
|
|
|
730
738
|
set mimeType(x: MIME_TYPE) {
|
|
731
|
-
this
|
|
739
|
+
this.#mimeTypeInternal = x;
|
|
732
740
|
}
|
|
733
741
|
|
|
734
742
|
get displayName(): string {
|
|
735
|
-
return this
|
|
743
|
+
return this.#parsedURLInternal.displayName;
|
|
736
744
|
}
|
|
737
745
|
|
|
738
746
|
name(): string {
|
|
739
|
-
if (this
|
|
740
|
-
return this
|
|
747
|
+
if (this.#nameInternal) {
|
|
748
|
+
return this.#nameInternal;
|
|
741
749
|
}
|
|
742
750
|
this.parseNameAndPathFromURL();
|
|
743
|
-
return this
|
|
751
|
+
return this.#nameInternal as string;
|
|
744
752
|
}
|
|
745
753
|
|
|
746
754
|
path(): string {
|
|
747
|
-
if (this
|
|
748
|
-
return this
|
|
755
|
+
if (this.#pathInternal) {
|
|
756
|
+
return this.#pathInternal;
|
|
749
757
|
}
|
|
750
758
|
this.parseNameAndPathFromURL();
|
|
751
|
-
return this
|
|
759
|
+
return this.#pathInternal as string;
|
|
752
760
|
}
|
|
753
761
|
|
|
754
762
|
private parseNameAndPathFromURL(): void {
|
|
755
|
-
if (this
|
|
756
|
-
this
|
|
757
|
-
this
|
|
758
|
-
} else if (this
|
|
759
|
-
this
|
|
760
|
-
this
|
|
761
|
-
} else if (this
|
|
762
|
-
this
|
|
763
|
-
this
|
|
763
|
+
if (this.#parsedURLInternal.isDataURL()) {
|
|
764
|
+
this.#nameInternal = this.#parsedURLInternal.dataURLDisplayName();
|
|
765
|
+
this.#pathInternal = '';
|
|
766
|
+
} else if (this.#parsedURLInternal.isBlobURL()) {
|
|
767
|
+
this.#nameInternal = this.#parsedURLInternal.url;
|
|
768
|
+
this.#pathInternal = '';
|
|
769
|
+
} else if (this.#parsedURLInternal.isAboutBlank()) {
|
|
770
|
+
this.#nameInternal = this.#parsedURLInternal.url;
|
|
771
|
+
this.#pathInternal = '';
|
|
764
772
|
} else {
|
|
765
|
-
this
|
|
773
|
+
this.#pathInternal = this.#parsedURLInternal.host + this.#parsedURLInternal.folderPathComponents;
|
|
766
774
|
|
|
767
775
|
const networkManager = NetworkManager.forRequest(this);
|
|
768
776
|
const inspectedURL =
|
|
769
777
|
networkManager ? Common.ParsedURL.ParsedURL.fromString(networkManager.target().inspectedURL()) : null;
|
|
770
|
-
this
|
|
771
|
-
if (this
|
|
772
|
-
this
|
|
773
|
-
(this
|
|
774
|
-
} else if (this
|
|
775
|
-
this
|
|
776
|
-
|
|
778
|
+
this.#pathInternal = Platform.StringUtilities.trimURL(this.#pathInternal, inspectedURL ? inspectedURL.host : '');
|
|
779
|
+
if (this.#parsedURLInternal.lastPathComponent || this.#parsedURLInternal.queryParams) {
|
|
780
|
+
this.#nameInternal = this.#parsedURLInternal.lastPathComponent +
|
|
781
|
+
(this.#parsedURLInternal.queryParams ? '?' + this.#parsedURLInternal.queryParams : '');
|
|
782
|
+
} else if (this.#parsedURLInternal.folderPathComponents) {
|
|
783
|
+
this.#nameInternal = this.#parsedURLInternal.folderPathComponents.substring(
|
|
784
|
+
this.#parsedURLInternal.folderPathComponents.lastIndexOf('/') + 1) +
|
|
777
785
|
'/';
|
|
778
|
-
this
|
|
786
|
+
this.#pathInternal = this.#pathInternal.substring(0, this.#pathInternal.lastIndexOf('/'));
|
|
779
787
|
} else {
|
|
780
|
-
this
|
|
781
|
-
this
|
|
788
|
+
this.#nameInternal = this.#parsedURLInternal.host;
|
|
789
|
+
this.#pathInternal = '';
|
|
782
790
|
}
|
|
783
791
|
}
|
|
784
792
|
}
|
|
785
793
|
|
|
786
794
|
get folder(): string {
|
|
787
|
-
let path: string = this
|
|
795
|
+
let path: string = this.#parsedURLInternal.path;
|
|
788
796
|
const indexOfQuery = path.indexOf('?');
|
|
789
797
|
if (indexOfQuery !== -1) {
|
|
790
798
|
path = path.substring(0, indexOfQuery);
|
|
@@ -794,100 +802,100 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
794
802
|
}
|
|
795
803
|
|
|
796
804
|
get pathname(): string {
|
|
797
|
-
return this
|
|
805
|
+
return this.#parsedURLInternal.path;
|
|
798
806
|
}
|
|
799
807
|
|
|
800
808
|
resourceType(): Common.ResourceType.ResourceType {
|
|
801
|
-
return this
|
|
809
|
+
return this.#resourceTypeInternal;
|
|
802
810
|
}
|
|
803
811
|
|
|
804
812
|
setResourceType(resourceType: Common.ResourceType.ResourceType): void {
|
|
805
|
-
this
|
|
813
|
+
this.#resourceTypeInternal = resourceType;
|
|
806
814
|
}
|
|
807
815
|
|
|
808
816
|
get domain(): string {
|
|
809
|
-
return this
|
|
817
|
+
return this.#parsedURLInternal.host;
|
|
810
818
|
}
|
|
811
819
|
|
|
812
820
|
get scheme(): string {
|
|
813
|
-
return this
|
|
821
|
+
return this.#parsedURLInternal.scheme;
|
|
814
822
|
}
|
|
815
823
|
|
|
816
824
|
redirectSource(): NetworkRequest|null {
|
|
817
|
-
return this
|
|
825
|
+
return this.#redirectSourceInternal;
|
|
818
826
|
}
|
|
819
827
|
|
|
820
828
|
setRedirectSource(originatingRequest: NetworkRequest|null): void {
|
|
821
|
-
this
|
|
829
|
+
this.#redirectSourceInternal = originatingRequest;
|
|
822
830
|
}
|
|
823
831
|
|
|
824
832
|
preflightRequest(): NetworkRequest|null {
|
|
825
|
-
return this
|
|
833
|
+
return this.#preflightRequestInternal;
|
|
826
834
|
}
|
|
827
835
|
|
|
828
836
|
setPreflightRequest(preflightRequest: NetworkRequest|null): void {
|
|
829
|
-
this
|
|
837
|
+
this.#preflightRequestInternal = preflightRequest;
|
|
830
838
|
}
|
|
831
839
|
|
|
832
840
|
preflightInitiatorRequest(): NetworkRequest|null {
|
|
833
|
-
return this
|
|
841
|
+
return this.#preflightInitiatorRequestInternal;
|
|
834
842
|
}
|
|
835
843
|
|
|
836
844
|
setPreflightInitiatorRequest(preflightInitiatorRequest: NetworkRequest|null): void {
|
|
837
|
-
this
|
|
845
|
+
this.#preflightInitiatorRequestInternal = preflightInitiatorRequest;
|
|
838
846
|
}
|
|
839
847
|
|
|
840
848
|
isPreflightRequest(): boolean {
|
|
841
|
-
return this
|
|
842
|
-
this
|
|
849
|
+
return this.#initiatorInternal !== null && this.#initiatorInternal !== undefined &&
|
|
850
|
+
this.#initiatorInternal.type === Protocol.Network.InitiatorType.Preflight;
|
|
843
851
|
}
|
|
844
852
|
|
|
845
853
|
redirectDestination(): NetworkRequest|null {
|
|
846
|
-
return this
|
|
854
|
+
return this.#redirectDestinationInternal;
|
|
847
855
|
}
|
|
848
856
|
|
|
849
857
|
setRedirectDestination(redirectDestination: NetworkRequest|null): void {
|
|
850
|
-
this
|
|
858
|
+
this.#redirectDestinationInternal = redirectDestination;
|
|
851
859
|
}
|
|
852
860
|
|
|
853
861
|
requestHeaders(): NameValue[] {
|
|
854
|
-
return this
|
|
862
|
+
return this.#requestHeadersInternal;
|
|
855
863
|
}
|
|
856
864
|
|
|
857
865
|
setRequestHeaders(headers: NameValue[]): void {
|
|
858
|
-
this
|
|
866
|
+
this.#requestHeadersInternal = headers;
|
|
859
867
|
|
|
860
868
|
this.dispatchEventToListeners(Events.RequestHeadersChanged);
|
|
861
869
|
}
|
|
862
870
|
|
|
863
871
|
requestHeadersText(): string|undefined {
|
|
864
|
-
return this
|
|
872
|
+
return this.#requestHeadersTextInternal;
|
|
865
873
|
}
|
|
866
874
|
|
|
867
875
|
setRequestHeadersText(text: string): void {
|
|
868
|
-
this
|
|
876
|
+
this.#requestHeadersTextInternal = text;
|
|
869
877
|
|
|
870
878
|
this.dispatchEventToListeners(Events.RequestHeadersChanged);
|
|
871
879
|
}
|
|
872
880
|
|
|
873
881
|
requestHeaderValue(headerName: string): string|undefined {
|
|
874
|
-
if (this
|
|
875
|
-
return this
|
|
882
|
+
if (this.#requestHeaderValues[headerName]) {
|
|
883
|
+
return this.#requestHeaderValues[headerName];
|
|
876
884
|
}
|
|
877
|
-
this
|
|
878
|
-
return this
|
|
885
|
+
this.#requestHeaderValues[headerName] = this.computeHeaderValue(this.requestHeaders(), headerName);
|
|
886
|
+
return this.#requestHeaderValues[headerName];
|
|
879
887
|
}
|
|
880
888
|
|
|
881
889
|
requestFormData(): Promise<string|null> {
|
|
882
|
-
if (!this
|
|
883
|
-
this
|
|
890
|
+
if (!this.#requestFormDataPromise) {
|
|
891
|
+
this.#requestFormDataPromise = NetworkManager.requestPostData(this);
|
|
884
892
|
}
|
|
885
|
-
return this
|
|
893
|
+
return this.#requestFormDataPromise;
|
|
886
894
|
}
|
|
887
895
|
|
|
888
896
|
setRequestFormData(hasData: boolean, data: string|null): void {
|
|
889
|
-
this
|
|
890
|
-
this
|
|
897
|
+
this.#requestFormDataPromise = (hasData && data === null) ? null : Promise.resolve(data);
|
|
898
|
+
this.#formParametersPromise = null;
|
|
891
899
|
}
|
|
892
900
|
|
|
893
901
|
private filteredProtocolName(): string {
|
|
@@ -913,55 +921,55 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
913
921
|
}
|
|
914
922
|
|
|
915
923
|
get responseHeaders(): NameValue[] {
|
|
916
|
-
return this
|
|
924
|
+
return this.#responseHeadersInternal || [];
|
|
917
925
|
}
|
|
918
926
|
|
|
919
927
|
set responseHeaders(x: NameValue[]) {
|
|
920
|
-
this
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
this
|
|
928
|
+
this.#responseHeadersInternal = x;
|
|
929
|
+
this.#sortedResponseHeadersInternal = undefined;
|
|
930
|
+
this.#serverTimingsInternal = undefined;
|
|
931
|
+
this.#responseCookiesInternal = undefined;
|
|
932
|
+
this.#responseHeaderValues = {};
|
|
925
933
|
|
|
926
934
|
this.dispatchEventToListeners(Events.ResponseHeadersChanged);
|
|
927
935
|
}
|
|
928
936
|
|
|
929
937
|
get responseHeadersText(): string {
|
|
930
|
-
return this
|
|
938
|
+
return this.#responseHeadersTextInternal;
|
|
931
939
|
}
|
|
932
940
|
|
|
933
941
|
set responseHeadersText(x: string) {
|
|
934
|
-
this
|
|
942
|
+
this.#responseHeadersTextInternal = x;
|
|
935
943
|
|
|
936
944
|
this.dispatchEventToListeners(Events.ResponseHeadersChanged);
|
|
937
945
|
}
|
|
938
946
|
|
|
939
947
|
get sortedResponseHeaders(): NameValue[] {
|
|
940
|
-
if (this
|
|
941
|
-
return this
|
|
948
|
+
if (this.#sortedResponseHeadersInternal !== undefined) {
|
|
949
|
+
return this.#sortedResponseHeadersInternal;
|
|
942
950
|
}
|
|
943
951
|
|
|
944
|
-
this
|
|
945
|
-
this
|
|
952
|
+
this.#sortedResponseHeadersInternal = this.responseHeaders.slice();
|
|
953
|
+
this.#sortedResponseHeadersInternal.sort(function(a, b) {
|
|
946
954
|
return Platform.StringUtilities.compare(a.name.toLowerCase(), b.name.toLowerCase());
|
|
947
955
|
});
|
|
948
|
-
return this
|
|
956
|
+
return this.#sortedResponseHeadersInternal;
|
|
949
957
|
}
|
|
950
958
|
|
|
951
959
|
responseHeaderValue(headerName: string): string|undefined {
|
|
952
|
-
if (headerName in this
|
|
953
|
-
return this
|
|
960
|
+
if (headerName in this.#responseHeaderValues) {
|
|
961
|
+
return this.#responseHeaderValues[headerName];
|
|
954
962
|
}
|
|
955
|
-
this
|
|
956
|
-
return this
|
|
963
|
+
this.#responseHeaderValues[headerName] = this.computeHeaderValue(this.responseHeaders, headerName);
|
|
964
|
+
return this.#responseHeaderValues[headerName];
|
|
957
965
|
}
|
|
958
966
|
|
|
959
967
|
get responseCookies(): Cookie[] {
|
|
960
|
-
if (!this
|
|
961
|
-
this
|
|
968
|
+
if (!this.#responseCookiesInternal) {
|
|
969
|
+
this.#responseCookiesInternal =
|
|
962
970
|
CookieParser.parseSetCookie(this.responseHeaderValue('Set-Cookie'), this.domain) || [];
|
|
963
971
|
}
|
|
964
|
-
return this
|
|
972
|
+
return this.#responseCookiesInternal;
|
|
965
973
|
}
|
|
966
974
|
|
|
967
975
|
responseLastModified(): string|undefined {
|
|
@@ -978,15 +986,15 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
978
986
|
}
|
|
979
987
|
|
|
980
988
|
get serverTimings(): ServerTiming[]|null {
|
|
981
|
-
if (typeof this
|
|
982
|
-
this
|
|
989
|
+
if (typeof this.#serverTimingsInternal === 'undefined') {
|
|
990
|
+
this.#serverTimingsInternal = ServerTiming.parseHeaders(this.responseHeaders);
|
|
983
991
|
}
|
|
984
|
-
return this
|
|
992
|
+
return this.#serverTimingsInternal;
|
|
985
993
|
}
|
|
986
994
|
|
|
987
995
|
queryString(): string|null {
|
|
988
|
-
if (this
|
|
989
|
-
return this
|
|
996
|
+
if (this.#queryStringInternal !== undefined) {
|
|
997
|
+
return this.#queryStringInternal;
|
|
990
998
|
}
|
|
991
999
|
|
|
992
1000
|
let queryString: string|null = null;
|
|
@@ -999,20 +1007,20 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
999
1007
|
queryString = queryString.substring(0, hashSignPosition);
|
|
1000
1008
|
}
|
|
1001
1009
|
}
|
|
1002
|
-
this
|
|
1003
|
-
return this
|
|
1010
|
+
this.#queryStringInternal = queryString;
|
|
1011
|
+
return this.#queryStringInternal;
|
|
1004
1012
|
}
|
|
1005
1013
|
|
|
1006
1014
|
get queryParameters(): NameValue[]|null {
|
|
1007
|
-
if (this
|
|
1008
|
-
return this
|
|
1015
|
+
if (this.#parsedQueryParameters) {
|
|
1016
|
+
return this.#parsedQueryParameters;
|
|
1009
1017
|
}
|
|
1010
1018
|
const queryString = this.queryString();
|
|
1011
1019
|
if (!queryString) {
|
|
1012
1020
|
return null;
|
|
1013
1021
|
}
|
|
1014
|
-
this
|
|
1015
|
-
return this
|
|
1022
|
+
this.#parsedQueryParameters = this.parseParameters(queryString);
|
|
1023
|
+
return this.#parsedQueryParameters;
|
|
1016
1024
|
}
|
|
1017
1025
|
|
|
1018
1026
|
private async parseFormParameters(): Promise<NameValue[]|null> {
|
|
@@ -1022,7 +1030,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1022
1030
|
return null;
|
|
1023
1031
|
}
|
|
1024
1032
|
|
|
1025
|
-
// Handling application
|
|
1033
|
+
// Handling application/#x-www-form-urlencoded request bodies.
|
|
1026
1034
|
if (requestContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)) {
|
|
1027
1035
|
const formData = await this.requestFormData();
|
|
1028
1036
|
if (!formData) {
|
|
@@ -1053,14 +1061,14 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1053
1061
|
}
|
|
1054
1062
|
|
|
1055
1063
|
formParameters(): Promise<NameValue[]|null> {
|
|
1056
|
-
if (!this
|
|
1057
|
-
this
|
|
1064
|
+
if (!this.#formParametersPromise) {
|
|
1065
|
+
this.#formParametersPromise = this.parseFormParameters();
|
|
1058
1066
|
}
|
|
1059
|
-
return this
|
|
1067
|
+
return this.#formParametersPromise;
|
|
1060
1068
|
}
|
|
1061
1069
|
|
|
1062
1070
|
responseHttpVersion(): string {
|
|
1063
|
-
const headersText = this
|
|
1071
|
+
const headersText = this.#responseHeadersTextInternal;
|
|
1064
1072
|
if (!headersText) {
|
|
1065
1073
|
const version = this.responseHeaderValue('version') || this.responseHeaderValue(':version');
|
|
1066
1074
|
if (version) {
|
|
@@ -1090,12 +1098,12 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1090
1098
|
/**
|
|
1091
1099
|
* Parses multipart/form-data; boundary=boundaryString request bodies -
|
|
1092
1100
|
* --boundaryString
|
|
1093
|
-
* Content-Disposition: form-data; name="field
|
|
1101
|
+
* Content-Disposition: form-data; #name="field-#name"; filename="r.gif"
|
|
1094
1102
|
* Content-Type: application/octet-stream
|
|
1095
1103
|
*
|
|
1096
1104
|
* optionalValue
|
|
1097
1105
|
* --boundaryString
|
|
1098
|
-
* Content-Disposition: form-data; name="field
|
|
1106
|
+
* Content-Disposition: form-data; #name="field-#name-2"
|
|
1099
1107
|
*
|
|
1100
1108
|
* optionalValue2
|
|
1101
1109
|
* --boundaryString--
|
|
@@ -1103,7 +1111,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1103
1111
|
private parseMultipartFormDataParameters(data: string, boundary: string): NameValue[] {
|
|
1104
1112
|
const sanitizedBoundary = Platform.StringUtilities.escapeForRegExp(boundary);
|
|
1105
1113
|
const keyValuePattern = new RegExp(
|
|
1106
|
-
// Header with an optional file name.
|
|
1114
|
+
// Header with an optional file #name.
|
|
1107
1115
|
'^\\r\\ncontent-disposition\\s*:\\s*form-data\\s*;\\s*name="([^"]*)"(?:\\s*;\\s*filename="([^"]*)")?' +
|
|
1108
1116
|
// Optional secondary header with the content type.
|
|
1109
1117
|
'(?:\\r\\ncontent-type\\s*:\\s*([^\\r\\n]*))?' +
|
|
@@ -1143,7 +1151,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1143
1151
|
if (!values.length) {
|
|
1144
1152
|
return undefined;
|
|
1145
1153
|
}
|
|
1146
|
-
// Set-Cookie values should be separated by '\n', not comma, otherwise cookies could not be parsed.
|
|
1154
|
+
// Set-Cookie #values should be separated by '\n', not comma, otherwise cookies could not be parsed.
|
|
1147
1155
|
if (headerName === 'set-cookie') {
|
|
1148
1156
|
return values.join('\n');
|
|
1149
1157
|
}
|
|
@@ -1151,28 +1159,28 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1151
1159
|
}
|
|
1152
1160
|
|
|
1153
1161
|
contentData(): Promise<ContentData> {
|
|
1154
|
-
if (this
|
|
1155
|
-
return this
|
|
1162
|
+
if (this.#contentDataInternal) {
|
|
1163
|
+
return this.#contentDataInternal;
|
|
1156
1164
|
}
|
|
1157
|
-
if (this
|
|
1158
|
-
this
|
|
1165
|
+
if (this.#contentDataProvider) {
|
|
1166
|
+
this.#contentDataInternal = this.#contentDataProvider();
|
|
1159
1167
|
} else {
|
|
1160
|
-
this
|
|
1168
|
+
this.#contentDataInternal = NetworkManager.requestContentData(this);
|
|
1161
1169
|
}
|
|
1162
|
-
return this
|
|
1170
|
+
return this.#contentDataInternal;
|
|
1163
1171
|
}
|
|
1164
1172
|
|
|
1165
1173
|
setContentDataProvider(dataProvider: () => Promise<ContentData>): void {
|
|
1166
|
-
console.assert(!this
|
|
1167
|
-
this
|
|
1174
|
+
console.assert(!this.#contentDataInternal, 'contentData can only be set once.');
|
|
1175
|
+
this.#contentDataProvider = dataProvider;
|
|
1168
1176
|
}
|
|
1169
1177
|
|
|
1170
1178
|
contentURL(): string {
|
|
1171
|
-
return this
|
|
1179
|
+
return this.#urlInternal;
|
|
1172
1180
|
}
|
|
1173
1181
|
|
|
1174
1182
|
contentType(): Common.ResourceType.ResourceType {
|
|
1175
|
-
return this
|
|
1183
|
+
return this.#resourceTypeInternal;
|
|
1176
1184
|
}
|
|
1177
1185
|
|
|
1178
1186
|
async contentEncoded(): Promise<boolean> {
|
|
@@ -1190,7 +1198,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1190
1198
|
|
|
1191
1199
|
async searchInContent(query: string, caseSensitive: boolean, isRegex: boolean):
|
|
1192
1200
|
Promise<TextUtils.ContentProvider.SearchMatch[]> {
|
|
1193
|
-
if (!this
|
|
1201
|
+
if (!this.#contentDataProvider) {
|
|
1194
1202
|
return NetworkManager.searchInRequest(this, query, caseSensitive, isRegex);
|
|
1195
1203
|
}
|
|
1196
1204
|
|
|
@@ -1218,52 +1226,52 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1218
1226
|
}
|
|
1219
1227
|
|
|
1220
1228
|
setInitialPriority(priority: Protocol.Network.ResourcePriority): void {
|
|
1221
|
-
this
|
|
1229
|
+
this.#initialPriorityInternal = priority;
|
|
1222
1230
|
}
|
|
1223
1231
|
|
|
1224
1232
|
initialPriority(): Protocol.Network.ResourcePriority|null {
|
|
1225
|
-
return this
|
|
1233
|
+
return this.#initialPriorityInternal;
|
|
1226
1234
|
}
|
|
1227
1235
|
|
|
1228
1236
|
setPriority(priority: Protocol.Network.ResourcePriority): void {
|
|
1229
|
-
this
|
|
1237
|
+
this.#currentPriority = priority;
|
|
1230
1238
|
}
|
|
1231
1239
|
|
|
1232
1240
|
priority(): Protocol.Network.ResourcePriority|null {
|
|
1233
|
-
return this
|
|
1241
|
+
return this.#currentPriority || this.#initialPriorityInternal || null;
|
|
1234
1242
|
}
|
|
1235
1243
|
|
|
1236
1244
|
setSignedExchangeInfo(info: Protocol.Network.SignedExchangeInfo): void {
|
|
1237
|
-
this
|
|
1245
|
+
this.#signedExchangeInfoInternal = info;
|
|
1238
1246
|
}
|
|
1239
1247
|
|
|
1240
1248
|
signedExchangeInfo(): Protocol.Network.SignedExchangeInfo|null {
|
|
1241
|
-
return this
|
|
1249
|
+
return this.#signedExchangeInfoInternal;
|
|
1242
1250
|
}
|
|
1243
1251
|
|
|
1244
1252
|
setWebBundleInfo(info: WebBundleInfo|null): void {
|
|
1245
|
-
this
|
|
1253
|
+
this.#webBundleInfoInternal = info;
|
|
1246
1254
|
}
|
|
1247
1255
|
|
|
1248
1256
|
webBundleInfo(): WebBundleInfo|null {
|
|
1249
|
-
return this
|
|
1257
|
+
return this.#webBundleInfoInternal;
|
|
1250
1258
|
}
|
|
1251
1259
|
|
|
1252
1260
|
setWebBundleInnerRequestInfo(info: WebBundleInnerRequestInfo|null): void {
|
|
1253
|
-
this
|
|
1261
|
+
this.#webBundleInnerRequestInfoInternal = info;
|
|
1254
1262
|
}
|
|
1255
1263
|
|
|
1256
1264
|
webBundleInnerRequestInfo(): WebBundleInnerRequestInfo|null {
|
|
1257
|
-
return this
|
|
1265
|
+
return this.#webBundleInnerRequestInfoInternal;
|
|
1258
1266
|
}
|
|
1259
1267
|
|
|
1260
1268
|
async populateImageSource(image: HTMLImageElement): Promise<void> {
|
|
1261
1269
|
const {content, encoded} = await this.contentData();
|
|
1262
|
-
let imageSrc = TextUtils.ContentProvider.contentAsDataURL(content, this
|
|
1263
|
-
if (imageSrc === null && !this
|
|
1270
|
+
let imageSrc = TextUtils.ContentProvider.contentAsDataURL(content, this.#mimeTypeInternal, encoded);
|
|
1271
|
+
if (imageSrc === null && !this.#failedInternal) {
|
|
1264
1272
|
const cacheControl = this.responseHeaderValue('cache-control') || '';
|
|
1265
1273
|
if (!cacheControl.includes('no-cache')) {
|
|
1266
|
-
imageSrc = this
|
|
1274
|
+
imageSrc = this.#urlInternal;
|
|
1267
1275
|
}
|
|
1268
1276
|
}
|
|
1269
1277
|
if (imageSrc !== null) {
|
|
@@ -1272,11 +1280,11 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1272
1280
|
}
|
|
1273
1281
|
|
|
1274
1282
|
initiator(): Protocol.Network.Initiator|null {
|
|
1275
|
-
return this
|
|
1283
|
+
return this.#initiatorInternal || null;
|
|
1276
1284
|
}
|
|
1277
1285
|
|
|
1278
1286
|
frames(): WebSocketFrame[] {
|
|
1279
|
-
return this
|
|
1287
|
+
return this.#framesInternal;
|
|
1280
1288
|
}
|
|
1281
1289
|
|
|
1282
1290
|
addProtocolFrameError(errorMessage: string, time: number): void {
|
|
@@ -1296,32 +1304,32 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1296
1304
|
}
|
|
1297
1305
|
|
|
1298
1306
|
addFrame(frame: WebSocketFrame): void {
|
|
1299
|
-
this
|
|
1307
|
+
this.#framesInternal.push(frame);
|
|
1300
1308
|
this.dispatchEventToListeners(Events.WebsocketFrameAdded, frame);
|
|
1301
1309
|
}
|
|
1302
1310
|
|
|
1303
1311
|
eventSourceMessages(): EventSourceMessage[] {
|
|
1304
|
-
return this
|
|
1312
|
+
return this.#eventSourceMessagesInternal;
|
|
1305
1313
|
}
|
|
1306
1314
|
|
|
1307
1315
|
addEventSourceMessage(time: number, eventName: string, eventId: string, data: string): void {
|
|
1308
1316
|
const message = {time: this.pseudoWallTime(time), eventName: eventName, eventId: eventId, data: data};
|
|
1309
|
-
this
|
|
1317
|
+
this.#eventSourceMessagesInternal.push(message);
|
|
1310
1318
|
this.dispatchEventToListeners(Events.EventSourceMessageAdded, message);
|
|
1311
1319
|
}
|
|
1312
1320
|
|
|
1313
1321
|
markAsRedirect(redirectCount: number): void {
|
|
1314
|
-
this
|
|
1315
|
-
this
|
|
1322
|
+
this.#isRedirectInternal = true;
|
|
1323
|
+
this.#requestIdInternal = `${this.#backendRequestIdInternal}:redirected.${redirectCount}`;
|
|
1316
1324
|
}
|
|
1317
1325
|
|
|
1318
1326
|
isRedirect(): boolean {
|
|
1319
|
-
return this
|
|
1327
|
+
return this.#isRedirectInternal;
|
|
1320
1328
|
}
|
|
1321
1329
|
|
|
1322
1330
|
setRequestIdForTest(requestId: Protocol.Network.RequestId): void {
|
|
1323
|
-
this
|
|
1324
|
-
this
|
|
1331
|
+
this.#backendRequestIdInternal = requestId;
|
|
1332
|
+
this.#requestIdInternal = requestId;
|
|
1325
1333
|
}
|
|
1326
1334
|
|
|
1327
1335
|
charset(): string|null {
|
|
@@ -1342,33 +1350,33 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1342
1350
|
}
|
|
1343
1351
|
|
|
1344
1352
|
addExtraRequestInfo(extraRequestInfo: ExtraRequestInfo): void {
|
|
1345
|
-
this
|
|
1346
|
-
this
|
|
1353
|
+
this.#blockedRequestCookiesInternal = extraRequestInfo.blockedRequestCookies;
|
|
1354
|
+
this.#includedRequestCookiesInternal = extraRequestInfo.includedRequestCookies;
|
|
1347
1355
|
this.setRequestHeaders(extraRequestInfo.requestHeaders);
|
|
1348
|
-
this
|
|
1356
|
+
this.#hasExtraRequestInfoInternal = true;
|
|
1349
1357
|
this.setRequestHeadersText(''); // Mark request headers as non-provisional
|
|
1350
|
-
this
|
|
1358
|
+
this.#clientSecurityStateInternal = extraRequestInfo.clientSecurityState;
|
|
1351
1359
|
this.setConnectTimingFromExtraInfo(extraRequestInfo.connectTiming);
|
|
1352
1360
|
}
|
|
1353
1361
|
|
|
1354
1362
|
hasExtraRequestInfo(): boolean {
|
|
1355
|
-
return this
|
|
1363
|
+
return this.#hasExtraRequestInfoInternal;
|
|
1356
1364
|
}
|
|
1357
1365
|
|
|
1358
1366
|
blockedRequestCookies(): BlockedCookieWithReason[] {
|
|
1359
|
-
return this
|
|
1367
|
+
return this.#blockedRequestCookiesInternal;
|
|
1360
1368
|
}
|
|
1361
1369
|
|
|
1362
1370
|
includedRequestCookies(): Cookie[] {
|
|
1363
|
-
return this
|
|
1371
|
+
return this.#includedRequestCookiesInternal;
|
|
1364
1372
|
}
|
|
1365
1373
|
|
|
1366
1374
|
hasRequestCookies(): boolean {
|
|
1367
|
-
return this
|
|
1375
|
+
return this.#includedRequestCookiesInternal.length > 0 || this.#blockedRequestCookiesInternal.length > 0;
|
|
1368
1376
|
}
|
|
1369
1377
|
|
|
1370
1378
|
addExtraResponseInfo(extraResponseInfo: ExtraResponseInfo): void {
|
|
1371
|
-
this
|
|
1379
|
+
this.#blockedResponseCookiesInternal = extraResponseInfo.blockedResponseCookies;
|
|
1372
1380
|
this.responseHeaders = extraResponseInfo.responseHeaders;
|
|
1373
1381
|
|
|
1374
1382
|
if (extraResponseInfo.responseHeadersText) {
|
|
@@ -1389,70 +1397,70 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
1389
1397
|
this.setRequestHeadersText(requestHeadersText);
|
|
1390
1398
|
}
|
|
1391
1399
|
}
|
|
1392
|
-
this
|
|
1400
|
+
this.#remoteAddressSpaceInternal = extraResponseInfo.resourceIPAddressSpace;
|
|
1393
1401
|
|
|
1394
1402
|
if (extraResponseInfo.statusCode) {
|
|
1395
1403
|
this.statusCode = extraResponseInfo.statusCode;
|
|
1396
1404
|
}
|
|
1397
1405
|
|
|
1398
|
-
this
|
|
1406
|
+
this.#hasExtraResponseInfoInternal = true;
|
|
1399
1407
|
|
|
1400
1408
|
// TODO(crbug.com/1252463) Explore replacing this with a DevTools Issue.
|
|
1401
1409
|
const networkManager = NetworkManager.forRequest(this);
|
|
1402
1410
|
if (networkManager) {
|
|
1403
|
-
for (const blockedCookie of this
|
|
1411
|
+
for (const blockedCookie of this.#blockedResponseCookiesInternal) {
|
|
1404
1412
|
if (blockedCookie.blockedReasons.includes(
|
|
1405
1413
|
Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize)) {
|
|
1406
1414
|
const message = i18nString(UIStrings.setcookieHeaderIsIgnoredIn, {PH1: this.url()});
|
|
1407
1415
|
networkManager.dispatchEventToListeners(
|
|
1408
1416
|
NetworkManagerEvents.MessageGenerated,
|
|
1409
|
-
{message: message, requestId: this
|
|
1417
|
+
{message: message, requestId: this.#requestIdInternal, warning: true});
|
|
1410
1418
|
}
|
|
1411
1419
|
}
|
|
1412
1420
|
}
|
|
1413
1421
|
}
|
|
1414
1422
|
|
|
1415
1423
|
hasExtraResponseInfo(): boolean {
|
|
1416
|
-
return this
|
|
1424
|
+
return this.#hasExtraResponseInfoInternal;
|
|
1417
1425
|
}
|
|
1418
1426
|
|
|
1419
1427
|
blockedResponseCookies(): BlockedSetCookieWithReason[] {
|
|
1420
|
-
return this
|
|
1428
|
+
return this.#blockedResponseCookiesInternal;
|
|
1421
1429
|
}
|
|
1422
1430
|
|
|
1423
1431
|
redirectSourceSignedExchangeInfoHasNoErrors(): boolean {
|
|
1424
|
-
return this
|
|
1425
|
-
!this
|
|
1432
|
+
return this.#redirectSourceInternal !== null && this.#redirectSourceInternal.#signedExchangeInfoInternal !== null &&
|
|
1433
|
+
!this.#redirectSourceInternal.#signedExchangeInfoInternal.errors;
|
|
1426
1434
|
}
|
|
1427
1435
|
|
|
1428
1436
|
clientSecurityState(): Protocol.Network.ClientSecurityState|undefined {
|
|
1429
|
-
return this
|
|
1437
|
+
return this.#clientSecurityStateInternal;
|
|
1430
1438
|
}
|
|
1431
1439
|
|
|
1432
1440
|
setTrustTokenParams(trustTokenParams: Protocol.Network.TrustTokenParams): void {
|
|
1433
|
-
this
|
|
1441
|
+
this.#trustTokenParamsInternal = trustTokenParams;
|
|
1434
1442
|
}
|
|
1435
1443
|
|
|
1436
1444
|
trustTokenParams(): Protocol.Network.TrustTokenParams|undefined {
|
|
1437
|
-
return this
|
|
1445
|
+
return this.#trustTokenParamsInternal;
|
|
1438
1446
|
}
|
|
1439
1447
|
|
|
1440
1448
|
setTrustTokenOperationDoneEvent(doneEvent: Protocol.Network.TrustTokenOperationDoneEvent): void {
|
|
1441
|
-
this
|
|
1449
|
+
this.#trustTokenOperationDoneEventInternal = doneEvent;
|
|
1442
1450
|
|
|
1443
1451
|
this.dispatchEventToListeners(Events.TrustTokenResultAdded);
|
|
1444
1452
|
}
|
|
1445
1453
|
|
|
1446
1454
|
trustTokenOperationDoneEvent(): Protocol.Network.TrustTokenOperationDoneEvent|undefined {
|
|
1447
|
-
return this
|
|
1455
|
+
return this.#trustTokenOperationDoneEventInternal;
|
|
1448
1456
|
}
|
|
1449
1457
|
|
|
1450
1458
|
setIsSameSite(isSameSite: boolean): void {
|
|
1451
|
-
this
|
|
1459
|
+
this.#isSameSiteInternal = isSameSite;
|
|
1452
1460
|
}
|
|
1453
1461
|
|
|
1454
1462
|
isSameSite(): boolean|null {
|
|
1455
|
-
return this
|
|
1463
|
+
return this.#isSameSiteInternal;
|
|
1456
1464
|
}
|
|
1457
1465
|
}
|
|
1458
1466
|
|