chrome-devtools-frontend 1.0.1027602 → 1.0.1029149

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 (46) hide show
  1. package/config/gni/devtools_grd_files.gni +5 -5
  2. package/config/gni/devtools_image_files.gni +1 -0
  3. package/front_end/Images/src/clear-warning_icon.svg +99 -0
  4. package/front_end/core/common/WasmDisassembly.ts +6 -1
  5. package/front_end/core/host/ResourceLoader.ts +17 -3
  6. package/front_end/core/i18n/locales/en-US.json +21 -3
  7. package/front_end/core/i18n/locales/en-XL.json +21 -3
  8. package/front_end/core/sdk/DebuggerModel.ts +9 -10
  9. package/front_end/core/sdk/NetworkManager.ts +3 -1
  10. package/front_end/core/sdk/Script.ts +43 -18
  11. package/front_end/core/sdk/SourceMapManager.ts +5 -4
  12. package/front_end/generated/InspectorBackendCommands.js +8 -7
  13. package/front_end/generated/SupportedCSSProperties.js +6 -0
  14. package/front_end/generated/protocol-mapping.d.ts +7 -0
  15. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  16. package/front_end/generated/protocol.ts +52 -6
  17. package/front_end/models/bindings/ContentProviderBasedProject.ts +7 -1
  18. package/front_end/models/issues_manager/AttributionReportingIssue.ts +26 -36
  19. package/front_end/models/issues_manager/DeprecationIssue.ts +16 -2
  20. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +7 -0
  21. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +5 -0
  22. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +5 -0
  23. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +7 -4
  24. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +10 -0
  25. package/front_end/models/javascript_metadata/NativeFunctions.js +7 -2
  26. package/front_end/models/text_utils/ContentProvider.ts +9 -1
  27. package/front_end/panels/application/StorageView.ts +2 -1
  28. package/front_end/panels/application/components/Prerender2.ts +12 -0
  29. package/front_end/panels/console/consoleView.css +0 -4
  30. package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
  31. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +11 -42
  32. package/front_end/panels/network/components/RequestHeadersView.css +7 -0
  33. package/front_end/panels/network/components/RequestHeadersView.ts +102 -21
  34. package/front_end/panels/network/network-meta.ts +16 -0
  35. package/front_end/panels/timeline/TimelineLoader.ts +2 -1
  36. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +25 -7
  37. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +22 -30
  38. package/front_end/ui/legacy/SplitWidget.ts +1 -0
  39. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
  40. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +9 -51
  41. package/package.json +1 -1
  42. package/front_end/models/issues_manager/descriptions/arAttributionSourceUntrustworthyFrameOrigin.md +0 -4
  43. package/front_end/models/issues_manager/descriptions/arAttributionSourceUntrustworthyOrigin.md +0 -5
  44. package/front_end/models/issues_manager/descriptions/arAttributionUntrustworthyFrameOrigin.md +0 -4
  45. package/front_end/models/issues_manager/descriptions/arAttributionUntrustworthyOrigin.md +0 -4
  46. package/front_end/models/issues_manager/descriptions/arInvalidHeader.md +0 -3
@@ -10,6 +10,7 @@ import {assertNotNullOrUndefined} from '../../../core/platform/platform.js';
10
10
  import * as SDK from '../../../core/sdk/sdk.js';
11
11
  import * as Protocol from '../../../generated/protocol.js';
12
12
  import * as IssuesManager from '../../../models/issues_manager/issues_manager.js';
13
+ import * as ClientVariations from '../../../third_party/chromium/client-variations/client-variations.js';
13
14
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
14
15
  import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
15
16
  import * as IconButton from '../../../ui/components/icon_button/icon_button.js';
@@ -23,12 +24,24 @@ const RAW_HEADER_CUTOFF = 3000;
23
24
  const {render, html} = LitHtml;
24
25
 
