chrome-devtools-frontend 1.0.965611 → 1.0.967596
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/config/gni/devtools_grd_files.gni +6 -5
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +8 -0
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +6 -6
- package/front_end/core/sdk/CSSSupports.ts +30 -0
- package/front_end/core/sdk/NetworkManager.ts +58 -70
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/devtools_compatibility.js +19 -0
- package/front_end/entrypoints/formatter_worker/formatter_worker.ts +4 -4
- package/front_end/generated/InspectorBackendCommands.js +27 -2
- package/front_end/generated/protocol.ts +61 -0
- package/front_end/legacy_test_runner/bindings_test_runner/PersistenceTestRunner.js +2 -2
- package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +1 -0
- package/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js +1 -2
- package/front_end/models/extensions/ExtensionServer.ts +7 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +18 -21
- package/front_end/models/persistence/IsolatedFileSystem.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +7 -4
- package/front_end/panels/application/components/InterestGroupAccessGrid.ts +10 -2
- package/front_end/panels/application/components/interestGroupAccessGrid.css +1 -1
- package/front_end/panels/application/interestGroupStorageView.css +4 -0
- package/front_end/panels/elements/StylePropertyTreeElement.ts +14 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +33 -11
- package/front_end/panels/event_listeners/EventListenersUtils.ts +3 -2
- package/front_end/panels/event_listeners/EventListenersView.ts +3 -3
- package/front_end/panels/lighthouse/lighthouse.ts +1 -1
- package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
- package/front_end/panels/sources/SourcesPanel.ts +7 -10
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/debuggerPausedMessage.css +5 -1
- package/front_end/third_party/codemirror/README.chromium +5 -0
- package/front_end/third_party/codemirror/codemirror-tsconfig.json +4 -4
- package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.js → runmode-standalone.mjs} +0 -0
- package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.d.ts → runmode-standalone.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/css/{css.js → css.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/css/{css.d.ts → css.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/javascript/{javascript.js → javascript.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/javascript/{javascript.d.ts → javascript.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/xml/{xml.js → xml.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/xml/{xml.d.ts → xml.mjs.d.ts} +0 -0
- package/front_end/third_party/lighthouse/README.chromium +0 -1
- package/front_end/third_party/lighthouse/lighthouse-tsconfig.json +1 -1
- package/front_end/third_party/lighthouse/report-assets/{report-generator.js → report-generator.mjs} +0 -0
- package/front_end/third_party/lighthouse/report-assets/{report-generator.d.ts → report-generator.mjs.d.ts} +0 -0
- package/front_end/third_party/puppeteer/puppeteer.ts +1 -2
- package/front_end/ui/components/text_editor/config.ts +1 -0
- package/front_end/ui/legacy/Icon.ts +2 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -4
- package/front_end/ui/legacy/themeColors.css +1 -1
- package/package.json +2 -1
- package/scripts/build/devtools_plugin.js +11 -0
- package/scripts/build/esbuild.js +63 -0
- package/scripts/build/ninja/bundle.gni +77 -32
- package/scripts/build/ninja/minify-json-files.js +19 -0
- package/scripts/build/ninja/minify_json.gni +28 -0
- package/scripts/build/tests/plugins_test.js +30 -0
- package/scripts/javascript_natives/index.js +9 -6
- package/scripts/javascript_natives/package.json +4 -4
@@ -576,6 +576,7 @@ grd_files_debug_sources = [
|
|
576
576
|
"front_end/core/sdk/CSSRule.js",
|
577
577
|
"front_end/core/sdk/CSSStyleDeclaration.js",
|
578
578
|
"front_end/core/sdk/CSSStyleSheetHeader.js",
|
579
|
+
"front_end/core/sdk/CSSSupports.js",
|
579
580
|
"front_end/core/sdk/CategorizedBreakpoint.js",
|
580
581
|
"front_end/core/sdk/ChildTargetManager.js",
|
581
582
|
"front_end/core/sdk/CompilerSourceMappingContentProvider.js",
|
@@ -1261,17 +1262,17 @@ grd_files_debug_sources = [
|
|
1261
1262
|
"front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs",
|
1262
1263
|
"front_end/third_party/acorn/package/dist/acorn.mjs",
|
1263
1264
|
"front_end/third_party/chromium/client-variations/ClientVariations.js",
|
1264
|
-
"front_end/third_party/codemirror/package/addon/runmode/runmode-standalone.
|
1265
|
-
"front_end/third_party/codemirror/package/mode/css/css.
|
1266
|
-
"front_end/third_party/codemirror/package/mode/javascript/javascript.
|
1267
|
-
"front_end/third_party/codemirror/package/mode/xml/xml.
|
1265
|
+
"front_end/third_party/codemirror/package/addon/runmode/runmode-standalone.mjs",
|
1266
|
+
"front_end/third_party/codemirror/package/mode/css/css.mjs",
|
1267
|
+
"front_end/third_party/codemirror/package/mode/javascript/javascript.mjs",
|
1268
|
+
"front_end/third_party/codemirror/package/mode/xml/xml.mjs",
|
1268
1269
|
"front_end/third_party/diff/DiffWrapper.js",
|
1269
1270
|
"front_end/third_party/diff/diff_match_patch.js",
|
1270
1271
|
"front_end/third_party/i18n/i18n-impl.js",
|
1271
1272
|
"front_end/third_party/i18n/locales.js",
|
1272
1273
|
"front_end/third_party/i18n/localized-string-set.js",
|
1273
1274
|
"front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js",
|
1274
|
-
"front_end/third_party/lighthouse/report-assets/report-generator.
|
1275
|
+
"front_end/third_party/lighthouse/report-assets/report-generator.mjs",
|
1275
1276
|
"front_end/third_party/lighthouse/report/bundle.js",
|
1276
1277
|
"front_end/third_party/lit-html/directive.js",
|
1277
1278
|
"front_end/third_party/lit-html/directives.js",
|
@@ -2966,6 +2966,9 @@
|
|
2966
2966
|
"panels/application/components/InterestGroupAccessGrid.ts | groupOwner": {
|
2967
2967
|
"message": "Owner"
|
2968
2968
|
},
|
2969
|
+
"panels/application/components/InterestGroupAccessGrid.ts | noEvents": {
|
2970
|
+
"message": "No interest group events recorded."
|
2971
|
+
},
|
2969
2972
|
"panels/application/components/OriginTrialTreeView.ts | expiryTime": {
|
2970
2973
|
"message": "Expiry Time"
|
2971
2974
|
},
|
@@ -2966,6 +2966,9 @@
|
|
2966
2966
|
"panels/application/components/InterestGroupAccessGrid.ts | groupOwner": {
|
2967
2967
|
"message": "Ôẃn̂ér̂"
|
2968
2968
|
},
|
2969
|
+
"panels/application/components/InterestGroupAccessGrid.ts | noEvents": {
|
2970
|
+
"message": "N̂ó îńt̂ér̂éŝt́ ĝŕôúp̂ év̂én̂t́ŝ ŕêćôŕd̂éd̂."
|
2971
|
+
},
|
2969
2972
|
"panels/application/components/OriginTrialTreeView.ts | expiryTime": {
|
2970
2973
|
"message": "Êx́p̂ír̂ý T̂ím̂é"
|
2971
2974
|
},
|
@@ -648,6 +648,10 @@ export class TargetBase {
|
|
648
648
|
return this.getAgent('EventBreakpoints');
|
649
649
|
}
|
650
650
|
|
651
|
+
fetchAgent(): ProtocolProxyApi.FetchApi {
|
652
|
+
return this.getAgent('Fetch');
|
653
|
+
}
|
654
|
+
|
651
655
|
heapProfilerAgent(): ProtocolProxyApi.HeapProfilerApi {
|
652
656
|
return this.getAgent('HeapProfiler');
|
653
657
|
}
|
@@ -804,6 +808,10 @@ export class TargetBase {
|
|
804
808
|
this.registerDispatcher('DOMStorage', dispatcher);
|
805
809
|
}
|
806
810
|
|
811
|
+
registerFetchDispatcher(dispatcher: ProtocolProxyApi.FetchDispatcher): void {
|
812
|
+
this.registerDispatcher('Fetch', dispatcher);
|
813
|
+
}
|
814
|
+
|
807
815
|
registerHeapProfilerDispatcher(dispatcher: ProtocolProxyApi.HeapProfilerDispatcher): void {
|
808
816
|
this.registerDispatcher('HeapProfiler', dispatcher);
|
809
817
|
}
|
@@ -9,7 +9,7 @@ import type {CSSModel, Edit} from './CSSModel.js';
|
|
9
9
|
import {CSSLocation} from './CSSModel.js';
|
10
10
|
import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
|
11
11
|
|
12
|
-
type CSSQueryPayload = Protocol.CSS.CSSMedia|Protocol.CSS.CSSContainerQuery;
|
12
|
+
type CSSQueryPayload = Protocol.CSS.CSSMedia|Protocol.CSS.CSSContainerQuery|Protocol.CSS.CSSSupports;
|
13
13
|
|
14
14
|
export abstract class CSSQuery {
|
15
15
|
text = '';
|
@@ -7,6 +7,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
7
7
|
|
8
8
|
import {CSSContainerQuery} from './CSSContainerQuery.js';
|
9
9
|
import {CSSMedia} from './CSSMedia.js';
|
10
|
+
import {CSSSupports} from './CSSSupports.js';
|
10
11
|
|
11
12
|
import type {CSSModel, Edit} from './CSSModel.js';
|
12
13
|
import {CSSStyleDeclaration, Type} from './CSSStyleDeclaration.js';
|
@@ -99,6 +100,7 @@ export class CSSStyleRule extends CSSRule {
|
|
99
100
|
selectors!: CSSValue[];
|
100
101
|
media: CSSMedia[];
|
101
102
|
containerQueries: CSSContainerQuery[];
|
103
|
+
supports: CSSSupports[];
|
102
104
|
wasUsed: boolean;
|
103
105
|
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSRule, wasUsed?: boolean) {
|
104
106
|
// TODO(crbug.com/1011811): Replace with spread operator or better types once Closure is gone.
|
@@ -108,6 +110,7 @@ export class CSSStyleRule extends CSSRule {
|
|
108
110
|
this.containerQueries = payload.containerQueries ?
|
109
111
|
CSSContainerQuery.parseContainerQueriesPayload(cssModel, payload.containerQueries) :
|
110
112
|
[];
|
113
|
+
this.supports = payload.supports ? CSSSupports.parseSupportsPayload(cssModel, payload.supports) : [];
|
111
114
|
this.wasUsed = wasUsed || false;
|
112
115
|
}
|
113
116
|
|
@@ -191,12 +194,9 @@ export class CSSStyleRule extends CSSRule {
|
|
191
194
|
this.selectors[i].rebase(edit);
|
192
195
|
}
|
193
196
|
}
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
for (const containerQuery of this.containerQueries) {
|
198
|
-
containerQuery.rebase(edit);
|
199
|
-
}
|
197
|
+
this.media.forEach(media => media.rebase(edit));
|
198
|
+
this.containerQueries.forEach(cq => cq.rebase(edit));
|
199
|
+
this.supports.forEach(supports => supports.rebase(edit));
|
200
200
|
|
201
201
|
super.rebase(edit);
|
202
202
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// Copyright 2022 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
|
+
|
5
|
+
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
6
|
+
import type * as Protocol from '../../generated/protocol.js';
|
7
|
+
|
8
|
+
import type {CSSModel} from './CSSModel.js';
|
9
|
+
import {CSSQuery} from './CSSQuery.js';
|
10
|
+
|
11
|
+
export class CSSSupports extends CSSQuery {
|
12
|
+
static parseSupportsPayload(cssModel: CSSModel, payload: Protocol.CSS.CSSSupports[]): CSSSupports[] {
|
13
|
+
return payload.map(supports => new CSSSupports(cssModel, supports));
|
14
|
+
}
|
15
|
+
|
16
|
+
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSSupports) {
|
17
|
+
super(cssModel);
|
18
|
+
this.reinitialize(payload);
|
19
|
+
}
|
20
|
+
|
21
|
+
reinitialize(payload: Protocol.CSS.CSSSupports): void {
|
22
|
+
this.text = payload.text;
|
23
|
+
this.range = payload.range ? TextUtils.TextRange.TextRange.fromObject(payload.range) : null;
|
24
|
+
this.styleSheetId = payload.styleSheetId;
|
25
|
+
}
|
26
|
+
|
27
|
+
active(): boolean {
|
28
|
+
return true;
|
29
|
+
}
|
30
|
+
}
|
@@ -123,14 +123,17 @@ const CONNECTION_TYPES = new Map([
|
|
123
123
|
|
124
124
|
export class NetworkManager extends SDKModel<EventTypes> {
|
125
125
|
readonly dispatcher: NetworkDispatcher;
|
126
|
+
readonly fetchDispatcher: FetchDispatcher;
|
126
127
|
readonly #networkAgent: ProtocolProxyApi.NetworkApi;
|
127
128
|
readonly #bypassServiceWorkerSetting: Common.Settings.Setting<boolean>;
|
128
129
|
|
129
130
|
constructor(target: Target) {
|
130
131
|
super(target);
|
131
132
|
this.dispatcher = new NetworkDispatcher(this);
|
133
|
+
this.fetchDispatcher = new FetchDispatcher(target.fetchAgent());
|
132
134
|
this.#networkAgent = target.networkAgent();
|
133
135
|
target.registerNetworkDispatcher(this.dispatcher);
|
136
|
+
target.registerFetchDispatcher(this.fetchDispatcher);
|
134
137
|
if (Common.Settings.Settings.instance().moduleSetting('cacheDisabled').get()) {
|
135
138
|
void this.#networkAgent.invoke_setCacheDisabled({cacheDisabled: true});
|
136
139
|
}
|
@@ -372,6 +375,23 @@ export const Fast3GConditions: Conditions = {
|
|
372
375
|
|
373
376
|
const MAX_EAGER_POST_REQUEST_BODY_LENGTH = 64 * 1024; // bytes
|
374
377
|
|
378
|
+
export class FetchDispatcher implements ProtocolProxyApi.FetchDispatcher {
|
379
|
+
readonly #fetchAgent: ProtocolProxyApi.FetchApi;
|
380
|
+
|
381
|
+
constructor(agent: ProtocolProxyApi.FetchApi) {
|
382
|
+
this.#fetchAgent = agent;
|
383
|
+
}
|
384
|
+
|
385
|
+
requestPaused({requestId, request, resourceType, responseStatusCode, responseHeaders}:
|
386
|
+
Protocol.Fetch.RequestPausedEvent): void {
|
387
|
+
void MultitargetNetworkManager.instance().requestIntercepted(new InterceptedRequest(
|
388
|
+
this.#fetchAgent, request, resourceType, requestId, responseStatusCode, responseHeaders));
|
389
|
+
}
|
390
|
+
|
391
|
+
authRequired({}: Protocol.Fetch.AuthRequiredEvent): void {
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
375
395
|
export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
|
376
396
|
readonly #manager: NetworkManager;
|
377
397
|
#requestsById: Map<string, NetworkRequest>;
|
@@ -782,23 +802,7 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
|
|
782
802
|
networkRequest.addEventSourceMessage(time, eventName, eventId, data);
|
783
803
|
}
|
784
804
|
|
785
|
-
requestIntercepted({
|
786
|
-
interceptionId,
|
787
|
-
request,
|
788
|
-
frameId,
|
789
|
-
resourceType,
|
790
|
-
isNavigationRequest,
|
791
|
-
isDownload,
|
792
|
-
redirectUrl,
|
793
|
-
authChallenge,
|
794
|
-
responseErrorReason,
|
795
|
-
responseStatusCode,
|
796
|
-
responseHeaders,
|
797
|
-
requestId,
|
798
|
-
}: Protocol.Network.RequestInterceptedEvent): void {
|
799
|
-
void MultitargetNetworkManager.instance().requestIntercepted(new InterceptedRequest(
|
800
|
-
this.#manager.target().networkAgent(), interceptionId, request, frameId, resourceType, isNavigationRequest,
|
801
|
-
isDownload, redirectUrl, authChallenge, responseErrorReason, responseStatusCode, responseHeaders, requestId));
|
805
|
+
requestIntercepted({}: Protocol.Network.RequestInterceptedEvent): void {
|
802
806
|
}
|
803
807
|
|
804
808
|
requestWillBeSentExtraInfo({requestId, associatedCookies, headers, clientSecurityState, connectTiming}:
|
@@ -1070,7 +1074,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1070
1074
|
#userAgentOverrideInternal: string;
|
1071
1075
|
#userAgentMetadataOverride: Protocol.Emulation.UserAgentMetadata|null;
|
1072
1076
|
#customAcceptedEncodings: Protocol.Network.ContentEncoding[]|null;
|
1073
|
-
readonly #
|
1077
|
+
readonly #networkAgents: Set<ProtocolProxyApi.NetworkApi>;
|
1078
|
+
readonly #fetchAgents: Set<ProtocolProxyApi.FetchApi>;
|
1074
1079
|
readonly inflightMainResourceRequests: Map<string, NetworkRequest>;
|
1075
1080
|
#networkConditionsInternal: Conditions;
|
1076
1081
|
#updatingInterceptionPatternsPromise: Promise<void>|null;
|
@@ -1087,7 +1092,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1087
1092
|
this.#userAgentOverrideInternal = '';
|
1088
1093
|
this.#userAgentMetadataOverride = null;
|
1089
1094
|
this.#customAcceptedEncodings = null;
|
1090
|
-
this.#
|
1095
|
+
this.#networkAgents = new Set();
|
1096
|
+
this.#fetchAgents = new Set();
|
1091
1097
|
this.inflightMainResourceRequests = new Map();
|
1092
1098
|
this.#networkConditionsInternal = NoThrottlingConditions;
|
1093
1099
|
this.#updatingInterceptionPatternsPromise = null;
|
@@ -1162,6 +1168,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1162
1168
|
|
1163
1169
|
modelAdded(networkManager: NetworkManager): void {
|
1164
1170
|
const networkAgent = networkManager.target().networkAgent();
|
1171
|
+
const fetchAgent = networkManager.target().fetchAgent();
|
1165
1172
|
if (this.#extraHeaders) {
|
1166
1173
|
void networkAgent.invoke_setExtraHTTPHeaders({headers: this.#extraHeaders});
|
1167
1174
|
}
|
@@ -1173,14 +1180,15 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1173
1180
|
void networkAgent.invoke_setBlockedURLs({urls: this.#effectiveBlockedURLs});
|
1174
1181
|
}
|
1175
1182
|
if (this.isIntercepting()) {
|
1176
|
-
void
|
1183
|
+
void fetchAgent.invoke_enable({patterns: this.#urlsForRequestInterceptor.valuesArray()});
|
1177
1184
|
}
|
1178
1185
|
if (this.#customAcceptedEncodings === null) {
|
1179
1186
|
void networkAgent.invoke_clearAcceptedEncodingsOverride();
|
1180
1187
|
} else {
|
1181
1188
|
void networkAgent.invoke_setAcceptedEncodings({encodings: this.#customAcceptedEncodings});
|
1182
1189
|
}
|
1183
|
-
this.#
|
1190
|
+
this.#networkAgents.add(networkAgent);
|
1191
|
+
this.#fetchAgents.add(fetchAgent);
|
1184
1192
|
if (this.isThrottling()) {
|
1185
1193
|
this.updateNetworkConditions(networkAgent);
|
1186
1194
|
}
|
@@ -1194,7 +1202,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1194
1202
|
}
|
1195
1203
|
this.inflightMainResourceRequests.delete((entry[0] as string));
|
1196
1204
|
}
|
1197
|
-
this.#
|
1205
|
+
this.#networkAgents.delete(networkManager.target().networkAgent());
|
1206
|
+
this.#fetchAgents.delete(networkManager.target().fetchAgent());
|
1198
1207
|
}
|
1199
1208
|
|
1200
1209
|
isThrottling(): boolean {
|
@@ -1208,7 +1217,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1208
1217
|
|
1209
1218
|
setNetworkConditions(conditions: Conditions): void {
|
1210
1219
|
this.#networkConditionsInternal = conditions;
|
1211
|
-
for (const agent of this.#
|
1220
|
+
for (const agent of this.#networkAgents) {
|
1212
1221
|
this.updateNetworkConditions(agent);
|
1213
1222
|
}
|
1214
1223
|
this.dispatchEventToListeners(MultitargetNetworkManager.Events.ConditionsChanged);
|
@@ -1236,7 +1245,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1236
1245
|
|
1237
1246
|
setExtraHTTPHeaders(headers: Protocol.Network.Headers): void {
|
1238
1247
|
this.#extraHeaders = headers;
|
1239
|
-
for (const agent of this.#
|
1248
|
+
for (const agent of this.#networkAgents) {
|
1240
1249
|
void agent.invoke_setExtraHTTPHeaders({headers: this.#extraHeaders});
|
1241
1250
|
}
|
1242
1251
|
}
|
@@ -1247,7 +1256,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1247
1256
|
|
1248
1257
|
private updateUserAgentOverride(): void {
|
1249
1258
|
const userAgent = this.currentUserAgent();
|
1250
|
-
for (const agent of this.#
|
1259
|
+
for (const agent of this.#networkAgents) {
|
1251
1260
|
void agent.invoke_setUserAgentOverride(
|
1252
1261
|
{userAgent: userAgent, userAgentMetadata: this.#userAgentMetadataOverride || undefined});
|
1253
1262
|
}
|
@@ -1297,7 +1306,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1297
1306
|
|
1298
1307
|
private updateAcceptedEncodingsOverride(): void {
|
1299
1308
|
const customAcceptedEncodings = this.#customAcceptedEncodings;
|
1300
|
-
for (const agent of this.#
|
1309
|
+
for (const agent of this.#networkAgents) {
|
1301
1310
|
if (customAcceptedEncodings === null) {
|
1302
1311
|
void agent.invoke_clearAcceptedEncodingsOverride();
|
1303
1312
|
} else {
|
@@ -1348,7 +1357,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1348
1357
|
return;
|
1349
1358
|
}
|
1350
1359
|
this.#effectiveBlockedURLs = urls;
|
1351
|
-
for (const agent of this.#
|
1360
|
+
for (const agent of this.#networkAgents) {
|
1352
1361
|
void agent.invoke_setBlockedURLs({urls: this.#effectiveBlockedURLs});
|
1353
1362
|
}
|
1354
1363
|
}
|
@@ -1381,8 +1390,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1381
1390
|
}
|
1382
1391
|
this.#updatingInterceptionPatternsPromise = null;
|
1383
1392
|
const promises = ([] as Promise<unknown>[]);
|
1384
|
-
for (const agent of this.#
|
1385
|
-
promises.push(agent.
|
1393
|
+
for (const agent of this.#fetchAgents) {
|
1394
|
+
promises.push(agent.invoke_enable({patterns: this.#urlsForRequestInterceptor.valuesArray()}));
|
1386
1395
|
}
|
1387
1396
|
this.dispatchEventToListeners(MultitargetNetworkManager.Events.InterceptorsChanged);
|
1388
1397
|
await Promise.all(promises);
|
@@ -1401,13 +1410,13 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1401
1410
|
}
|
1402
1411
|
|
1403
1412
|
clearBrowserCache(): void {
|
1404
|
-
for (const agent of this.#
|
1413
|
+
for (const agent of this.#networkAgents) {
|
1405
1414
|
void agent.invoke_clearBrowserCache();
|
1406
1415
|
}
|
1407
1416
|
}
|
1408
1417
|
|
1409
1418
|
clearBrowserCookies(): void {
|
1410
|
-
for (const agent of this.#
|
1419
|
+
for (const agent of this.#networkAgents) {
|
1411
1420
|
void agent.invoke_clearBrowserCookies();
|
1412
1421
|
}
|
1413
1422
|
}
|
@@ -1470,38 +1479,26 @@ export namespace MultitargetNetworkManager {
|
|
1470
1479
|
}
|
1471
1480
|
|
1472
1481
|
export class InterceptedRequest {
|
1473
|
-
readonly #
|
1474
|
-
readonly #interceptionId: Protocol.Network.InterceptionId;
|
1482
|
+
readonly #fetchAgent: ProtocolProxyApi.FetchApi;
|
1475
1483
|
#hasRespondedInternal: boolean;
|
1476
1484
|
request: Protocol.Network.Request;
|
1477
|
-
frameId: Protocol.Page.FrameId;
|
1478
1485
|
resourceType: Protocol.Network.ResourceType;
|
1479
|
-
isNavigationRequest: boolean;
|
1480
|
-
isDownload: boolean;
|
1481
|
-
redirectUrl: string|undefined;
|
1482
|
-
authChallenge: Protocol.Network.AuthChallenge|undefined;
|
1483
|
-
responseErrorReason: Protocol.Network.ErrorReason|undefined;
|
1484
1486
|
responseStatusCode: number|undefined;
|
1485
|
-
responseHeaders: Protocol.
|
1486
|
-
requestId:
|
1487
|
+
responseHeaders: Protocol.Fetch.HeaderEntry[]|undefined;
|
1488
|
+
requestId: Protocol.Fetch.RequestId;
|
1487
1489
|
|
1488
1490
|
constructor(
|
1489
|
-
|
1490
|
-
request: Protocol.Network.Request,
|
1491
|
-
|
1492
|
-
|
1493
|
-
responseStatusCode?: number,
|
1494
|
-
|
1495
|
-
|
1491
|
+
fetchAgent: ProtocolProxyApi.FetchApi,
|
1492
|
+
request: Protocol.Network.Request,
|
1493
|
+
resourceType: Protocol.Network.ResourceType,
|
1494
|
+
requestId: Protocol.Fetch.RequestId,
|
1495
|
+
responseStatusCode?: number,
|
1496
|
+
responseHeaders?: Protocol.Fetch.HeaderEntry[],
|
1497
|
+
) {
|
1498
|
+
this.#fetchAgent = fetchAgent;
|
1496
1499
|
this.#hasRespondedInternal = false;
|
1497
1500
|
this.request = request;
|
1498
|
-
this.frameId = frameId;
|
1499
1501
|
this.resourceType = resourceType;
|
1500
|
-
this.isNavigationRequest = isNavigationRequest;
|
1501
|
-
this.isDownload = Boolean(isDownload);
|
1502
|
-
this.redirectUrl = redirectUrl;
|
1503
|
-
this.authChallenge = authChallenge;
|
1504
|
-
this.responseErrorReason = responseErrorReason;
|
1505
1502
|
this.responseStatusCode = responseStatusCode;
|
1506
1503
|
this.responseHeaders = responseHeaders;
|
1507
1504
|
this.requestId = requestId;
|
@@ -1513,17 +1510,9 @@ export class InterceptedRequest {
|
|
1513
1510
|
|
1514
1511
|
async continueRequestWithContent(contentBlob: Blob): Promise<void> {
|
1515
1512
|
this.#hasRespondedInternal = true;
|
1516
|
-
const
|
1517
|
-
|
1518
|
-
|
1519
|
-
'Server: Chrome Devtools Request Interceptor',
|
1520
|
-
'Connection: closed',
|
1521
|
-
'Content-Length: ' + contentBlob.size,
|
1522
|
-
'Content-Type: ' + contentBlob.type || 'text/x-unknown',
|
1523
|
-
];
|
1524
|
-
const encodedResponse = await blobToBase64(new Blob([headers.join('\r\n'), '\r\n\r\n', contentBlob]));
|
1525
|
-
void this.#networkAgent.invoke_continueInterceptedRequest(
|
1526
|
-
{interceptionId: this.#interceptionId, rawResponse: encodedResponse});
|
1513
|
+
const body = await blobToBase64(contentBlob);
|
1514
|
+
void this.#fetchAgent.invoke_fulfillRequest(
|
1515
|
+
{requestId: this.requestId, responseCode: this.responseStatusCode || 200, body});
|
1527
1516
|
|
1528
1517
|
async function blobToBase64(blob: Blob): Promise<string> {
|
1529
1518
|
const reader = new FileReader();
|
@@ -1548,18 +1537,17 @@ export class InterceptedRequest {
|
|
1548
1537
|
continueRequestWithoutChange(): void {
|
1549
1538
|
console.assert(!this.#hasRespondedInternal);
|
1550
1539
|
this.#hasRespondedInternal = true;
|
1551
|
-
void this.#
|
1540
|
+
void this.#fetchAgent.invoke_continueRequest({requestId: this.requestId});
|
1552
1541
|
}
|
1553
1542
|
|
1554
1543
|
continueRequestWithError(errorReason: Protocol.Network.ErrorReason): void {
|
1555
1544
|
console.assert(!this.#hasRespondedInternal);
|
1556
1545
|
this.#hasRespondedInternal = true;
|
1557
|
-
void this.#
|
1546
|
+
void this.#fetchAgent.invoke_failRequest({requestId: this.requestId, errorReason});
|
1558
1547
|
}
|
1559
1548
|
|
1560
1549
|
async responseBody(): Promise<ContentData> {
|
1561
|
-
const response =
|
1562
|
-
await this.#networkAgent.invoke_getResponseBodyForInterception({interceptionId: this.#interceptionId});
|
1550
|
+
const response = await this.#fetchAgent.invoke_getResponseBody({requestId: this.requestId});
|
1563
1551
|
const error = response.getError() || null;
|
1564
1552
|
return {error: error, content: error ? null : response.body, encoded: response.base64Encoded};
|
1565
1553
|
}
|
@@ -1714,7 +1702,7 @@ export interface Message {
|
|
1714
1702
|
|
1715
1703
|
export interface InterceptionPattern {
|
1716
1704
|
urlPattern: string;
|
1717
|
-
|
1705
|
+
requestStage: Protocol.Fetch.RequestStage;
|
1718
1706
|
}
|
1719
1707
|
|
1720
1708
|
export type RequestInterceptor = (request: InterceptedRequest) => Promise<void>;
|
@@ -34,6 +34,7 @@ import * as CSSQuery from './CSSQuery.js';
|
|
34
34
|
import * as CSSRule from './CSSRule.js';
|
35
35
|
import * as CSSStyleDeclaration from './CSSStyleDeclaration.js';
|
36
36
|
import * as CSSStyleSheetHeader from './CSSStyleSheetHeader.js';
|
37
|
+
import * as CSSSupports from './CSSSupports.js';
|
37
38
|
import * as DebuggerModel from './DebuggerModel.js';
|
38
39
|
import * as DOMDebuggerModel from './DOMDebuggerModel.js';
|
39
40
|
import * as DOMModel from './DOMModel.js';
|
@@ -101,6 +102,7 @@ export {
|
|
101
102
|
CSSRule,
|
102
103
|
CSSStyleDeclaration,
|
103
104
|
CSSStyleSheetHeader,
|
105
|
+
CSSSupports,
|
104
106
|
DebuggerModel,
|
105
107
|
DOMDebuggerModel,
|
106
108
|
DOMModel,
|
@@ -28,6 +28,11 @@
|
|
28
28
|
*/
|
29
29
|
this._addExtensionCallback = null;
|
30
30
|
|
31
|
+
/**
|
32
|
+
* @type {!Array<string>}
|
33
|
+
*/
|
34
|
+
this._originsForbiddenForExtensions = [];
|
35
|
+
|
31
36
|
/**
|
32
37
|
* @type {!Promise<string>}
|
33
38
|
*/
|
@@ -95,6 +100,20 @@
|
|
95
100
|
}
|
96
101
|
}
|
97
102
|
|
103
|
+
/**
|
104
|
+
* @param {!Array<string>} forbiddenOrigins
|
105
|
+
*/
|
106
|
+
setOriginsForbiddenForExtensions(forbiddenOrigins) {
|
107
|
+
this._originsForbiddenForExtensions = forbiddenOrigins;
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* @return {!Array<string>}
|
112
|
+
*/
|
113
|
+
getOriginsForbiddenForExtensions() {
|
114
|
+
return this._originsForbiddenForExtensions;
|
115
|
+
}
|
116
|
+
|
98
117
|
/**
|
99
118
|
* @param {string} url
|
100
119
|
*/
|
@@ -2,10 +2,10 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
-
import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.
|
6
|
-
import '../../third_party/codemirror/package/mode/css/css.
|
7
|
-
import '../../third_party/codemirror/package/mode/xml/xml.
|
8
|
-
import '../../third_party/codemirror/package/mode/javascript/javascript.
|
5
|
+
import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.mjs';
|
6
|
+
import '../../third_party/codemirror/package/mode/css/css.mjs';
|
7
|
+
import '../../third_party/codemirror/package/mode/xml/xml.mjs';
|
8
|
+
import '../../third_party/codemirror/package/mode/javascript/javascript.mjs';
|
9
9
|
|
10
10
|
import * as CSSFormatter from './CSSFormatter.js';
|
11
11
|
import * as CSSRuleParser from './CSSRuleParser.js';
|
@@ -282,6 +282,27 @@ export function registerCommands(inspectorBackend) {
|
|
282
282
|
inspectorBackend.registerEnum(
|
283
283
|
'Audits.ClientHintIssueReason',
|
284
284
|
{MetaTagAllowListInvalidOrigin: 'MetaTagAllowListInvalidOrigin', MetaTagModifiedHTML: 'MetaTagModifiedHTML'});
|
285
|
+
inspectorBackend.registerEnum('Audits.FederatedAuthRequestIssueReason', {
|
286
|
+
ApprovalDeclined: 'ApprovalDeclined',
|
287
|
+
TooManyRequests: 'TooManyRequests',
|
288
|
+
WellKnownHttpNotFound: 'WellKnownHttpNotFound',
|
289
|
+
WellKnownNoResponse: 'WellKnownNoResponse',
|
290
|
+
WellKnownInvalidResponse: 'WellKnownInvalidResponse',
|
291
|
+
ClientIdMetadataHttpNotFound: 'ClientIdMetadataHttpNotFound',
|
292
|
+
ClientIdMetadataNoResponse: 'ClientIdMetadataNoResponse',
|
293
|
+
ClientIdMetadataInvalidResponse: 'ClientIdMetadataInvalidResponse',
|
294
|
+
ErrorFetchingSignin: 'ErrorFetchingSignin',
|
295
|
+
InvalidSigninResponse: 'InvalidSigninResponse',
|
296
|
+
AccountsHttpNotFound: 'AccountsHttpNotFound',
|
297
|
+
AccountsNoResponse: 'AccountsNoResponse',
|
298
|
+
AccountsInvalidResponse: 'AccountsInvalidResponse',
|
299
|
+
IdTokenHttpNotFound: 'IdTokenHttpNotFound',
|
300
|
+
IdTokenNoResponse: 'IdTokenNoResponse',
|
301
|
+
IdTokenInvalidResponse: 'IdTokenInvalidResponse',
|
302
|
+
IdTokenInvalidRequest: 'IdTokenInvalidRequest',
|
303
|
+
ErrorIdToken: 'ErrorIdToken',
|
304
|
+
Canceled: 'Canceled'
|
305
|
+
});
|
285
306
|
inspectorBackend.registerEnum('Audits.InspectorIssueCode', {
|
286
307
|
SameSiteCookieIssue: 'SameSiteCookieIssue',
|
287
308
|
MixedContentIssue: 'MixedContentIssue',
|
@@ -297,7 +318,8 @@ export function registerCommands(inspectorBackend) {
|
|
297
318
|
NavigatorUserAgentIssue: 'NavigatorUserAgentIssue',
|
298
319
|
GenericIssue: 'GenericIssue',
|
299
320
|
DeprecationIssue: 'DeprecationIssue',
|
300
|
-
ClientHintIssue: 'ClientHintIssue'
|
321
|
+
ClientHintIssue: 'ClientHintIssue',
|
322
|
+
FederatedAuthRequestIssue: 'FederatedAuthRequestIssue'
|
301
323
|
});
|
302
324
|
inspectorBackend.registerEvent('Audits.issueAdded', ['issue']);
|
303
325
|
inspectorBackend.registerEnum('Audits.GetEncodedResponseRequestEncoding', {Webp: 'webp', Jpeg: 'jpeg', Png: 'png'});
|
@@ -1647,7 +1669,8 @@ export function registerCommands(inspectorBackend) {
|
|
1647
1669
|
SameOrigin: 'SameOrigin',
|
1648
1670
|
SameOriginAllowPopups: 'SameOriginAllowPopups',
|
1649
1671
|
UnsafeNone: 'UnsafeNone',
|
1650
|
-
SameOriginPlusCoep: 'SameOriginPlusCoep'
|
1672
|
+
SameOriginPlusCoep: 'SameOriginPlusCoep',
|
1673
|
+
SameOriginAllowPopupsPlusCoep: 'SameOriginAllowPopupsPlusCoep'
|
1651
1674
|
});
|
1652
1675
|
inspectorBackend.registerEnum(
|
1653
1676
|
'Network.CrossOriginEmbedderPolicyValue',
|
@@ -2001,10 +2024,12 @@ export function registerCommands(inspectorBackend) {
|
|
2001
2024
|
ChUaPlatform: 'ch-ua-platform',
|
2002
2025
|
ChUaModel: 'ch-ua-model',
|
2003
2026
|
ChUaMobile: 'ch-ua-mobile',
|
2027
|
+
ChUaFull: 'ch-ua-full',
|
2004
2028
|
ChUaFullVersion: 'ch-ua-full-version',
|
2005
2029
|
ChUaFullVersionList: 'ch-ua-full-version-list',
|
2006
2030
|
ChUaPlatformVersion: 'ch-ua-platform-version',
|
2007
2031
|
ChUaReduced: 'ch-ua-reduced',
|
2032
|
+
ChUaWow64: 'ch-ua-wow64',
|
2008
2033
|
ChViewportHeight: 'ch-viewport-height',
|
2009
2034
|
ChViewportWidth: 'ch-viewport-width',
|
2010
2035
|
ChWidth: 'ch-width',
|