chrome-devtools-frontend 1.0.1021582 → 1.0.1022059

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 (35) hide show
  1. package/.eslintignore +14 -1
  2. package/extension-api/ExtensionAPI.d.ts +54 -4
  3. package/front_end/.eslintrc.js +3 -1
  4. package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
  5. package/front_end/core/host/UserMetrics.ts +18 -0
  6. package/front_end/core/i18n/locales/en-US.json +27 -0
  7. package/front_end/core/i18n/locales/en-XL.json +27 -0
  8. package/front_end/devtools_compatibility.js +1 -0
  9. package/front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js +4 -3
  10. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +157 -117
  11. package/front_end/models/extensions/ExtensionAPI.ts +101 -13
  12. package/front_end/models/extensions/ExtensionServer.ts +63 -1
  13. package/front_end/models/extensions/LanguageExtensionEndpoint.ts +16 -3
  14. package/front_end/models/timeline_model/TimelineModel.ts +164 -7
  15. package/front_end/panels/application/AppManifestView.ts +13 -2
  16. package/front_end/panels/application/ApplicationPanelSidebar.ts +67 -5
  17. package/front_end/panels/elements/ElementsTreeOutline.ts +41 -7
  18. package/front_end/panels/elements/TopLayerContainer.ts +9 -1
  19. package/front_end/panels/elements/components/AdornerManager.ts +7 -0
  20. package/front_end/panels/elements/elementsTreeOutline.css +4 -0
  21. package/front_end/third_party/acorn/acorn.ts +1 -1
  22. package/front_end/third_party/chromium/client-variations/client-variations.ts +1 -1
  23. package/front_end/third_party/diff/DiffWrapper.ts +2 -0
  24. package/front_end/third_party/i18n/i18n-impl.ts +5 -1
  25. package/front_end/third_party/i18n/i18n.ts +1 -1
  26. package/front_end/third_party/i18n/locales.ts +1 -1
  27. package/front_end/third_party/marked/marked.ts +1 -1
  28. package/front_end/third_party/puppeteer/puppeteer.ts +6 -6
  29. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +23 -1
  30. package/front_end/ui/legacy/ReportView.ts +8 -0
  31. package/package.json +1 -1
  32. package/scripts/eslint_rules/lib/custom_element_definitions_location.js +28 -13
  33. package/scripts/eslint_rules/lib/es_modules_import.js +5 -1
  34. package/scripts/eslint_rules/tests/custom_element_definitions_location_test.js +9 -2
  35. package/scripts/eslint_rules/tests/es_modules_import_test.js +5 -0
package/.eslintignore CHANGED
@@ -8,7 +8,20 @@ front_end/diff/diff_match_patch.js
8
8
  front_end/generated/protocol.ts
9
9
  front_end/javascript_metadata/NativeFunctions.js
10
10
  front_end/javascript_metadata/DOMPinnedProperties.ts
11
- front_end/third_party/
11
+
12
+ // Any third_party addition has its source code checked out into
13
+ // third_party/X/package, so we ignore that code as it's not code we author or
14
+ // own.
15
+ front_end/third_party/*/package/
16
+ // Any JS files are also not authored by devtools-frontend, so we ignore those.
17
+ front_end/third_party/**/*.js
18
+ // Lighthouse doesn't have a package/ folder but has other nested folders, so
19
+ // we ignore any folders within the lighthouse directory.
20
+ front_end/third_party/lighthouse/*/
21
+ // The CodeMirror bundle file is auto-generated and rolled-up as part of the
22
+ // install script, so we don't need to lint it.
23
+ front_end/third_party/codemirror.next/bundle.ts
24
+
12
25
  node_modules
13
26
  scripts/migration/**/*.js
