chrome-devtools-frontend 1.0.1015276 → 1.0.1015822

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.
Files changed (27) hide show
  1. package/config/gni/devtools_grd_files.gni +1 -0
  2. package/front_end/core/common/JavaScriptMetaData.ts +20 -0
  3. package/front_end/core/i18n/locales/en-US.json +3 -3
  4. package/front_end/core/i18n/locales/en-XL.json +3 -3
  5. package/front_end/core/sdk/DOMModel.ts +9 -0
  6. package/front_end/core/sdk/DebuggerModel.ts +0 -28
  7. package/front_end/core/sdk/RemoteObject.ts +15 -0
  8. package/front_end/core/sdk/Script.ts +5 -14
  9. package/front_end/generated/InspectorBackendCommands.js +7 -3
  10. package/front_end/generated/protocol-mapping.d.ts +16 -0
  11. package/front_end/generated/protocol-proxy-api.d.ts +18 -0
  12. package/front_end/generated/protocol.ts +31 -5
  13. package/front_end/models/bindings/ResourceScriptMapping.ts +1 -2
  14. package/front_end/models/emulation/EmulatedDevices.ts +0 -13
  15. package/front_end/models/javascript_metadata/DOMPinnedProperties.ts +784 -3251
  16. package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +3 -0
  17. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -4
  18. package/front_end/models/javascript_metadata/javascript_metadata.ts +3 -0
  19. package/front_end/models/source_map_scopes/NamesResolver.ts +11 -4
  20. package/front_end/panels/elements/ElementsTreeElement.ts +7 -3
  21. package/front_end/panels/lighthouse/lighthouseStartView.css +3 -1
  22. package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -42
  23. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +64 -8
  24. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +93 -9
  25. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +13 -0
  26. package/front_end/ui/legacy/components/object_ui/objectValue.css +1 -4
  27. package/package.json +1 -1
