chrome-devtools-frontend 1.0.1014346 → 1.0.1015658
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/.eslintignore +1 -0
- package/config/gni/devtools_grd_files.gni +4 -2
- package/front_end/core/common/JavaScriptMetaData.ts +20 -0
- package/front_end/core/i18n/locales/af.json +195 -93
- package/front_end/core/i18n/locales/am.json +191 -89
- package/front_end/core/i18n/locales/ar.json +193 -91
- package/front_end/core/i18n/locales/as.json +192 -90
- package/front_end/core/i18n/locales/az.json +191 -89
- package/front_end/core/i18n/locales/be.json +191 -89
- package/front_end/core/i18n/locales/bg.json +190 -88
- package/front_end/core/i18n/locales/bn.json +191 -89
- package/front_end/core/i18n/locales/bs.json +193 -91
- package/front_end/core/i18n/locales/ca.json +189 -87
- package/front_end/core/i18n/locales/cs.json +191 -89
- package/front_end/core/i18n/locales/cy.json +191 -89
- package/front_end/core/i18n/locales/da.json +191 -89
- package/front_end/core/i18n/locales/de.json +193 -91
- package/front_end/core/i18n/locales/el.json +174 -72
- package/front_end/core/i18n/locales/en-GB.json +132 -30
- package/front_end/core/i18n/locales/en-US.json +3 -3
- package/front_end/core/i18n/locales/en-XL.json +3 -3
- package/front_end/core/i18n/locales/es-419.json +192 -90
- package/front_end/core/i18n/locales/es.json +200 -98
- package/front_end/core/i18n/locales/et.json +190 -88
- package/front_end/core/i18n/locales/eu.json +197 -95
- package/front_end/core/i18n/locales/fa.json +192 -90
- package/front_end/core/i18n/locales/fi.json +192 -90
- package/front_end/core/i18n/locales/fil.json +190 -88
- package/front_end/core/i18n/locales/fr-CA.json +191 -89
- package/front_end/core/i18n/locales/fr.json +192 -90
- package/front_end/core/i18n/locales/gl.json +173 -71
- package/front_end/core/i18n/locales/gu.json +192 -90
- package/front_end/core/i18n/locales/he.json +191 -89
- package/front_end/core/i18n/locales/hi.json +172 -70
- package/front_end/core/i18n/locales/hr.json +180 -78
- package/front_end/core/i18n/locales/hu.json +191 -89
- package/front_end/core/i18n/locales/hy.json +192 -90
- package/front_end/core/i18n/locales/id.json +192 -90
- package/front_end/core/i18n/locales/is.json +176 -74
- package/front_end/core/i18n/locales/it.json +192 -90
- package/front_end/core/i18n/locales/ja.json +190 -88
- package/front_end/core/i18n/locales/ka.json +190 -88
- package/front_end/core/i18n/locales/kk.json +198 -96
- package/front_end/core/i18n/locales/km.json +195 -93
- package/front_end/core/i18n/locales/kn.json +193 -91
- package/front_end/core/i18n/locales/ko.json +190 -88
- package/front_end/core/i18n/locales/ky.json +193 -91
- package/front_end/core/i18n/locales/lo.json +192 -90
- package/front_end/core/i18n/locales/lt.json +193 -91
- package/front_end/core/i18n/locales/lv.json +175 -73
- package/front_end/core/i18n/locales/mk.json +193 -91
- package/front_end/core/i18n/locales/ml.json +193 -91
- package/front_end/core/i18n/locales/mn.json +190 -88
- package/front_end/core/i18n/locales/mr.json +191 -89
- package/front_end/core/i18n/locales/ms.json +190 -88
- package/front_end/core/i18n/locales/my.json +191 -89
- package/front_end/core/i18n/locales/ne.json +172 -70
- package/front_end/core/i18n/locales/nl.json +191 -89
- package/front_end/core/i18n/locales/no.json +191 -89
- package/front_end/core/i18n/locales/or.json +196 -94
- package/front_end/core/i18n/locales/pa.json +191 -89
- package/front_end/core/i18n/locales/pl.json +191 -89
- package/front_end/core/i18n/locales/pt-PT.json +199 -97
- package/front_end/core/i18n/locales/pt.json +191 -89
- package/front_end/core/i18n/locales/ro.json +193 -91
- package/front_end/core/i18n/locales/ru.json +193 -91
- package/front_end/core/i18n/locales/si.json +191 -89
- package/front_end/core/i18n/locales/sk.json +192 -90
- package/front_end/core/i18n/locales/sl.json +191 -89
- package/front_end/core/i18n/locales/sq.json +193 -91
- package/front_end/core/i18n/locales/sr-Latn.json +190 -88
- package/front_end/core/i18n/locales/sr.json +190 -88
- package/front_end/core/i18n/locales/sv.json +191 -89
- package/front_end/core/i18n/locales/sw.json +192 -90
- package/front_end/core/i18n/locales/ta.json +193 -91
- package/front_end/core/i18n/locales/te.json +134 -32
- package/front_end/core/i18n/locales/th.json +190 -88
- package/front_end/core/i18n/locales/tr.json +193 -91
- package/front_end/core/i18n/locales/uk.json +193 -91
- package/front_end/core/i18n/locales/ur.json +191 -89
- package/front_end/core/i18n/locales/uz.json +190 -88
- package/front_end/core/i18n/locales/vi.json +190 -88
- package/front_end/core/i18n/locales/zh-HK.json +192 -90
- package/front_end/core/i18n/locales/zh-TW.json +195 -93
- package/front_end/core/i18n/locales/zh.json +191 -89
- package/front_end/core/i18n/locales/zu.json +192 -90
- package/front_end/core/sdk/DOMModel.ts +9 -0
- package/front_end/core/sdk/DebuggerModel.ts +0 -28
- package/front_end/core/sdk/Script.ts +5 -14
- package/front_end/core/sdk/SourceMap.ts +88 -27
- package/front_end/generated/InspectorBackendCommands.js +7 -3
- package/front_end/generated/protocol-mapping.d.ts +16 -0
- package/front_end/generated/protocol-proxy-api.d.ts +18 -0
- package/front_end/generated/protocol.ts +31 -5
- package/front_end/models/bindings/ResourceScriptMapping.ts +1 -2
- package/front_end/models/emulation/EmulatedDevices.ts +0 -13
- package/front_end/models/javascript_metadata/DOMPinnedProperties.ts +247 -225
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +3 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -4
- package/front_end/models/javascript_metadata/javascript_metadata.ts +3 -0
- package/front_end/models/source_map_scopes/NamesResolver.ts +99 -23
- package/front_end/panels/elements/ElementsTreeElement.ts +7 -3
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +3 -4
- package/front_end/panels/elements/components/LayoutPane.ts +3 -4
- package/front_end/panels/elements/components/QueryContainer.ts +3 -4
- package/front_end/panels/elements/components/components.ts +0 -2
- package/front_end/panels/lighthouse/lighthouseStartView.css +3 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -42
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +64 -8
- package/front_end/{panels/elements/components → ui/components/node_text}/NodeText.ts +2 -1
- package/front_end/{panels/elements/components → ui/components/node_text}/nodeText.css +0 -0
- package/front_end/ui/components/node_text/node_text.ts +9 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -5
- package/front_end/ui/legacy/components/object_ui/objectValue.css +1 -4
- package/package.json +1 -1
- package/scripts/webidl-properties/config.js +305 -239
- package/scripts/webidl-properties/get-props.js +23 -12
- package/scripts/webidl-properties/index.js +14 -9
- package/scripts/webidl-properties/tests.js +58 -14
@@ -64,6 +64,7 @@ export class DOMNode {
|
|
64
64
|
#localNameInternal!: string;
|
65
65
|
nodeValueInternal!: string;
|
66
66
|
#pseudoTypeInternal!: Protocol.DOM.PseudoType|undefined;
|
67
|
+
#pseudoIdentifier?: string;
|
67
68
|
#shadowRootTypeInternal!: Protocol.DOM.ShadowRootType|undefined;
|
68
69
|
#frameOwnerFrameIdInternal!: Protocol.Page.FrameId|null;
|
69
70
|
#xmlVersion!: string|undefined;
|
@@ -135,6 +136,7 @@ export class DOMNode {
|
|
135
136
|
this.#localNameInternal = payload.localName;
|
136
137
|
this.nodeValueInternal = payload.nodeValue;
|
137
138
|
this.#pseudoTypeInternal = payload.pseudoType;
|
139
|
+
this.#pseudoIdentifier = payload.pseudoIdentifier;
|
138
140
|
this.#shadowRootTypeInternal = payload.shadowRootType;
|
139
141
|
this.#frameOwnerFrameIdInternal = payload.frameId || null;
|
140
142
|
this.#xmlVersion = payload.xmlVersion;
|
@@ -318,6 +320,10 @@ export class DOMNode {
|
|
318
320
|
return this.#pseudoTypeInternal;
|
319
321
|
}
|
320
322
|
|
323
|
+
pseudoIdentifier(): string|undefined {
|
324
|
+
return this.#pseudoIdentifier;
|
325
|
+
}
|
326
|
+
|
321
327
|
hasPseudoElements(): boolean {
|
322
328
|
return this.#pseudoElements.size > 0;
|
323
329
|
}
|
@@ -1644,6 +1650,9 @@ class DOMDispatcher implements ProtocolProxyApi.DOMDispatcher {
|
|
1644
1650
|
distributedNodesUpdated({insertionPointId, distributedNodes}: Protocol.DOM.DistributedNodesUpdatedEvent): void {
|
1645
1651
|
this.#domModel.distributedNodesUpdated(insertionPointId, distributedNodes);
|
1646
1652
|
}
|
1653
|
+
|
1654
|
+
topLayerElementsUpdated(): void {
|
1655
|
+
}
|
1647
1656
|
}
|
1648
1657
|
|
1649
1658
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
@@ -580,34 +580,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
580
580
|
return result;
|
581
581
|
}
|
582
582
|
|
583
|
-
setScriptSource(
|
584
|
-
scriptId: string, newSource: string,
|
585
|
-
callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void): void {
|
586
|
-
const script = this.#scriptsInternal.get(scriptId);
|
587
|
-
if (script) {
|
588
|
-
void script.editSource(newSource, this.didEditScriptSource.bind(this, scriptId, newSource, callback));
|
589
|
-
}
|
590
|
-
}
|
591
|
-
|
592
|
-
private didEditScriptSource(
|
593
|
-
scriptId: string, newSource: string,
|
594
|
-
callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void, error: string|null,
|
595
|
-
exceptionDetails?: Protocol.Runtime.ExceptionDetails, callFrames?: Protocol.Debugger.CallFrame[],
|
596
|
-
asyncStackTrace?: Protocol.Runtime.StackTrace, asyncStackTraceId?: Protocol.Runtime.StackTraceId,
|
597
|
-
needsStepIn?: boolean): void {
|
598
|
-
callback(error, exceptionDetails);
|
599
|
-
if (needsStepIn) {
|
600
|
-
void this.stepInto();
|
601
|
-
return;
|
602
|
-
}
|
603
|
-
|
604
|
-
if (!error && callFrames && callFrames.length && this.#debuggerPausedDetailsInternal) {
|
605
|
-
void this.pausedScript(
|
606
|
-
callFrames, this.#debuggerPausedDetailsInternal.reason, this.#debuggerPausedDetailsInternal.auxData,
|
607
|
-
this.#debuggerPausedDetailsInternal.breakpointIds, asyncStackTrace, asyncStackTraceId);
|
608
|
-
}
|
609
|
-
}
|
610
|
-
|
611
583
|
get callFrames(): CallFrame[]|null {
|
612
584
|
return this.#debuggerPausedDetailsInternal ? this.#debuggerPausedDetailsInternal.callFrames : null;
|
613
585
|
}
|
@@ -257,25 +257,19 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
|
257
257
|
return source + '\n //# sourceURL=' + this.sourceURL;
|
258
258
|
}
|
259
259
|
|
260
|
-
async editSource(
|
261
|
-
|
262
|
-
callback:
|
263
|
-
(error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined,
|
264
|
-
arg2?: Array<Protocol.Debugger.CallFrame>|undefined, arg3?: Protocol.Runtime.StackTrace|undefined,
|
265
|
-
arg4?: Protocol.Runtime.StackTraceId|undefined, arg5?: boolean|undefined) => void): Promise<void> {
|
260
|
+
async editSource(newSource: string):
|
261
|
+
Promise<{error: string | null, exceptionDetails?: Protocol.Runtime.ExceptionDetails}> {
|
266
262
|
newSource = Script.trimSourceURLComment(newSource);
|
267
263
|
// We append correct #sourceURL to script for consistency only. It's not actually needed for things to work correctly.
|
268
264
|
newSource = this.appendSourceURLCommentIfNeeded(newSource);
|
269
265
|
|
270
266
|
if (!this.scriptId) {
|
271
|
-
|
272
|
-
return;
|
267
|
+
return {error: 'Script failed to parse'};
|
273
268
|
}
|
274
269
|
|
275
270
|
const {content: oldSource} = await this.requestContent();
|
276
271
|
if (oldSource === newSource) {
|
277
|
-
|
278
|
-
return;
|
272
|
+
return {error: null};
|
279
273
|
}
|
280
274
|
const response = await this.debuggerModel.target().debuggerAgent().invoke_setScriptSource(
|
281
275
|
{scriptId: this.scriptId, scriptSource: newSource});
|
@@ -284,10 +278,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
|
284
278
|
this.#contentPromise = Promise.resolve({content: newSource, isEncoded: false});
|
285
279
|
}
|
286
280
|
|
287
|
-
|
288
|
-
callback(
|
289
|
-
response.getError() || null, response.exceptionDetails, response.callFrames, response.asyncStackTrace,
|
290
|
-
response.asyncStackTraceId, needsStepIn);
|
281
|
+
return {error: response.getError() || null, exceptionDetails: response.exceptionDetails};
|
291
282
|
}
|
292
283
|
|
293
284
|
rawLocation(lineNumber: number, columnNumber: number): Location|null {
|
@@ -66,6 +66,11 @@ export interface SourceMap {
|
|
66
66
|
TextUtils.ContentProvider.ContentProvider;
|
67
67
|
embeddedContentByURL(sourceURL: Platform.DevToolsPath.UrlString): string|null;
|
68
68
|
findEntry(lineNumber: number, columnNumber: number): SourceMapEntry|null;
|
69
|
+
findEntryRanges(lineNumber: number, columnNumber: number): {
|
70
|
+
range: TextUtils.TextRange.TextRange,
|
71
|
+
sourceRange: TextUtils.TextRange.TextRange,
|
72
|
+
sourceURL: Platform.DevToolsPath.UrlString,
|
73
|
+
}|null;
|
69
74
|
findReverseRanges(sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number):
|
70
75
|
TextUtils.TextRange.TextRange[];
|
71
76
|
sourceLineMapping(sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number):
|
@@ -233,6 +238,52 @@ export class TextSourceMap implements SourceMap {
|
|
233
238
|
return index ? mappings[index - 1] : null;
|
234
239
|
}
|
235
240
|
|
241
|
+
findEntryRanges(lineNumber: number, columnNumber: number): {
|
242
|
+
range: TextUtils.TextRange.TextRange,
|
243
|
+
sourceRange: TextUtils.TextRange.TextRange,
|
244
|
+
sourceURL: Platform.DevToolsPath.UrlString,
|
245
|
+
}|null {
|
246
|
+
const mappings = this.mappings();
|
247
|
+
const index = Platform.ArrayUtilities.upperBound(
|
248
|
+
mappings, undefined, (unused, entry) => lineNumber - entry.lineNumber || columnNumber - entry.columnNumber);
|
249
|
+
if (!index) {
|
250
|
+
// If the line and column are preceding all the entries, then there is nothing to map.
|
251
|
+
return null;
|
252
|
+
}
|
253
|
+
const sourceURL = mappings[index].sourceURL;
|
254
|
+
if (!sourceURL) {
|
255
|
+
return null;
|
256
|
+
}
|
257
|
+
|
258
|
+
// Let us compute the range that contains the source position in the compiled code.
|
259
|
+
const endLine = index < mappings.length ? mappings[index].lineNumber : 2 ** 31 - 1;
|
260
|
+
const endColumn = index < mappings.length ? mappings[index].columnNumber : 2 ** 31 - 1;
|
261
|
+
const range = new TextUtils.TextRange.TextRange(
|
262
|
+
mappings[index - 1].lineNumber, mappings[index - 1].columnNumber, endLine, endColumn);
|
263
|
+
|
264
|
+
// Now try to find the corresponding token in the original code.
|
265
|
+
const reverseMappings = this.reversedMappings(sourceURL);
|
266
|
+
const startSourceLine = mappings[index - 1].sourceLineNumber;
|
267
|
+
const startSourceColumn = mappings[index - 1].sourceColumnNumber;
|
268
|
+
const endReverseIndex = Platform.ArrayUtilities.upperBound(
|
269
|
+
reverseMappings, undefined,
|
270
|
+
(unused, i) =>
|
271
|
+
startSourceLine - mappings[i].sourceLineNumber || startSourceColumn - mappings[i].sourceColumnNumber);
|
272
|
+
if (!endReverseIndex) {
|
273
|
+
return null;
|
274
|
+
}
|
275
|
+
const endSourceLine = endReverseIndex < reverseMappings.length ?
|
276
|
+
mappings[reverseMappings[endReverseIndex]].sourceLineNumber :
|
277
|
+
2 ** 31 - 1;
|
278
|
+
const endSourceColumn = endReverseIndex < reverseMappings.length ?
|
279
|
+
mappings[reverseMappings[endReverseIndex]].sourceColumnNumber :
|
280
|
+
2 ** 31 - 1;
|
281
|
+
|
282
|
+
const sourceRange =
|
283
|
+
new TextUtils.TextRange.TextRange(startSourceLine, startSourceColumn, endSourceLine, endSourceColumn);
|
284
|
+
return {range, sourceRange, sourceURL};
|
285
|
+
}
|
286
|
+
|
236
287
|
sourceLineMapping(sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number):
|
237
288
|
SourceMapEntry|null {
|
238
289
|
const mappings = this.mappings();
|
@@ -315,42 +366,53 @@ export class TextSourceMap implements SourceMap {
|
|
315
366
|
}
|
316
367
|
|
317
368
|
mappings(): SourceMapEntry[] {
|
369
|
+
this.#ensureMappingsProcessed();
|
370
|
+
return this.#mappingsInternal ?? [];
|
371
|
+
}
|
372
|
+
|
373
|
+
private reversedMappings(sourceURL: Platform.DevToolsPath.UrlString): number[] {
|
374
|
+
this.#ensureMappingsProcessed();
|
375
|
+
return this.#sourceInfos.get(sourceURL)?.reverseMappings ?? [];
|
376
|
+
}
|
377
|
+
|
378
|
+
#ensureMappingsProcessed(): void {
|
318
379
|
if (this.#mappingsInternal === null) {
|
319
380
|
this.#mappingsInternal = [];
|
320
381
|
this.eachSection(this.parseMap.bind(this));
|
382
|
+
this.#computeReverseMappings(this.#mappingsInternal);
|
321
383
|
this.#json = null;
|
322
384
|
}
|
323
|
-
return this.#mappingsInternal;
|
324
385
|
}
|
325
386
|
|
326
|
-
|
327
|
-
const
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
387
|
+
#computeReverseMappings(mappings: SourceMapEntry[]): void {
|
388
|
+
const reverseMappingsPerUrl = new Map<Platform.DevToolsPath.UrlString, number[]>();
|
389
|
+
for (let i = 0; i < mappings.length; i++) {
|
390
|
+
const entryUrl = mappings[i].sourceURL;
|
391
|
+
if (!entryUrl) {
|
392
|
+
continue;
|
393
|
+
}
|
394
|
+
let reverseMap = reverseMappingsPerUrl.get(entryUrl);
|
395
|
+
if (!reverseMap) {
|
396
|
+
reverseMap = [];
|
397
|
+
reverseMappingsPerUrl.set(entryUrl, reverseMap);
|
398
|
+
}
|
399
|
+
reverseMap.push(i);
|
335
400
|
}
|
336
401
|
|
337
|
-
|
402
|
+
for (const [url, reverseMap] of reverseMappingsPerUrl.entries()) {
|
403
|
+
const info = this.#sourceInfos.get(url);
|
404
|
+
if (!info) {
|
405
|
+
continue;
|
406
|
+
}
|
407
|
+
reverseMap.sort(sourceMappingComparator);
|
408
|
+
info.reverseMappings = reverseMap;
|
409
|
+
}
|
338
410
|
|
339
411
|
function sourceMappingComparator(indexA: number, indexB: number): number {
|
340
412
|
const a = mappings[indexA];
|
341
413
|
const b = mappings[indexB];
|
342
|
-
|
343
|
-
|
344
|
-
}
|
345
|
-
if (a.sourceColumnNumber !== b.sourceColumnNumber) {
|
346
|
-
return a.sourceColumnNumber - b.sourceColumnNumber;
|
347
|
-
}
|
348
|
-
|
349
|
-
if (a.lineNumber !== b.lineNumber) {
|
350
|
-
return a.lineNumber - b.lineNumber;
|
351
|
-
}
|
352
|
-
|
353
|
-
return a.columnNumber - b.columnNumber;
|
414
|
+
return a.sourceLineNumber - b.sourceLineNumber || a.sourceColumnNumber - b.sourceColumnNumber ||
|
415
|
+
a.lineNumber - b.lineNumber || a.columnNumber - b.columnNumber;
|
354
416
|
}
|
355
417
|
}
|
356
418
|
|
@@ -392,7 +454,7 @@ export class TextSourceMap implements SourceMap {
|
|
392
454
|
if (this.#sourceInfos.has(url)) {
|
393
455
|
continue;
|
394
456
|
}
|
395
|
-
this.#sourceInfos.set(url, new TextSourceMap.SourceInfo(source
|
457
|
+
this.#sourceInfos.set(url, new TextSourceMap.SourceInfo(source ?? null));
|
396
458
|
sourcesList.push(url);
|
397
459
|
}
|
398
460
|
sourceMapToSourceList.set(sourceMap, sourcesList);
|
@@ -560,11 +622,10 @@ export namespace TextSourceMap {
|
|
560
622
|
|
561
623
|
export class SourceInfo {
|
562
624
|
content: string|null;
|
563
|
-
reverseMappings: number[]|null;
|
625
|
+
reverseMappings: number[]|null = null;
|
564
626
|
|
565
|
-
constructor(content: string|null
|
627
|
+
constructor(content: string|null) {
|
566
628
|
this.content = content;
|
567
|
-
this.reverseMappings = reverseMappings;
|
568
629
|
}
|
569
630
|
}
|
570
631
|
}
|
@@ -732,6 +732,7 @@ export function registerCommands(inspectorBackend) {
|
|
732
732
|
inspectorBackend.registerEvent('DOM.documentUpdated', []);
|
733
733
|
inspectorBackend.registerEvent('DOM.inlineStyleInvalidated', ['nodeIds']);
|
734
734
|
inspectorBackend.registerEvent('DOM.pseudoElementAdded', ['parentId', 'pseudoElement']);
|
735
|
+
inspectorBackend.registerEvent('DOM.topLayerElementsUpdated', []);
|
735
736
|
inspectorBackend.registerEvent('DOM.pseudoElementRemoved', ['parentId', 'pseudoElementId']);
|
736
737
|
inspectorBackend.registerEvent('DOM.setChildNodes', ['parentId', 'nodes']);
|
737
738
|
inspectorBackend.registerEvent('DOM.shadowRootPopped', ['hostId', 'rootId']);
|
@@ -875,6 +876,7 @@ export function registerCommands(inspectorBackend) {
|
|
875
876
|
{'name': 'selector', 'type': 'string', 'optional': false}
|
876
877
|
],
|
877
878
|
['nodeIds']);
|
879
|
+
inspectorBackend.registerCommand('DOM.getTopLayerElements', [], ['nodeIds']);
|
878
880
|
inspectorBackend.registerCommand('DOM.redo', [], []);
|
879
881
|
inspectorBackend.registerCommand(
|
880
882
|
'DOM.removeAttribute',
|
@@ -2114,6 +2116,7 @@ export function registerCommands(inspectorBackend) {
|
|
2114
2116
|
EncryptedMedia: 'encrypted-media',
|
2115
2117
|
ExecutionWhileOutOfViewport: 'execution-while-out-of-viewport',
|
2116
2118
|
ExecutionWhileNotRendered: 'execution-while-not-rendered',
|
2119
|
+
FederatedCredentials: 'federated-credentials',
|
2117
2120
|
FocusWithoutUserActivation: 'focus-without-user-activation',
|
2118
2121
|
Fullscreen: 'fullscreen',
|
2119
2122
|
Frobulate: 'frobulate',
|
@@ -2378,7 +2381,7 @@ export function registerCommands(inspectorBackend) {
|
|
2378
2381
|
inspectorBackend.registerEvent('Page.domContentEventFired', ['timestamp']);
|
2379
2382
|
inspectorBackend.registerEnum(
|
2380
2383
|
'Page.FileChooserOpenedEventMode', {SelectSingle: 'selectSingle', SelectMultiple: 'selectMultiple'});
|
2381
|
-
inspectorBackend.registerEvent('Page.fileChooserOpened', ['frameId', '
|
2384
|
+
inspectorBackend.registerEvent('Page.fileChooserOpened', ['frameId', 'mode', 'backendNodeId']);
|
2382
2385
|
inspectorBackend.registerEvent('Page.frameAttached', ['frameId', 'parentFrameId', 'stack', 'adScriptId']);
|
2383
2386
|
inspectorBackend.registerEvent('Page.frameClearedScheduledNavigation', ['frameId']);
|
2384
2387
|
inspectorBackend.registerEnum('Page.FrameDetachedEventReason', {Remove: 'remove', Swap: 'swap'});
|
@@ -3297,9 +3300,10 @@ export function registerCommands(inspectorBackend) {
|
|
3297
3300
|
[
|
3298
3301
|
{'name': 'scriptId', 'type': 'string', 'optional': false},
|
3299
3302
|
{'name': 'scriptSource', 'type': 'string', 'optional': false},
|
3300
|
-
{'name': 'dryRun', 'type': 'boolean', 'optional': true}
|
3303
|
+
{'name': 'dryRun', 'type': 'boolean', 'optional': true},
|
3304
|
+
{'name': 'allowTopFrameEditing', 'type': 'boolean', 'optional': true}
|
3301
3305
|
],
|
3302
|
-
['callFrames', 'stackChanged', 'asyncStackTrace', 'asyncStackTraceId', 'exceptionDetails']);
|
3306
|
+
['callFrames', 'stackChanged', 'asyncStackTrace', 'asyncStackTraceId', 'status', 'exceptionDetails']);
|
3303
3307
|
inspectorBackend.registerCommand(
|
3304
3308
|
'Debugger.setSkipAllPauses', [{'name': 'skip', 'type': 'boolean', 'optional': false}], []);
|
3305
3309
|
inspectorBackend.registerCommand(
|
@@ -124,6 +124,10 @@ export namespace ProtocolMapping {
|
|
124
124
|
* Called when a pseudo element is added to an element.
|
125
125
|
*/
|
126
126
|
'DOM.pseudoElementAdded': [Protocol.DOM.PseudoElementAddedEvent];
|
127
|
+
/**
|
128
|
+
* Called when top layer elements are changed.
|
129
|
+
*/
|
130
|
+
'DOM.topLayerElementsUpdated': [];
|
127
131
|
/**
|
128
132
|
* Called when a pseudo element is removed from an element.
|
129
133
|
*/
|
@@ -1266,6 +1270,12 @@ export namespace ProtocolMapping {
|
|
1266
1270
|
*/
|
1267
1271
|
'DOM.querySelectorAll':
|
1268
1272
|
{paramsType: [Protocol.DOM.QuerySelectorAllRequest]; returnType: Protocol.DOM.QuerySelectorAllResponse;};
|
1273
|
+
/**
|
1274
|
+
* Returns NodeIds of current top layer elements.
|
1275
|
+
* Top layer is rendered closest to the user within a viewport, therefore its elements always
|
1276
|
+
* appear on top of all other content.
|
1277
|
+
*/
|
1278
|
+
'DOM.getTopLayerElements': {paramsType: []; returnType: Protocol.DOM.GetTopLayerElementsResponse;};
|
1269
1279
|
/**
|
1270
1280
|
* Re-does the last undone action.
|
1271
1281
|
*/
|
@@ -2961,6 +2971,12 @@ export namespace ProtocolMapping {
|
|
2961
2971
|
'Debugger.setReturnValue': {paramsType: [Protocol.Debugger.SetReturnValueRequest]; returnType: void;};
|
2962
2972
|
/**
|
2963
2973
|
* Edits JavaScript source live.
|
2974
|
+
*
|
2975
|
+
* In general, functions that are currently on the stack can not be edited with
|
2976
|
+
* a single exception: If the edited function is the top-most stack frame and
|
2977
|
+
* that is the only activation of that function on the stack. In this case
|
2978
|
+
* the live edit will be successful and a `Debugger.restartFrame` for the
|
2979
|
+
* top-most function is automatically triggered.
|
2964
2980
|
*/
|
2965
2981
|
'Debugger.setScriptSource': {
|
2966
2982
|
paramsType: [Protocol.Debugger.SetScriptSourceRequest]; returnType: Protocol.Debugger.SetScriptSourceResponse;
|
@@ -959,6 +959,13 @@ declare namespace ProtocolProxyApi {
|
|
959
959
|
invoke_querySelectorAll(params: Protocol.DOM.QuerySelectorAllRequest):
|
960
960
|
Promise<Protocol.DOM.QuerySelectorAllResponse>;
|
961
961
|
|
962
|
+
/**
|
963
|
+
* Returns NodeIds of current top layer elements.
|
964
|
+
* Top layer is rendered closest to the user within a viewport, therefore its elements always
|
965
|
+
* appear on top of all other content.
|
966
|
+
*/
|
967
|
+
invoke_getTopLayerElements(): Promise<Protocol.DOM.GetTopLayerElementsResponse>;
|
968
|
+
|
962
969
|
/**
|
963
970
|
* Re-does the last undone action.
|
964
971
|
*/
|
@@ -1128,6 +1135,11 @@ declare namespace ProtocolProxyApi {
|
|
1128
1135
|
*/
|
1129
1136
|
pseudoElementAdded(params: Protocol.DOM.PseudoElementAddedEvent): void;
|
1130
1137
|
|
1138
|
+
/**
|
1139
|
+
* Called when top layer elements are changed.
|
1140
|
+
*/
|
1141
|
+
topLayerElementsUpdated(): void;
|
1142
|
+
|
1131
1143
|
/**
|
1132
1144
|
* Called when a pseudo element is removed from an element.
|
1133
1145
|
*/
|
@@ -3785,6 +3797,12 @@ declare namespace ProtocolProxyApi {
|
|
3785
3797
|
|
3786
3798
|
/**
|
3787
3799
|
* Edits JavaScript source live.
|
3800
|
+
*
|
3801
|
+
* In general, functions that are currently on the stack can not be edited with
|
3802
|
+
* a single exception: If the edited function is the top-most stack frame and
|
3803
|
+
* that is the only activation of that function on the stack. In this case
|
3804
|
+
* the live edit will be successful and a `Debugger.restartFrame` for the
|
3805
|
+
* top-most function is automatically triggered.
|
3788
3806
|
*/
|
3789
3807
|
invoke_setScriptSource(params: Protocol.Debugger.SetScriptSourceRequest):
|
3790
3808
|
Promise<Protocol.Debugger.SetScriptSourceResponse>;
|
@@ -3783,6 +3783,13 @@ export namespace DOM {
|
|
3783
3783
|
nodeIds: NodeId[];
|
3784
3784
|
}
|
3785
3785
|
|
3786
|
+
export interface GetTopLayerElementsResponse extends ProtocolResponseWithError {
|
3787
|
+
/**
|
3788
|
+
* NodeIds of top layer elements
|
3789
|
+
*/
|
3790
|
+
nodeIds: NodeId[];
|
3791
|
+
}
|
3792
|
+
|
3786
3793
|
export interface RemoveAttributeRequest {
|
3787
3794
|
/**
|
3788
3795
|
* Id of the element to remove attribute from.
|
@@ -10243,6 +10250,7 @@ export namespace Page {
|
|
10243
10250
|
EncryptedMedia = 'encrypted-media',
|
10244
10251
|
ExecutionWhileOutOfViewport = 'execution-while-out-of-viewport',
|
10245
10252
|
ExecutionWhileNotRendered = 'execution-while-not-rendered',
|
10253
|
+
FederatedCredentials = 'federated-credentials',
|
10246
10254
|
FocusWithoutUserActivation = 'focus-without-user-activation',
|
10247
10255
|
Fullscreen = 'fullscreen',
|
10248
10256
|
Frobulate = 'frobulate',
|
@@ -11772,14 +11780,14 @@ export namespace Page {
|
|
11772
11780
|
* Id of the frame containing input node.
|
11773
11781
|
*/
|
11774
11782
|
frameId: FrameId;
|
11775
|
-
/**
|
11776
|
-
* Input node id.
|
11777
|
-
*/
|
11778
|
-
backendNodeId: DOM.BackendNodeId;
|
11779
11783
|
/**
|
11780
11784
|
* Input mode.
|
11781
11785
|
*/
|
11782
11786
|
mode: FileChooserOpenedEventMode;
|
11787
|
+
/**
|
11788
|
+
* Input node id. Only present for file choosers opened via an <input type="file"> element.
|
11789
|
+
*/
|
11790
|
+
backendNodeId?: DOM.BackendNodeId;
|
11783
11791
|
}
|
11784
11792
|
|
11785
11793
|
/**
|
@@ -15298,6 +15306,13 @@ export namespace Debugger {
|
|
15298
15306
|
newValue: Runtime.CallArgument;
|
15299
15307
|
}
|
15300
15308
|
|
15309
|
+
export const enum SetScriptSourceResponseStatus {
|
15310
|
+
Ok = 'Ok',
|
15311
|
+
CompileError = 'CompileError',
|
15312
|
+
BlockedByActiveGenerator = 'BlockedByActiveGenerator',
|
15313
|
+
BlockedByActiveFunction = 'BlockedByActiveFunction',
|
15314
|
+
}
|
15315
|
+
|
15301
15316
|
export interface SetScriptSourceRequest {
|
15302
15317
|
/**
|
15303
15318
|
* Id of the script to edit.
|
@@ -15312,6 +15327,11 @@ export namespace Debugger {
|
|
15312
15327
|
* description without actually modifying the code.
|
15313
15328
|
*/
|
15314
15329
|
dryRun?: boolean;
|
15330
|
+
/**
|
15331
|
+
* If true, then `scriptSource` is allowed to change the function on top of the stack
|
15332
|
+
* as long as the top-most stack frame is the only activation of that function.
|
15333
|
+
*/
|
15334
|
+
allowTopFrameEditing?: boolean;
|
15315
15335
|
}
|
15316
15336
|
|
15317
15337
|
export interface SetScriptSourceResponse extends ProtocolResponseWithError {
|
@@ -15332,7 +15352,13 @@ export namespace Debugger {
|
|
15332
15352
|
*/
|
15333
15353
|
asyncStackTraceId?: Runtime.StackTraceId;
|
15334
15354
|
/**
|
15335
|
-
*
|
15355
|
+
* Whether the operation was successful or not. Only `Ok` denotes a
|
15356
|
+
* successful live edit while the other enum variants denote why
|
15357
|
+
* the live edit failed.
|
15358
|
+
*/
|
15359
|
+
status: SetScriptSourceResponseStatus;
|
15360
|
+
/**
|
15361
|
+
* Exception details if any. Only present when `status` is `CompileError`.
|
15336
15362
|
*/
|
15337
15363
|
exceptionDetails?: Runtime.ExceptionDetails;
|
15338
15364
|
}
|
@@ -316,12 +316,11 @@ export class ResourceScriptFile extends Common.ObjectWrapper.ObjectWrapper<Resou
|
|
316
316
|
if (!this.scriptInternal) {
|
317
317
|
return;
|
318
318
|
}
|
319
|
-
const debuggerModel = this.#resourceScriptMapping.debuggerModel;
|
320
319
|
const breakpoints = BreakpointManager.instance()
|
321
320
|
.breakpointLocationsForUISourceCode(this.#uiSourceCodeInternal)
|
322
321
|
.map(breakpointLocation => breakpointLocation.breakpoint);
|
323
322
|
const source = this.#uiSourceCodeInternal.workingCopy();
|
324
|
-
|
323
|
+
void this.scriptInternal.editSource(source).then(({error, exceptionDetails}) => {
|
325
324
|
void this.scriptSourceWasSet(source, breakpoints, error, exceptionDetails);
|
326
325
|
});
|
327
326
|
}
|
@@ -1554,19 +1554,6 @@ const emulatedDevices = [
|
|
1554
1554
|
'Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true',
|
1555
1555
|
'type': 'tablet',
|
1556
1556
|
},
|
1557
|
-
{
|
1558
|
-
'show-by-default': false,
|
1559
|
-
'title': 'iPad Mini',
|
1560
|
-
'screen': {
|
1561
|
-
'horizontal': {'width': 1024, 'height': 768},
|
1562
|
-
'device-pixel-ratio': 2,
|
1563
|
-
'vertical': {'width': 768, 'height': 1024},
|
1564
|
-
},
|
1565
|
-
'capabilities': ['touch', 'mobile'],
|
1566
|
-
'user-agent':
|
1567
|
-
'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1',
|
1568
|
-
'type': 'tablet',
|
1569
|
-
},
|
1570
1557
|
{
|
1571
1558
|
'order': 140,
|
1572
1559
|
'show-by-default': false,
|