14
27
  scripts/protocol_typescript/*.js
@@ -176,6 +176,25 @@ export namespace Chrome {
176
176
  stringifyStep(step: Record<string, any>): Promise<string>;
177
177
  }
178
178
 
179
+ export type RemoteObjectId = string;
180
+ export type RemoteObjectType = 'object'|'undefined'|'string'|'number'|'boolean'|'bigint'|'array'|'null';
181
+
182
+
183
+ export interface RemoteObject {
184
+ type: RemoteObjectType;
185
+ className?: string;
186
+ value?: any;
187
+ description?: string;
188
+ objectId?: RemoteObjectId;
189
+ linearMemoryAddress?: number;
190
+ hasChildren: boolean;
191
+ }
192
+
193
+ export interface PropertyDescriptor {
194
+ name: string;
195
+ value: RemoteObject;
196
+ }
197
+
179
198
  export interface LanguageExtensionPlugin {
180
199
  /**
181
200
  * A new raw module has been loaded. If the raw wasm module references an external debug info module, its URL will be
@@ -210,8 +229,9 @@ export namespace Chrome {
210
229
  removeRawModule(rawModuleId: string): Promise<void>;
211
230
 
212
231
  /**
213
- * Return type information for an expression. The result describes the type (and recursively its member types) of the
214
- * result of the expression if it were evaluated in the given context.
232
+ * DEPRECATED. Return type information for an expression. The result describes the type (and recursively its
233
+ * member types) of the result of the expression if it were evaluated in the given context.
234
+ * TODO(crbug.com/1342848) Remove.
215
235
  */