25
26
  const UIStrings = {
27
+ /**
28
+ *@description Comment used in decoded X-Client-Data HTTP header output in Headers View of the Network panel
29
+ */
30
+ activeClientExperimentVariation: 'Active `client experiment variation IDs`.',
31
+ /**
32
+ *@description Comment used in decoded X-Client-Data HTTP header output in Headers View of the Network panel
33
+ */
34
+ activeClientExperimentVariationIds: 'Active `client experiment variation IDs` that trigger server-side behavior.',
26
35
  /**
27
36
  *@description Text in Headers View of the Network panel
28
37
  */
29
38
  chooseThisOptionIfTheResourceAnd:
30
39
  'Choose this option if the resource and the document are served from the same site.',
31
40
  /**
41
+ *@description Text in Headers View of the Network panel for X-Client-Data HTTP headers
42
+ */
43
+ decoded: 'Decoded:',
44
+ /**
32
45
  *@description Text in Request Headers View of the Network panel
33
46
  */
34
47
  fromDiskCache: '(from disk cache)',
@@ -247,6 +260,18 @@ export class RequestHeadersComponent extends HTMLElement {
247
260
 
248
261
  const mergedHeaders = mergeHeadersWithIssues(this.#request.sortedResponseHeaders.slice(), headersWithIssues);
249
262
 
263
+ const blockedResponseCookies = this.#request.blockedResponseCookies();
264
+ const blockedCookieLineToReasons = new Map<string, Protocol.Network.SetCookieBlockedReason[]>(
265
+ blockedResponseCookies?.map(c => [c.cookieLine, c.blockedReasons]));
266
+ for (const header of mergedHeaders) {
267
+ if (header.name.toLowerCase() === 'set-cookie' && header.value) {
268
+ const matchingBlockedReasons = blockedCookieLineToReasons.get(header.value.toString());
269
+ if (matchingBlockedReasons) {
270
+ header.setCookieBlockedReasons = matchingBlockedReasons;
271
+ }
272
+ }
273
+ }
274
+
250
275
  const toggleShowRaw = (): void => {
251
276
  this.#showResponseHeadersText = !this.#showResponseHeadersText;
252
277
  this.#render();
@@ -271,6 +296,7 @@ export class RequestHeadersComponent extends HTMLElement {
271
296
  `}
272
297
  </${Category.litTagName}>
273
298
  `;
299
+ // clang-format on
274
300
  }
275
301
 
276
302
  #renderRequestHeaders(): LitHtml.TemplateResult {
@@ -307,6 +333,7 @@ export class RequestHeadersComponent extends HTMLElement {
307
333
  `}
308
334
  </${Category.litTagName}>
309
335
  `;
336
+ // clang-format on
310
337
  }
311
338
 
312
339
  #maybeRenderProvisionalHeadersWarning(): LitHtml.LitTemplate {
@@ -323,14 +350,16 @@ export class RequestHeadersComponent extends HTMLElement {
323
350
  } else {
324
351
  cautionText = i18nString(UIStrings.provisionalHeadersAreShown);
325
352
  }
353
+ // Disabled until https://crbug.com/1079231 is fixed.
354
+ // clang-format off
326
355
  return html`
327
356
  <div class="call-to-action">
328
357
  <div class="call-to-action-body">
329
358
  <div class="explanation" title=${cautionTitle}>
330
359
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
331
- iconName: 'warning_icon',
332
- width: '12px',
333
- height: '12px',
360
+ iconName: 'clear-warning_icon',
361
+ width: '12px',
362
+ height: '12px',
334
363
  } as IconButton.Icon.IconData}>
335
364
  </${IconButton.Icon.Icon.litTagName}>
336
365
  ${cautionText} <x-link href="https://developer.chrome.com/docs/devtools/network/reference/#provisional-headers" class="link">${i18nString(UIStrings.learnMore)}</x-link>
@@ -338,27 +367,74 @@ export class RequestHeadersComponent extends HTMLElement {
338
367
  </div>
339
368
  </div>
340
369
  `;
370
+ // clang-format on
341
371
  }
342
372
 
343
373
  #renderHeader(header: HeaderDescriptor): LitHtml.TemplateResult {
374
+ // Disabled until https://crbug.com/1079231 is fixed.
375
+ // clang-format off
344
376
  return html`
345
377
  <div class="row">
346
- <div class="header-name">${header.headerNotSet ? html`<div class="header-badge header-badge-text">not-set</div>` : ''}${header.name}:</div>
347
- <div class="header-value ${header.headerValueIncorrect ? 'header-warning' : ''}">${header.value?.toString()||''}</div>
378
+ <div class="header-name">
379
+ ${header.headerNotSet ?
380
+ html`<div class="header-badge header-badge-text">${i18n.i18n.lockedString('not-set')}</div>` :
381
+ LitHtml.nothing
382
+ }${header.name}:
383
+ </div>
384
+ <div class="header-value ${header.headerValueIncorrect ? 'header-warning' : ''}">
385
+ ${header.value?.toString() || ''}
386
+ ${this.#maybeRenderHeaderValueSuffix(header)}
387
+ </div>
348
388
  </div>
349
- ${this.#maybeRenderHeaderDetails(header.details)}
389
+ ${this.#maybeRenderBlockedDetails(header.blockedDetails)}
350
390
  `;
391
+ // clang-format on
392
+ }
393
+
394
+ #maybeRenderHeaderValueSuffix(header: HeaderDescriptor): LitHtml.LitTemplate {
395
+ const headerId = header.name.toLowerCase();
396
+
397
+ if (headerId === 'set-cookie' && header.setCookieBlockedReasons) {
398
+ const titleText =
399
+ header.setCookieBlockedReasons.map(SDK.NetworkRequest.setCookieBlockedReasonToUiString).join('\n');
400
+ // Disabled until https://crbug.com/1079231 is fixed.
401
+ // clang-format off
402
+ return html`
403
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" title=${titleText} .data=${{
404
+ iconName: 'clear-warning_icon',
405
+ width: '12px',
406
+ height: '12px',
407
+ } as IconButton.Icon.IconData}>
408
+ </${IconButton.Icon.Icon.litTagName}>
409
+ `;
410
+ // clang-format on
411
+ }
412
+
413
+ if (headerId === 'x-client-data') {
414
+ const data = ClientVariations.parseClientVariations(header.value?.toString() || '');
415
+ const output = ClientVariations.formatClientVariations(
416
+ data, i18nString(UIStrings.activeClientExperimentVariation),
417
+ i18nString(UIStrings.activeClientExperimentVariationIds));
418
+ return html`
419
+ <div>${i18nString(UIStrings.decoded)}</div>
420
+ <code>${output}</code>
421
+ `;
422
+ }
423
+
424
+ return LitHtml.nothing;
351
425
  }
352
426
 
353
- #maybeRenderHeaderDetails(headerDetails?: HeaderDetailsDescriptor): LitHtml.LitTemplate {
354
- if (!headerDetails) {
427
+ #maybeRenderBlockedDetails(blockedDetails?: BlockedDetailsDescriptor): LitHtml.LitTemplate {
428
+ if (!blockedDetails) {
355
429
  return LitHtml.nothing;
356
430
  }
431
+ // Disabled until https://crbug.com/1079231 is fixed.
432
+ // clang-format off
357
433
  return html`
358
434
  <div class="call-to-action">
359
435
  <div class="call-to-action-body">
360
- <div class="explanation">${headerDetails.explanation()}</div>
361
- ${headerDetails.examples.map(example => html`
436
+ <div class="explanation">${blockedDetails.explanation()}</div>
437
+ ${blockedDetails.examples.map(example => html`
362
438
  <div class="example">
363
439
  <code>${example.codeSnippet}</code>
364
440
  ${example.comment ? html`
@@ -366,13 +442,14 @@ export class RequestHeadersComponent extends HTMLElement {
366
442
  ` : ''}
367
443
  </div>
368
444
  `)}
369
- ${this.#maybeRenderHeaderDetailsLink(headerDetails)}
445
+ ${this.#maybeRenderBlockedDetailsLink(blockedDetails)}
370
446
  </div>
371
447
  </div>
372
448
  `;
449
+ // clang-format on
373
450
  }
374
451
 
375
- #maybeRenderHeaderDetailsLink(headerDetails?: HeaderDetailsDescriptor): LitHtml.LitTemplate {
452
+ #maybeRenderBlockedDetailsLink(blockedDetails?: BlockedDetailsDescriptor): LitHtml.LitTemplate {
376
453
  if (this.#request && IssuesManager.RelatedIssue.hasIssueOfCategory(this.#request, IssuesManager.Issue.IssueCategory.CrossOriginEmbedderPolicy)) {
377
454
  const followLink = (): void => {
378
455
  Host.userMetrics.issuesPanelOpenedFrom(Host.UserMetrics.IssueOpener.LearnMoreLinkCOEP);
@@ -394,9 +471,11 @@ export class RequestHeadersComponent extends HTMLElement {
394
471
  </div>
395
472
  `;
396
473
  }
397
- if (headerDetails?.link) {
474
+ if (blockedDetails?.link) {
475
+ // Disabled until https://crbug.com/1079231 is fixed.
476
+ // clang-format off
398
477
  return html`
399
- <x-link href=${headerDetails.link.url} class="link">
478
+ <x-link href=${blockedDetails.link.url} class="link">
400
479
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
401
480
  iconName: 'link_icon',
402
481
  color: 'var(--color-link)',
@@ -407,6 +486,7 @@ export class RequestHeadersComponent extends HTMLElement {
407
486
  >${i18nString(UIStrings.learnMore)}
408
487
  </x-link>
409
488
  `;
489
+ // clang-format on
410
490
  }
411
491
  return LitHtml.nothing;
412
492
  }
@@ -627,7 +707,7 @@ declare global {
627
707
  }
628
708
  }
629
709
 
630
- interface HeaderDetailsDescriptor {
710
+ interface BlockedDetailsDescriptor {
631
711
  explanation: () => string;
632
712
  examples: Array<{
633
713
  codeSnippet: string,
@@ -642,8 +722,9 @@ interface HeaderDescriptor {
642
722
  name: string;
643
723
  value: Object|null;
644
724
  headerValueIncorrect?: boolean|null;
645
- details?: HeaderDetailsDescriptor;
725
+ blockedDetails?: BlockedDetailsDescriptor;
646
726
  headerNotSet: boolean|null;
727
+ setCookieBlockedReasons?: Protocol.Network.SetCookieBlockedReason[];
647
728
  }
648
729
 
649
730
  const BlockedReasonDetails = new Map<Protocol.Network.BlockedReason, HeaderDescriptor>([
@@ -653,7 +734,7 @@ const BlockedReasonDetails = new Map<Protocol.Network.BlockedReason, HeaderDescr
653
734
  name: 'cross-origin-embedder-policy',
654
735
  value: null,
655
736
  headerValueIncorrect: null,
656
- details: {
737
+ blockedDetails: {
657
738
  explanation: i18nLazyString(UIStrings.toEmbedThisFrameInYourDocument),
658
739
  examples: [{codeSnippet: 'Cross-Origin-Embedder-Policy: require-corp', comment: undefined}],
659
740
  link: {url: 'https://web.dev/coop-coep/'},
@@ -667,7 +748,7 @@ const BlockedReasonDetails = new Map<Protocol.Network.BlockedReason, HeaderDescr
667
748
  name: 'cross-origin-resource-policy',
668
749
  value: null,
669
750
  headerValueIncorrect: null,
670
- details: {
751
+ blockedDetails: {
671
752
  explanation: i18nLazyString(UIStrings.toUseThisResourceFromADifferent),
672
753
  examples: [
673
754
  {
@@ -690,7 +771,7 @@ const BlockedReasonDetails = new Map<Protocol.Network.BlockedReason, HeaderDescr
690
771
  name: 'cross-origin-opener-policy',
691
772
  value: null,
692
773
  headerValueIncorrect: false,
693
- details: {
774
+ blockedDetails: {
694
775
  explanation: i18nLazyString(UIStrings.thisDocumentWasBlockedFrom),
695
776
  examples: [],
696
777
  link: {url: 'https://web.dev/coop-coep/'},
@@ -704,7 +785,7 @@ const BlockedReasonDetails = new Map<Protocol.Network.BlockedReason, HeaderDescr
704
785
  name: 'cross-origin-resource-policy',
705
786
  value: null,
706
787
  headerValueIncorrect: true,
707
- details: {
788
+ blockedDetails: {
708
789
  explanation: i18nLazyString(UIStrings.toUseThisResourceFromADifferentSite),
709
790
  examples: [
710
791
  {
@@ -723,7 +804,7 @@ const BlockedReasonDetails = new Map<Protocol.Network.BlockedReason, HeaderDescr
723
804
  name: 'cross-origin-resource-policy',
724
805
  value: null,
725
806
  headerValueIncorrect: true,
726
- details: {
807
+ blockedDetails: {
727
808
  explanation: i18nLazyString(UIStrings.toUseThisResourceFromADifferentOrigin),
728
809
  examples: [
729
810
  {
@@ -108,6 +108,11 @@ const UIStrings = {
108
108
  *@description Title of a setting under the Network category that can be invoked through the Command Menu
109
109
  */
110
110
  dontGroupNetworkLogItemsByFrame: 'Don\'t group network log items by frame',
111
+ /**
112
+ * @description Label of a checkbox in the DevTools settings UI.
113
+ */
114
+ enableUNCLoading:
115
+ 'Allow `DevTools` to load resources, such as source maps, from Windows Shares via `UNC` paths. Disabled by default for security reasons.',
111
116
  };
112
117
  const str_ = i18n.i18n.registerUIStrings('panels/network/network-meta.ts', UIStrings);
113
118
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
@@ -316,6 +321,17 @@ Common.Settings.registerSettingExtension({
316
321
  ],
317
322
  });
318
323
 
324
+ // While this setting is used by the Network module, we place it under the
325
+ // "sources" category as source map loading is the dominant use case.
326
+ Common.Settings.registerSettingExtension({
327
+ category: Common.Settings.SettingCategory.SOURCES,
328
+ storageType: Common.Settings.SettingStorageType.Synced,
329
+ title: i18nLazyString(UIStrings.enableUNCLoading),
330
+ settingName: 'network.enable-unc-loading',
331
+ settingType: Common.Settings.SettingType.BOOLEAN,
332
+ defaultValue: false,
333
+ });
334
+
319
335
  UI.ViewManager.registerLocationResolver({
320
336
  name: UI.ViewManager.ViewLocationValues.NETWORK_SIDEBAR,
321
337
  category: UI.ViewManager.ViewLocationCategoryValues.NETWORK,
@@ -98,7 +98,8 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream {
98
98
 
99
99
  static loadFromURL(url: Platform.DevToolsPath.UrlString, client: Client): TimelineLoader {
100
100
  const loader = new TimelineLoader(client);
101
- Host.ResourceLoader.loadAsStream(url, null, loader);
101
+ const allowFileUNCPaths = Common.Settings.Settings.instance().moduleSetting('network.enable-unc-loading').get();
102
+ Host.ResourceLoader.loadAsStream(url, null, loader, undefined, allowFileUNCPaths);
102
103
  return loader;
103
104
  }
104
105
 
@@ -111,6 +111,7 @@ type SerializableSettings = {
111
111
  export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelObserver<SDK.RuntimeModel.RuntimeModel> {
112
112
  #paneInstance = LinearMemoryInspectorPaneImpl.instance();
113
113
  #bufferIdToRemoteObject: Map<string, SDK.RemoteObject.RemoteObject> = new Map();
114
+ #bufferIdToHighlightInfo: Map<string, HighlightInfo> = new Map();
114
115
  #settings: Common.Settings.Setting<SerializableSettings>;
115
116
 
116
117
  private constructor() {
@@ -178,6 +179,18 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
178
179
  };
179
180
  }
180
181
 
182
+ getHighlightInfo(bufferId: string): HighlightInfo|undefined {
183
+ return this.#bufferIdToHighlightInfo.get(bufferId);
184
+ }
185
+
186
+ #setHighlightInfo(bufferId: string, highlightInfo: HighlightInfo): void {
187
+ this.#bufferIdToHighlightInfo.set(bufferId, highlightInfo);
188
+ }
189
+
190
+ #resetHighlightInfo(bufferId: string): void {
191
+ this.#bufferIdToHighlightInfo.delete(bufferId);
192
+ }
193
+
181
194
  static async retrieveDWARFMemoryObjectAndAddress(obj: SDK.RemoteObject.RemoteObject):
182
195
  Promise<{obj: SDK.RemoteObject.RemoteObject, address: number}|undefined> {
183
196
  if (obj instanceof Bindings.DebuggerLanguagePlugins.ExtensionRemoteObject) {
@@ -253,8 +266,6 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
253
266
  memoryObj = response.obj;
254
267
  }
255
268
 
256
- const highlightInfo = this.#extractHighlightInfo(obj, memoryAddress);
257
-
258
269
  if (memoryAddress !== undefined) {
259
270
  Host.userMetrics.linearMemoryInspectorTarget(
260
271
  Host.UserMetrics.LinearMemoryInspectorTarget.DWARFInspectableAddress);
@@ -277,9 +288,14 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
277
288
  }
278
289
  const memoryProperty = internalProperties?.find(({name}) => name === '[[WebAssemblyMemory]]');
279
290
  const memory = memoryProperty?.value;
280
-
291
+ const highlightInfo = LinearMemoryInspectorController.extractHighlightInfo(obj, memoryAddress);
292
+ if (highlightInfo !== undefined) {
293
+ this.#setHighlightInfo(id, highlightInfo);
294
+ } else {
295
+ this.#resetHighlightInfo(id);
296
+ }
281
297
  if (this.#bufferIdToRemoteObject.has(id)) {
282
- this.#paneInstance.reveal(id, memoryAddress, highlightInfo);
298
+ this.#paneInstance.reveal(id, memoryAddress);
283
299
  void UI.ViewManager.ViewManager.instance().showView('linear-memory-inspector');
284
300
  return;
285
301
  }
@@ -288,11 +304,11 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
288
304
  this.#bufferIdToRemoteObject.set(id, buffer.object());
289
305
  const arrayBufferWrapper = new RemoteArrayBufferWrapper(buffer);
290
306
 
291
- this.#paneInstance.create(id, title, arrayBufferWrapper, memoryAddress, highlightInfo);
307
+ this.#paneInstance.create(id, title, arrayBufferWrapper, memoryAddress);
292
308
  void UI.ViewManager.ViewManager.instance().showView('linear-memory-inspector');
293
309
  }
294
310
 
295
- #extractHighlightInfo(obj: SDK.RemoteObject.RemoteObject, memoryAddress?: number): HighlightInfo|undefined {
311
+ static extractHighlightInfo(obj: SDK.RemoteObject.RemoteObject, memoryAddress?: number): HighlightInfo|undefined {
296
312
  let highlightInfo;
297
313
  if (obj instanceof Bindings.DebuggerLanguagePlugins.ValueNode) {
298
314
  try {
@@ -311,6 +327,7 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
311
327
  for (const [bufferId, remoteObject] of this.#bufferIdToRemoteObject) {
312
328
  if (model === remoteObject.runtimeModel()) {
313
329
  this.#bufferIdToRemoteObject.delete(bufferId);
330
+ this.#resetHighlightInfo(bufferId);
314
331
  this.#paneInstance.close(bufferId);
315
332
  }
316
333
  }
@@ -320,7 +337,7 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
320
337
  const debuggerModel = event.data;
321
338
  for (const [bufferId, remoteObject] of this.#bufferIdToRemoteObject) {
322
339
  if (debuggerModel.runtimeModel() === remoteObject.runtimeModel()) {
323
- this.#paneInstance.resetHighlightInfo(bufferId);
340
+ this.#resetHighlightInfo(bufferId);
324
341
  this.#paneInstance.refreshView(bufferId);
325
342
  }
326
343
  }
@@ -336,5 +353,6 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
336
353
  remoteObj.release();
337
354
  }
338
355
  this.#bufferIdToRemoteObject.delete(bufferId);
356
+ this.#resetHighlightInfo(bufferId);
339
357
  }
340
358
  }
@@ -84,14 +84,13 @@ export class LinearMemoryInspectorPaneImpl extends Common.ObjectWrapper.eventMix
84
84
  getViewForTabId(tabId: string): LinearMemoryInspectorView {
85
85
  const view = this.#tabIdToInspectorView.get(tabId);
86
86
  if (!view) {
87
- throw new Error(`No linear memory inspector view for given tab id: ${tabId}`);
87
+ throw new Error(`No linear memory inspector view for the given tab id: ${tabId}`);
88
88
  }
89
89
  return view;
90
90
  }
91
91
 
92
- create(tabId: string, title: string, arrayWrapper: LazyUint8Array, address?: number, highlightInfo?: HighlightInfo):
93
- void {
94
- const inspectorView = new LinearMemoryInspectorView(arrayWrapper, address, highlightInfo);
92
+ create(tabId: string, title: string, arrayWrapper: LazyUint8Array, address?: number): void {
93
+ const inspectorView = new LinearMemoryInspectorView(arrayWrapper, address, tabId);
95
94
  this.#tabIdToInspectorView.set(tabId, inspectorView);
96
95
  this.#tabbedPane.appendTab(tabId, title, inspectorView, undefined, false, true);
97
96
  this.#tabbedPane.selectTab(tabId);
@@ -101,15 +100,12 @@ export class LinearMemoryInspectorPaneImpl extends Common.ObjectWrapper.eventMix
101
100
  this.#tabbedPane.closeTab(tabId, false);
102
101
  }
103
102
 
104
- reveal(tabId: string, address?: number, highlightInfo?: HighlightInfo): void {
103
+ reveal(tabId: string, address?: number): void {
105
104
  const view = this.getViewForTabId(tabId);
106
105
 
107
106
  if (address !== undefined) {
108
107
  view.updateAddress(address);
109
108
  }
110
- if (highlightInfo !== undefined) {
111
- view.updateHighlightInfo(highlightInfo);
112
- }
113
109
  this.refreshView(tabId);
114
110
  this.#tabbedPane.selectTab(tabId);
115
111
  }
@@ -119,11 +115,6 @@ export class LinearMemoryInspectorPaneImpl extends Common.ObjectWrapper.eventMix
119
115
  view.refreshData();
120
116
  }
121
117
 
122
- resetHighlightInfo(tabId: string): void {
123
- const view = this.getViewForTabId(tabId);
124
- view.updateHighlightInfo(undefined);
125
- }
126
-
127
118
  #tabClosed(event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void {
128
119
  const {tabId} = event.data;
129
120
  this.#tabIdToInspectorView.delete(tabId);
@@ -142,10 +133,10 @@ export type EventTypes = {
142
133
  class LinearMemoryInspectorView extends UI.Widget.VBox {
143
134
  #memoryWrapper: LazyUint8Array;
144
135
  #address: number;
145
- #highlightInfo?: HighlightInfo;
136
+ #tabId: string;
146
137
  #inspector: LinearMemoryInspector;
147
138
  firstTimeOpen: boolean;
148
- constructor(memoryWrapper: LazyUint8Array, address: number|undefined = 0, highlightInfo?: HighlightInfo) {
139
+ constructor(memoryWrapper: LazyUint8Array, address: number|undefined = 0, tabId: string) {
149
140
  super(false);
150
141
 
151
142
  if (address < 0 || address >= memoryWrapper.length()) {
@@ -154,7 +145,7 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
154
145
 
155
146
  this.#memoryWrapper = memoryWrapper;
156
147
  this.#address = address;
157
- this.#highlightInfo = highlightInfo;
148
+ this.#tabId = tabId;
158
149
  this.#inspector = new LinearMemoryInspector();
159
150
  this.#inspector.addEventListener('memoryrequest', (event: MemoryRequestEvent) => {
160
151
  this.#memoryRequested(event);
@@ -186,18 +177,6 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
186
177
  this.#address = address;
187
178
  }
188
179
 
189
- updateHighlightInfo(highlightInfo?: HighlightInfo): void {
190
- if (highlightInfo !== undefined) {
191
- if (highlightInfo.startAddress < 0 || highlightInfo.startAddress >= this.#memoryWrapper.length()) {
192
- throw new Error('Highlight info start address is out of bounds.');
193
- }
194
- if (highlightInfo.size < 0) {
195
- throw new Error('Highlight size cannot be negative.');
196
- }
197
- }
198
- this.#highlightInfo = highlightInfo;
199
- }
200
-
201
180
  refreshData(): void {
202
181
  void LinearMemoryInspectorController.getMemoryForAddress(this.#memoryWrapper, this.#address).then(({
203
182
  memory,
@@ -221,7 +200,7 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
221
200
  valueTypes,
222
201
  valueTypeModes,
223
202
  endianness,
224
- highlightInfo: this.#highlightInfo,
203
+ highlightInfo: this.#getHighlightInfo(),
225
204
  };
226
205
  });
227
206
  }
@@ -238,8 +217,21 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
238
217
  address: address,
239
218
  memoryOffset: start,
240
219
  outerMemoryLength: this.#memoryWrapper.length(),
241
- highlightInfo: this.#highlightInfo,
220
+ highlightInfo: this.#getHighlightInfo(),
242
221
  };
243
222
  });
244
223
  }
224
+
225
+ #getHighlightInfo(): HighlightInfo|undefined {
226
+ const highlightInfo = LinearMemoryInspectorController.instance().getHighlightInfo(this.#tabId);
227
+ if (highlightInfo !== undefined) {
228
+ if (highlightInfo.startAddress < 0 || highlightInfo.startAddress >= this.#memoryWrapper.length()) {
229
+ throw new Error('Highlight info start address is out of bounds.');
230
+ }
231
+ if (highlightInfo.size <= 0) {
232
+ throw new Error('Highlight size must be a positive number.');
233
+ }
234
+ }
235
+ return highlightInfo;
236
+ }
245
237
  }
@@ -719,6 +719,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
719
719
  }
720
720
 
721
721
  hideDefaultResizer(noSplitter?: boolean): void {
722
+ this.resizerElementInternal.classList.toggle('hidden', Boolean(noSplitter));
722
723
  this.uninstallResizer(this.resizerElementInternal);
723
724
  this.sidebarElementInternal.classList.toggle('no-default-splitter', Boolean(noSplitter));
724
725
  }
@@ -224,7 +224,7 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
224
224
  }
225
225
 
226
226
  const includedWebIdlTypes = webIdlType.includes?.map(className => domPinnedProperties[className]) ?? [];
227
- const includedWebIdlProps = includedWebIdlTypes.flatMap(webIdlType => Object.entries(webIdlType.props ?? {}));
227
+ const includedWebIdlProps = includedWebIdlTypes.flatMap(webIdlType => Object.entries(webIdlType?.props ?? {}));
228
228
  const webIdlProps = {...webIdlType.props, ...Object.fromEntries(includedWebIdlProps)};
229
229
 
230
230
  for (const property of properties) {
@@ -437,6 +437,8 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
437
437
  progressIndicator.setTotalWork(100);
438
438
  this.progressToolbarItem.element.appendChild(progressIndicator.element);
439
439
 
440
+ progressIndicator.setWorked(1);
441
+
440
442
  const deferredContent = await this.lazyContent();
441
443
  let error, content;
442
444
  if (deferredContent.content === null) {
@@ -448,57 +450,13 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
448
450
  const view = new DataView(Common.Base64.decode(deferredContent.content));
449
451
  const decoder = new TextDecoder();
450
452
  this.rawContent = decoder.decode(view, {stream: true});
453
+ } else if ('wasmDisassemblyInfo' in deferredContent && deferredContent.wasmDisassemblyInfo) {
454
+ const {wasmDisassemblyInfo} = deferredContent;
455
+ this.rawContent = CodeMirror.Text.of(wasmDisassemblyInfo.lines);
456
+ this.wasmDisassemblyInternal = wasmDisassemblyInfo;
451
457
  } else {
452
- this.rawContent = deferredContent.content;
453
- }
454
- }
455
-
456
- progressIndicator.setWorked(1);
457
-
458
- if (!error && this.contentType === 'application/wasm') {
459
- const worker = Common.Worker.WorkerWrapper.fromURL(
460
- new URL('../../../../entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.js', import.meta.url));
461
- const promise = new Promise<{
462
- lines: string[],
463
- offsets: number[],
464
- functionBodyOffsets: {
465
- start: number,
466
- end: number,
467
- }[],
468
- }>((resolve, reject) => {
469
- worker.onmessage =
470
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
471
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
472
- ({data}: MessageEvent<any>): void => {
473
- if ('event' in data) {
474
- switch (data.event) {
475
- case 'progress':
476
- progressIndicator.setWorked(data.params.percentage);
477
- break;
478
- }
479
- } else if ('method' in data) {
480
- switch (data.method) {
481
- case 'disassemble':
482
- if ('error' in data) {
483
- reject(data.error);
484
- } else if ('result' in data) {
485
- resolve(data.result);
486
- }
487
- break;
488
- }
489
- }
490
- };
491
- worker.onerror = reject;
492
- });
493
- worker.postMessage({method: 'disassemble', params: {content}});
494
- try {
495
- const {lines, offsets, functionBodyOffsets} = await promise;
496
- this.rawContent = content = CodeMirror.Text.of(lines);
497
- this.wasmDisassemblyInternal = new Common.WasmDisassembly.WasmDisassembly(offsets, functionBodyOffsets);
498
- } catch (e) {
499
- this.rawContent = content = error = e.message;
500
- } finally {
501
- worker.terminate();
458
+ this.rawContent = content;
459
+ this.wasmDisassemblyInternal = null;
502
460
  }
503
461
  }
504
462
 
@@ -514,7 +472,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
514
472
  this.textEditor.editor.setState(this.placeholderEditorState(error));
515
473
  this.prettyToggle.setEnabled(false);
516
474
  } else {
517
- if (this.shouldAutoPrettyPrint && TextUtils.TextUtils.isMinified(content)) {
475
+ if (this.shouldAutoPrettyPrint && TextUtils.TextUtils.isMinified(content || '')) {
518
476
  await this.setPretty(true);
519
477
  } else {
520
478
  await this.setContent(this.rawContent || '');
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
56
  "watch": "vpython third_party/node/node.py --output scripts/watch_build.js"
57
57
  },
58
- "version": "1.0.1027602"
58
+ "version": "1.0.1029149"
59
59
  }
@@ -1,4 +0,0 @@
1
- # Ensure an attribution source triggers in a secure context
2
-
3
- An attribution source event was not recorded because the frame that triggered the event (or the main frame if they
4
- are different) is not trustworthy.
@@ -1,5 +0,0 @@
1
- # Ensure the origins provided in an attribution source are trustworthy
2
-
3
- An attribution source event was not recorded because an untrustworthy origin was specified.
4
- Both, the `attributiondestination` and the `attributionreportto` origins must be
5
- trustworthy.
@@ -1,4 +0,0 @@
1
- # Ensure an attribution triggers in a secure context
2
-
3
- An attribution was not recorded because the frame that triggered the attribution (or the main frame if they
4
- are different) is not trustworthy.
@@ -1,4 +0,0 @@
1
- # Ensure the origin of an attribution-registration request is trustworthy
2
-
3
- An attribution source or trigger was not registered because the origin of the
4
- request was not trustworthy.
@@ -1,3 +0,0 @@
1
- # Ensure that Attribution Reporting API response headers are valid
2
-
3
- This page tries to use the Attribution Reporting API but failed because a response header was invalid.