@@ -756,6 +756,7 @@ grd_files_debug_sources = [
756
756
  "front_end/models/issues_manager/SharedArrayBufferIssue.js",
757
757
  "front_end/models/issues_manager/SourceFrameIssuesManager.js",
758
758
  "front_end/models/issues_manager/TrustedWebActivityIssue.js",
759
+ "front_end/models/javascript_metadata/DOMPinnedProperties.js",
759
760
  "front_end/models/javascript_metadata/JavaScriptMetadata.js",
760
761
  "front_end/models/javascript_metadata/NativeFunctions.js",
761
762
  "front_end/models/logs/LogManager.js",
@@ -2,6 +2,26 @@
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
+ export interface DOMPinnedWebIDLProp {
6
+ global?: boolean;
7
+ specs?: number;
8
+ rules?: Array<DOMPinnedWebIDLRule>;
9
+ }
10
+
11
+ export interface DOMPinnedWebIDLType {
12
+ inheritance?: string;
13
+ includes?: Array<string>;
14
+ props?: {
15
+ [PropName: string]: DOMPinnedWebIDLProp,
16
+ };
17
+ rules?: Array<DOMPinnedWebIDLRule>;
18
+ }
19
+
20
+ export interface DOMPinnedWebIDLRule {
21
+ when: string;
22
+ is: string;
23
+ }
24
+
5
25
  export interface JavaScriptMetaData {
6
26
  signaturesForNativeFunction(name: string): string[][]|null;
7
27
 
@@ -9890,9 +9890,6 @@
9890
9890
  "panels/sources/ScopeChainSidebarPane.ts | closureS": {
9891
9891
  "message": "Closure ({PH1})"
9892
9892
  },
9893
- "panels/sources/ScopeChainSidebarPane.ts | couldNotOpenLinearMemory": {
9894
- "message": "Could not open linear memory inspector: failed locating buffer."
9895
- },
9896
9893
  "panels/sources/ScopeChainSidebarPane.ts | exception": {
9897
9894
  "message": "Exception"
9898
9895
  },
@@ -11879,6 +11876,9 @@
11879
11876
  "ui/components/linear_memory_inspector/LinearMemoryInspector.ts | addressHasToBeANumberBetweenSAnd": {
11880
11877
  "message": "Address has to be a number between {PH1} and {PH2}"
11881
11878
  },
11879
+ "ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts | couldNotOpenLinearMemory": {
11880
+ "message": "Could not open linear memory inspector: failed locating buffer."
11881
+ },
11882
11882
  "ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts | noOpenInspections": {
11883
11883
  "message": "No open inspections"
11884
11884
  },
@@ -9890,9 +9890,6 @@
9890
9890
  "panels/sources/ScopeChainSidebarPane.ts | closureS": {
9891
9891
  "message": "Ĉĺôśûŕê ({PH1})"
9892
9892
  },
9893
- "panels/sources/ScopeChainSidebarPane.ts | couldNotOpenLinearMemory": {
9894
- "message": "Ĉóûĺd̂ ńôt́ ôṕêń l̂ín̂éâŕ m̂ém̂ór̂ý îńŝṕêćt̂ór̂: f́âíl̂éd̂ ĺôćât́îńĝ b́ûf́f̂ér̂."
9895
- },
9896
9893
  "panels/sources/ScopeChainSidebarPane.ts | exception": {
9897
9894
  "message": "Êx́ĉép̂t́îón̂"
9898
9895
  },
@@ -11879,6 +11876,9 @@
11879
11876
  "ui/components/linear_memory_inspector/LinearMemoryInspector.ts | addressHasToBeANumberBetweenSAnd": {
11880
11877
  "message": "Âd́d̂ŕêśŝ h́âś t̂ó b̂é â ńûḿb̂ér̂ b́êt́ŵéêń {PH1} âńd̂ {PH2}"
11881
11878
  },
11879
+ "ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts | couldNotOpenLinearMemory": {
11880
+ "message": "Ĉóûĺd̂ ńôt́ ôṕêń l̂ín̂éâŕ m̂ém̂ór̂ý îńŝṕêćt̂ór̂: f́âíl̂éd̂ ĺôćât́îńĝ b́ûf́f̂ér̂."
11881
+ },
11882
11882
  "ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts | noOpenInspections": {
11883
11883
  "message": "N̂ó ôṕêń îńŝṕêćt̂íôńŝ"
11884
11884
  },
@@ -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
  }
@@ -34,6 +34,7 @@
34
34
 
35
35
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
36
36
  import * as Protocol from '../../generated/protocol.js';
37
+ import type {DOMPinnedWebIDLProp, DOMPinnedWebIDLType} from '../common/JavaScriptMetaData.js';
37
38
 
38
39
  import type {DebuggerModel, FunctionDetails} from './DebuggerModel.js';
39
40
  import type {RuntimeModel} from './RuntimeModel.js';
@@ -309,6 +310,8 @@ export class RemoteObject {
309
310
  isNode(): boolean {
310
311
  return false;
311
312
  }
313
+
314
+ webIdl?: RemoteObjectWebIdlTypeMetadata;
312
315
  }
313
316
 
314
317
  export class RemoteObjectImpl extends RemoteObject {
@@ -728,6 +731,8 @@ export class RemoteObjectProperty {
728
731
  getter: RemoteObject|undefined;
729
732
  setter: RemoteObject|undefined;
730
733
 
734
+ webIdl?: RemoteObjectWebIdlPropertyMetadata;
735
+
731
736
  constructor(
732
737
  name: string, value: RemoteObject|null, enumerable?: boolean, writable?: boolean, isOwn?: boolean,
733
738
  wasThrown?: boolean, symbol?: RemoteObject|null, synthetic?: boolean,
@@ -1188,3 +1193,13 @@ export interface GetPropertiesResult {
1188
1193
  properties: RemoteObjectProperty[]|null;
1189
1194
  internalProperties: RemoteObjectProperty[]|null;
1190
1195
  }
1196
+
1197
+ export interface RemoteObjectWebIdlTypeMetadata {
1198
+ info: DOMPinnedWebIDLType;
1199
+ state: Map<string, string>;
1200
+ }
1201
+
1202
+ export interface RemoteObjectWebIdlPropertyMetadata {
1203
+ info: DOMPinnedWebIDLProp;
1204
+ applicable?: boolean;
1205
+ }
@@ -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
- newSource: string,
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
- callback('Script failed to parse');
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
- callback(null);
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
- const needsStepIn = Boolean(response.stackChanged);
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 {
@@ -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', 'backendNodeId', 'mode']);
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
- * Exception details if any.
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
- debuggerModel.setScriptSource(this.scriptInternal.scriptId, source, (error, exceptionDetails) => {
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,