216
236
  getTypeInfo(expression: string, context: RawLocation): Promise<{
217
237
  typeInfos: Array<TypeInfo>,
@@ -219,7 +239,9 @@ export namespace Chrome {
219
239
  }|null>;
220
240
 
221
241
  /**
222
- * Returns a piece of JavaScript code that, if evaluated, produces a representation of the given expression or field.
242
+ * DEPRECATED. Returns a piece of JavaScript code that, if evaluated, produces a representation of the given
243
+ * expression or field.
244
+ * TODO(crbug.com/1342848) Remove.
223
245
  */
224
246
  getFormatter(
225
247
  expressionOrField: string|{
@@ -231,7 +253,16 @@ export namespace Chrome {
231
253
  }|null>;
232
254
 
233
255
  /**
234
- * Returns a piece of JavaScript code that, if evaluated, produces the address of the given field in the wasm memory.
256
+ * Evaluate a source language expression in the context of a given raw location and a given stopId. stopId is an
257
+ * opaque key that should be passed to the APIs accessing wasm state, e.g., getWasmLinearMemory. A stopId is
258
+ * invalidated once the debugger resumes.
259
+ * TODO(crbug.com/1342848) Make non-optional.
260
+ */
261
+ evaluate?(expression: string, context: RawLocation, stopId: unknown): Promise<RemoteObject|null>;
262
+
263
+ /**
264
+ * DEPRECATED. Returns a piece of JavaScript code that, if evaluated, produces the address of the given field in the wasm memory.
265
+ * TODO(crbug.com/1342848) Remove.
235
266
  */
236
267
  getInspectableAddress(field: {
237
268
  base: EvalBase,
@@ -263,6 +294,17 @@ export namespace Chrome {
263
294
  * Retrieve a list of line numbers in a file for which line-to-raw-location mappings exist.
264
295
  */
265
296
  getMappedLines(rawModuleId: string, sourceFileURL: string): Promise<number[]|undefined>;
297
+
298
+ /**
299
+ * Retrieve properties of the remote object identified by the object id.
300
+ * TODO(crbug.com/1342848) Make non-optional.
301
+ */
302
+ getProperties?(objectId: RemoteObjectId): Promise<PropertyDescriptor[]>;
303
+ /**
304
+ * Permanently release the remote object identified by the object id.
305
+ * TODO(crbug.com/1342848) Make non-optional.
306
+ */
307
+ releaseObject?(objectId: RemoteObjectId): Promise<void>;
266
308
  }
267
309
 
268
310
 
@@ -271,11 +313,19 @@ export namespace Chrome {
271
313
  symbol_types: string[];
272
314
  }
273
315
 
316
+ export type WasmValue = {type: 'i32'|'f32'|'f64', value: number}|{type: 'i64', value: bigint}|
317
+ {type: 'v128', value: string};
318
+
274
319
  export interface LanguageExtensions {
275
320
  registerLanguageExtensionPlugin(
276
321
  plugin: LanguageExtensionPlugin, pluginName: string,
277
322
  supportedScriptTypes: SupportedScriptTypes): Promise<void>;
278
323
  unregisterLanguageExtensionPlugin(plugin: LanguageExtensionPlugin): Promise<void>;
324
+
325
+ getWasmLinearMemory(offset: number, length: number, stopId: unknown): Promise<ArrayBuffer>;
326
+ getWasmLocal(local: number, stopId: unknown): Promise<WasmValue>;
327
+ getWasmGlobal(global: number, stopId: unknown): Promise<WasmValue>;
328
+ getWasmOp(op: number, stopId: unknown): Promise<WasmValue>;
279
329
  }
280
330
 
281
331
  export interface RecorderExtensions {
@@ -20,7 +20,9 @@ module.exports = {
20
20
  'rulesdir/l10n_no_locked_or_placeholder_only_phrase': 2,
21
21
  'rulesdir/l10n_no_uistrings_export': 2,
22
22
  'rulesdir/l10n_no_unused_message': 2,
23
- 'rulesdir/custom_element_definitions_location': 2,
23
+ 'rulesdir/custom_element_definitions_location': [2, {
24
+ rootFrontendDirectory: __dirname,
25
+ }],
24
26
  'rulesdir/custom_element_component_definition': 2,
25
27
  },
26
28
  'overrides': [
@@ -376,4 +376,5 @@ export enum EnumeratedHistogram {
376
376
  RecordingReplayStarted = 'DevTools.RecordingReplayStarted',
377
377
  RecordingToggled = 'DevTools.RecordingToggled',
378
378
  StyleTextCopied = 'DevTools.StyleTextCopied',
379
+ ManifestSectionSelected = 'DevTools.ManifestSectionSelected',
379
380
  }
@@ -270,6 +270,13 @@ export class UserMetrics {
270
270
  InspectorFrontendHostInstance.recordEnumeratedHistogram(
271
271
  EnumeratedHistogram.StyleTextCopied, value, StyleTextCopied.MaxValue);
272
272
  }
273
+
274
+ manifestSectionSelected(sectionTitle: string): void {
275
+ const code =
276
+ ManifestSectionCodes[sectionTitle as keyof typeof ManifestSectionCodes] || ManifestSectionCodes.OtherSection;
277
+ InspectorFrontendHostInstance.recordEnumeratedHistogram(
278
+ EnumeratedHistogram.ManifestSectionSelected, code, ManifestSectionCodes.MaxValue);
279
+ }
273
280
  }
274
281
 
275
282
  /**
@@ -972,4 +979,15 @@ export enum StyleTextCopied {
972
979
  MaxValue = 11,
973
980
  }
974
981
 
982
+ // TODO(crbug.com/1167717): Make this a const enum again
983
+ // eslint-disable-next-line rulesdir/const_enum
984
+ export enum ManifestSectionCodes {
985
+ OtherSection = 0,
986
+ 'Identity' = 1,
987
+ 'Presentation' = 2,
988
+ 'Protocol Handlers' = 3,
989
+ 'Icons' = 4,
990
+ MaxValue = 5,
991
+ }
992
+
975
993
  /* eslint-enable @typescript-eslint/naming-convention */
@@ -1679,12 +1679,30 @@
1679
1679
  "models/timeline_model/TimelineJSProfile.ts | threadS": {
1680
1680
  "message": "Thread {PH1}"
1681
1681
  },
1682
+ "models/timeline_model/TimelineModel.ts | bidderWorklet": {
1683
+ "message": "Bidder Worklet"
1684
+ },
1685
+ "models/timeline_model/TimelineModel.ts | bidderWorkletS": {
1686
+ "message": "Bidder Worklet — {PH1}"
1687
+ },
1682
1688
  "models/timeline_model/TimelineModel.ts | dedicatedWorker": {
1683
1689
  "message": "Dedicated Worker"
1684
1690
  },
1691
+ "models/timeline_model/TimelineModel.ts | sellerWorklet": {
1692
+ "message": "Seller Worklet"
1693
+ },
1694
+ "models/timeline_model/TimelineModel.ts | sellerWorkletS": {
1695
+ "message": "Seller Worklet — {PH1}"
1696
+ },
1685
1697
  "models/timeline_model/TimelineModel.ts | threadS": {
1686
1698
  "message": "Thread {PH1}"
1687
1699
  },
1700
+ "models/timeline_model/TimelineModel.ts | unknownWorklet": {
1701
+ "message": "Auction Worklet"
1702
+ },
1703
+ "models/timeline_model/TimelineModel.ts | unknownWorkletS": {
1704
+ "message": "Auction Worklet — {PH1}"
1705
+ },
1688
1706
  "models/timeline_model/TimelineModel.ts | workerS": {
1689
1707
  "message": "Worker — {PH1}"
1690
1708
  },
@@ -2207,6 +2225,9 @@
2207
2225
  "panels/application/ApplicationPanelSidebar.ts | backgroundServices": {
2208
2226
  "message": "Background Services"
2209
2227
  },
2228
+ "panels/application/ApplicationPanelSidebar.ts | beforeInvokeAlert": {
2229
+ "message": "{PH1}: Invoke to scroll to this section in manifest"
2230
+ },
2210
2231
  "panels/application/ApplicationPanelSidebar.ts | cache": {
2211
2232
  "message": "Cache"
2212
2233
  },
@@ -2240,6 +2261,12 @@
2240
2261
  "panels/application/ApplicationPanelSidebar.ts | manifest": {
2241
2262
  "message": "Manifest"
2242
2263
  },
2264
+ "panels/application/ApplicationPanelSidebar.ts | onInvokeAlert": {
2265
+ "message": "Scrolled to {PH1}"
2266
+ },
2267
+ "panels/application/ApplicationPanelSidebar.ts | onInvokeManifestAlert": {
2268
+ "message": "Manifest: Invoke to scroll to the top of manifest"
2269
+ },
2243
2270
  "panels/application/ApplicationPanelSidebar.ts | openedWindows": {
2244
2271
  "message": "Opened Windows"
2245
2272
  },
@@ -1679,12 +1679,30 @@
1679
1679
  "models/timeline_model/TimelineJSProfile.ts | threadS": {
1680
1680
  "message": "T̂h́r̂éâd́ {PH1}"
1681
1681
  },
1682
+ "models/timeline_model/TimelineModel.ts | bidderWorklet": {
1683
+ "message": "B̂íd̂d́êŕ Ŵór̂ḱl̂ét̂"
1684
+ },
1685
+ "models/timeline_model/TimelineModel.ts | bidderWorkletS": {
1686
+ "message": "B̂íd̂d́êŕ Ŵór̂ḱl̂ét̂ — {PH1}"
1687
+ },
1682
1688
  "models/timeline_model/TimelineModel.ts | dedicatedWorker": {
1683
1689
  "message": "D̂éd̂íĉát̂éd̂ Worker"
1684
1690
  },
1691
+ "models/timeline_model/TimelineModel.ts | sellerWorklet": {
1692
+ "message": "Ŝél̂ĺêŕ Ŵór̂ḱl̂ét̂"
1693
+ },
1694
+ "models/timeline_model/TimelineModel.ts | sellerWorkletS": {
1695
+ "message": "Ŝél̂ĺêŕ Ŵór̂ḱl̂ét̂ — {PH1}"
1696
+ },
1685
1697
  "models/timeline_model/TimelineModel.ts | threadS": {
1686
1698
  "message": "T̂h́r̂éâd́ {PH1}"
1687
1699
  },
1700
+ "models/timeline_model/TimelineModel.ts | unknownWorklet": {
1701
+ "message": "Âúĉt́îón̂ Ẃôŕk̂ĺêt́"
1702
+ },
1703
+ "models/timeline_model/TimelineModel.ts | unknownWorkletS": {
1704
+ "message": "Âúĉt́îón̂ Ẃôŕk̂ĺêt́ — {PH1}"
1705
+ },
1688
1706
  "models/timeline_model/TimelineModel.ts | workerS": {
1689
1707
  "message": "Worker — {PH1}"
1690
1708
  },
@@ -2207,6 +2225,9 @@
2207
2225
  "panels/application/ApplicationPanelSidebar.ts | backgroundServices": {
2208
2226
  "message": "B̂áĉḱĝŕôún̂d́ Ŝér̂v́îćêś"
2209
2227
  },
2228
+ "panels/application/ApplicationPanelSidebar.ts | beforeInvokeAlert": {
2229
+ "message": "{PH1}: Îńv̂ók̂é t̂ó ŝćr̂ól̂ĺ t̂ó t̂h́îś ŝéĉt́îón̂ ín̂ ḿâńîf́êśt̂"
2230
+ },
2210
2231
  "panels/application/ApplicationPanelSidebar.ts | cache": {
2211
2232
  "message": "Ĉáĉh́ê"
2212
2233
  },
@@ -2240,6 +2261,12 @@
2240
2261
  "panels/application/ApplicationPanelSidebar.ts | manifest": {
2241
2262
  "message": "M̂án̂íf̂éŝt́"
2242
2263
  },
2264
+ "panels/application/ApplicationPanelSidebar.ts | onInvokeAlert": {
2265
+ "message": "Ŝćr̂ól̂ĺêd́ t̂ó {PH1}"
2266
+ },
2267
+ "panels/application/ApplicationPanelSidebar.ts | onInvokeManifestAlert": {
2268
+ "message": "M̂án̂íf̂éŝt́: Îńv̂ók̂é t̂ó ŝćr̂ól̂ĺ t̂ó t̂h́ê t́ôṕ ôf́ m̂án̂íf̂éŝt́"
2269
+ },
2243
2270
  "panels/application/ApplicationPanelSidebar.ts | openedWindows": {
2244
2271
  "message": "Ôṕêńêd́ Ŵín̂d́ôẃŝ"
2245
2272
  },
@@ -421,6 +421,7 @@
421
421
  RecordingToggled: 'DevTools.RecordingToggled',
422
422
  SyncSetting: 'DevTools.SyncSetting',
423
423
  StyleTextCopied: 'DevTools.StyleTextCopied',
424
+ ManifestSectionSelected: 'DevTools.ManifestSectionSelected',
424
425
  };
425
426
 
426
427
  /**
@@ -355,10 +355,11 @@ SourcesTestRunner.captureStackTraceIntoString = async function(callFrames, async
355
355
 
356
356
  SourcesTestRunner.dumpSourceFrameContents = function(sourceFrame) {
357
357
  TestRunner.addResult('==Source frame contents start==');
358
- const textEditor = sourceFrame.textEditor;
358
+ const {baseDoc} = sourceFrame;
359
359
 
360
- for (let i = 0; i < textEditor.linesCount; ++i) {
361
- TestRunner.addResult(textEditor.line(i));
360
+ for (let i = 1; i <= baseDoc.lines; ++i) {
361
+ const {text} = baseDoc.line(i);
362
+ TestRunner.addResult(text);
362
363
  }
363
364
 
364
365
  TestRunner.addResult('==Source frame contents end==');