chrome-devtools-frontend 1.0.963960 → 1.0.965611

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 (177) hide show
  1. package/config/gni/devtools_grd_files.gni +6 -0
  2. package/docs/workflows.md +7 -0
  3. package/front_end/core/common/ResolverBase.ts +2 -2
  4. package/front_end/core/i18n/locales/af.json +55 -22
  5. package/front_end/core/i18n/locales/am.json +55 -22
  6. package/front_end/core/i18n/locales/ar.json +55 -22
  7. package/front_end/core/i18n/locales/as.json +55 -22
  8. package/front_end/core/i18n/locales/az.json +55 -22
  9. package/front_end/core/i18n/locales/be.json +55 -22
  10. package/front_end/core/i18n/locales/bg.json +55 -22
  11. package/front_end/core/i18n/locales/bn.json +33 -0
  12. package/front_end/core/i18n/locales/bs.json +53 -20
  13. package/front_end/core/i18n/locales/ca.json +55 -22
  14. package/front_end/core/i18n/locales/cs.json +54 -21
  15. package/front_end/core/i18n/locales/cy.json +55 -22
  16. package/front_end/core/i18n/locales/da.json +54 -21
  17. package/front_end/core/i18n/locales/de.json +55 -22
  18. package/front_end/core/i18n/locales/el.json +55 -22
  19. package/front_end/core/i18n/locales/en-GB.json +33 -0
  20. package/front_end/core/i18n/locales/en-US.json +21 -0
  21. package/front_end/core/i18n/locales/en-XL.json +21 -0
  22. package/front_end/core/i18n/locales/es-419.json +55 -22
  23. package/front_end/core/i18n/locales/es.json +55 -22
  24. package/front_end/core/i18n/locales/et.json +55 -22
  25. package/front_end/core/i18n/locales/eu.json +33 -0
  26. package/front_end/core/i18n/locales/fa.json +56 -23
  27. package/front_end/core/i18n/locales/fi.json +55 -22
  28. package/front_end/core/i18n/locales/fil.json +55 -22
  29. package/front_end/core/i18n/locales/fr-CA.json +55 -22
  30. package/front_end/core/i18n/locales/fr.json +55 -22
  31. package/front_end/core/i18n/locales/gl.json +55 -22
  32. package/front_end/core/i18n/locales/gu.json +33 -0
  33. package/front_end/core/i18n/locales/he.json +55 -22
  34. package/front_end/core/i18n/locales/hi.json +33 -0
  35. package/front_end/core/i18n/locales/hr.json +33 -0
  36. package/front_end/core/i18n/locales/hu.json +55 -22
  37. package/front_end/core/i18n/locales/hy.json +55 -22
  38. package/front_end/core/i18n/locales/id.json +55 -22
  39. package/front_end/core/i18n/locales/is.json +55 -22
  40. package/front_end/core/i18n/locales/it.json +55 -22
  41. package/front_end/core/i18n/locales/ja.json +63 -30
  42. package/front_end/core/i18n/locales/ka.json +55 -22
  43. package/front_end/core/i18n/locales/kk.json +55 -22
  44. package/front_end/core/i18n/locales/km.json +55 -22
  45. package/front_end/core/i18n/locales/kn.json +55 -22
  46. package/front_end/core/i18n/locales/ko.json +55 -22
  47. package/front_end/core/i18n/locales/ky.json +55 -22
  48. package/front_end/core/i18n/locales/lo.json +55 -22
  49. package/front_end/core/i18n/locales/lt.json +55 -22
  50. package/front_end/core/i18n/locales/lv.json +55 -22
  51. package/front_end/core/i18n/locales/mk.json +55 -22
  52. package/front_end/core/i18n/locales/ml.json +33 -0
  53. package/front_end/core/i18n/locales/mn.json +33 -0
  54. package/front_end/core/i18n/locales/mr.json +54 -21
  55. package/front_end/core/i18n/locales/ms.json +55 -22
  56. package/front_end/core/i18n/locales/my.json +55 -22
  57. package/front_end/core/i18n/locales/ne.json +54 -21
  58. package/front_end/core/i18n/locales/nl.json +55 -22
  59. package/front_end/core/i18n/locales/no.json +55 -22
  60. package/front_end/core/i18n/locales/or.json +55 -22
  61. package/front_end/core/i18n/locales/pa.json +55 -22
  62. package/front_end/core/i18n/locales/pl.json +33 -0
  63. package/front_end/core/i18n/locales/pt-PT.json +55 -22
  64. package/front_end/core/i18n/locales/pt.json +55 -22
  65. package/front_end/core/i18n/locales/ro.json +33 -0
  66. package/front_end/core/i18n/locales/ru.json +55 -22
  67. package/front_end/core/i18n/locales/si.json +55 -22
  68. package/front_end/core/i18n/locales/sk.json +55 -22
  69. package/front_end/core/i18n/locales/sl.json +55 -22
  70. package/front_end/core/i18n/locales/sq.json +55 -22
  71. package/front_end/core/i18n/locales/sr-Latn.json +55 -22
  72. package/front_end/core/i18n/locales/sr.json +55 -22
  73. package/front_end/core/i18n/locales/sv.json +55 -22
  74. package/front_end/core/i18n/locales/sw.json +55 -22
  75. package/front_end/core/i18n/locales/ta.json +55 -22
  76. package/front_end/core/i18n/locales/te.json +42 -9
  77. package/front_end/core/i18n/locales/th.json +33 -0
  78. package/front_end/core/i18n/locales/tr.json +55 -22
  79. package/front_end/core/i18n/locales/uk.json +55 -22
  80. package/front_end/core/i18n/locales/ur.json +55 -22
  81. package/front_end/core/i18n/locales/uz.json +55 -22
  82. package/front_end/core/i18n/locales/vi.json +54 -21
  83. package/front_end/core/i18n/locales/zh-HK.json +55 -22
  84. package/front_end/core/i18n/locales/zh-TW.json +54 -21
  85. package/front_end/core/i18n/locales/zh.json +55 -22
  86. package/front_end/core/i18n/locales/zu.json +55 -22
  87. package/front_end/core/sdk/CSSProperty.ts +8 -8
  88. package/front_end/core/sdk/RemoteObject.ts +1 -1
  89. package/front_end/core/sdk/Resource.ts +5 -2
  90. package/front_end/core/sdk/RuntimeModel.ts +10 -0
  91. package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +9 -3
  92. package/front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js +5 -5
  93. package/front_end/models/bindings/ContentProviderBasedProject.ts +2 -3
  94. package/front_end/models/javascript_metadata/NativeFunctions.js +7480 -4147
  95. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
  96. package/front_end/models/workspace/UISourceCode.ts +4 -5
  97. package/front_end/models/workspace/WorkspaceImpl.ts +62 -37
  98. package/front_end/panels/application/ApplicationPanelSidebar.ts +41 -1
  99. package/front_end/panels/application/InterestGroupStorageModel.ts +87 -0
  100. package/front_end/panels/application/InterestGroupStorageView.ts +112 -0
  101. package/front_end/panels/application/InterestGroupTreeElement.ts +61 -0
  102. package/front_end/panels/application/application.ts +4 -0
  103. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +149 -0
  104. package/front_end/panels/application/components/components.ts +2 -0
  105. package/front_end/panels/application/components/interestGroupAccessGrid.css +26 -0
  106. package/front_end/panels/application/interestGroupStorageView.css +13 -0
  107. package/front_end/panels/console/ConsoleViewMessage.ts +33 -6
  108. package/front_end/panels/console/ErrorStackParser.ts +34 -0
  109. package/front_end/panels/emulation/DeviceModeView.ts +6 -2
  110. package/front_end/panels/sources/UISourceCodeFrame.ts +7 -0
  111. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -2
  112. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +954 -885
  113. package/front_end/third_party/lighthouse/locales/ar-XB.json +40 -4
  114. package/front_end/third_party/lighthouse/locales/ar.json +59 -23
  115. package/front_end/third_party/lighthouse/locales/bg.json +40 -4
  116. package/front_end/third_party/lighthouse/locales/ca.json +45 -9
  117. package/front_end/third_party/lighthouse/locales/cs.json +39 -3
  118. package/front_end/third_party/lighthouse/locales/da.json +43 -7
  119. package/front_end/third_party/lighthouse/locales/de.json +42 -6
  120. package/front_end/third_party/lighthouse/locales/el.json +59 -23
  121. package/front_end/third_party/lighthouse/locales/en-GB.json +43 -7
  122. package/front_end/third_party/lighthouse/locales/en-US.json +48 -6
  123. package/front_end/third_party/lighthouse/locales/en-XA.json +40 -4
  124. package/front_end/third_party/lighthouse/locales/en-XL.json +48 -6
  125. package/front_end/third_party/lighthouse/locales/es-419.json +39 -3
  126. package/front_end/third_party/lighthouse/locales/es.json +46 -10
  127. package/front_end/third_party/lighthouse/locales/fi.json +57 -21
  128. package/front_end/third_party/lighthouse/locales/fil.json +40 -4
  129. package/front_end/third_party/lighthouse/locales/fr.json +45 -9
  130. package/front_end/third_party/lighthouse/locales/he.json +41 -5
  131. package/front_end/third_party/lighthouse/locales/hi.json +59 -23
  132. package/front_end/third_party/lighthouse/locales/hr.json +57 -21
  133. package/front_end/third_party/lighthouse/locales/hu.json +39 -3
  134. package/front_end/third_party/lighthouse/locales/id.json +40 -4
  135. package/front_end/third_party/lighthouse/locales/it.json +40 -4
  136. package/front_end/third_party/lighthouse/locales/ja.json +39 -3
  137. package/front_end/third_party/lighthouse/locales/ko.json +40 -4
  138. package/front_end/third_party/lighthouse/locales/lt.json +40 -4
  139. package/front_end/third_party/lighthouse/locales/lv.json +56 -20
  140. package/front_end/third_party/lighthouse/locales/nl.json +40 -4
  141. package/front_end/third_party/lighthouse/locales/no.json +56 -20
  142. package/front_end/third_party/lighthouse/locales/pl.json +56 -20
  143. package/front_end/third_party/lighthouse/locales/pt-PT.json +57 -21
  144. package/front_end/third_party/lighthouse/locales/pt.json +41 -5
  145. package/front_end/third_party/lighthouse/locales/ro.json +39 -3
  146. package/front_end/third_party/lighthouse/locales/ru.json +40 -4
  147. package/front_end/third_party/lighthouse/locales/sk.json +39 -3
  148. package/front_end/third_party/lighthouse/locales/sl.json +39 -3
  149. package/front_end/third_party/lighthouse/locales/sr-Latn.json +40 -4
  150. package/front_end/third_party/lighthouse/locales/sr.json +40 -4
  151. package/front_end/third_party/lighthouse/locales/sv.json +39 -3
  152. package/front_end/third_party/lighthouse/locales/ta.json +47 -11
  153. package/front_end/third_party/lighthouse/locales/te.json +61 -25
  154. package/front_end/third_party/lighthouse/locales/th.json +39 -3
  155. package/front_end/third_party/lighthouse/locales/tr.json +40 -4
  156. package/front_end/third_party/lighthouse/locales/uk.json +40 -4
  157. package/front_end/third_party/lighthouse/locales/vi.json +63 -27
  158. package/front_end/third_party/lighthouse/locales/zh-HK.json +40 -4
  159. package/front_end/third_party/lighthouse/locales/zh-TW.json +45 -9
  160. package/front_end/third_party/lighthouse/locales/zh.json +41 -5
  161. package/front_end/third_party/lighthouse/report/bundle.d.ts +1 -0
  162. package/front_end/third_party/lighthouse/report/bundle.js +23 -11
  163. package/front_end/third_party/lighthouse/report-assets/report-generator.js +1 -1
  164. package/front_end/ui/components/docs/tree_outline/custom-renderers.ts +3 -3
  165. package/front_end/ui/legacy/components/inline_editor/cssLength.css +1 -0
  166. package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +2 -2
  167. package/front_end/ui/legacy/themeColors.css +1 -1
  168. package/package.json +1 -1
  169. package/scripts/build/devtools_plugin.js +103 -0
  170. package/scripts/build/ninja/{rollup.gni → bundle.gni} +2 -2
  171. package/scripts/build/ninja/devtools_entrypoint.gni +8 -8
  172. package/scripts/build/rollup.config.js +3 -93
  173. package/scripts/javascript_natives/helpers.js +211 -0
  174. package/scripts/javascript_natives/index.js +57 -194
  175. package/scripts/javascript_natives/package.json +8 -3
  176. package/scripts/javascript_natives/test.d.ts +9 -0
  177. package/scripts/javascript_natives/tests.js +195 -0
@@ -0,0 +1,149 @@
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as i18n from '../../../core/i18n/i18n.js';
6
+ import * as DataGrid from '../../../ui/components/data_grid/data_grid.js';
7
+ import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
8
+ import * as IconButton from '../../../ui/components/icon_button/icon_button.js';
9
+ import * as LitHtml from '../../../ui/lit-html/lit-html.js';
10
+ import type * as Protocol from '../../../generated/protocol.js';
11
+
12
+ import interestGroupAccessGridStyles from './interestGroupAccessGrid.css.js';
13
+
14
+ const UIStrings = {
15
+ /**
16
+ *@description Hover text for an info icon in the Interest Group Event panel
17
+ */
18
+ allInterestGroupStorageEvents: 'All interest group storage events.',
19
+ /**
20
+ *@description Text in InterestGroupStorage Items View of the Application panel
21
+ */
22
+ eventTime: 'Event Time',
23
+ /**
24
+ *@description Text in InterestGroupStorage Items View of the Application panel
25
+ */
26
+ eventType: 'Access Type',
27
+ /**
28
+ *@description Text in InterestGroupStorage Items View of the Application panel
29
+ */
30
+ groupOwner: 'Owner',
31
+ /**
32
+ *@description Text in InterestGroupStorage Items View of the Application panel
33
+ */
34
+ groupName: 'Name',
35
+ };
36
+ const str_ = i18n.i18n.registerUIStrings('panels/application/components/InterestGroupAccessGrid.ts', UIStrings);
37
+ export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
38
+
39
+ export class InterestGroupAccessGrid extends HTMLElement {
40
+ static readonly litTagName = LitHtml.literal`devtools-interest-group-access-grid`;
41
+ readonly #shadow = this.attachShadow({mode: 'open'});
42
+ #datastores: Array<Protocol.Storage.InterestGroupAccessedEvent> = [];
43
+
44
+ connectedCallback(): void {
45
+ this.#shadow.adoptedStyleSheets = [interestGroupAccessGridStyles];
46
+ this.#render();
47
+ }
48
+
49
+ set data(data: Array<Protocol.Storage.InterestGroupAccessedEvent>) {
50
+ this.#datastores = data;
51
+ this.#render();
52
+ }
53
+
54
+ #render(): void {
55
+ // clang-format off
56
+ LitHtml.render(LitHtml.html`
57
+ <div>
58
+ <span class="heading">Interest Groups</span>
59
+ <${IconButton.Icon.Icon.litTagName} class="info-icon" title=${
60
+ i18nString(UIStrings.allInterestGroupStorageEvents)}
61
+ .data=${
62
+ {iconName: 'ic_info_black_18dp', color: 'var(--color-link)', width: '14px'} as
63
+ IconButton.Icon.IconWithName}>
64
+ </${IconButton.Icon.Icon.litTagName}>
65
+ ${this.#renderGrid()}
66
+ </div>
67
+ `, this.#shadow, {host: this});
68
+ // clang-format on
69
+ }
70
+
71
+ #renderGrid(): LitHtml.TemplateResult {
72
+ const gridData: DataGrid.DataGridController.DataGridControllerData = {
73
+ columns: [
74
+ {
75
+ id: 'event-time',
76
+ title: i18nString(UIStrings.eventTime),
77
+ widthWeighting: 10,
78
+ hideable: false,
79
+ visible: true,
80
+ sortable: true,
81
+ },
82
+ {
83
+ id: 'event-type',
84
+ title: i18nString(UIStrings.eventType),
85
+ widthWeighting: 5,
86
+ hideable: false,
87
+ visible: true,
88
+ sortable: true,
89
+ },
90
+ {
91
+ id: 'event-group-owner',
92
+ title: i18nString(UIStrings.groupOwner),
93
+ widthWeighting: 10,
94
+ hideable: false,
95
+ visible: true,
96
+ sortable: true,
97
+ },
98
+ {
99
+ id: 'event-group-name',
100
+ title: i18nString(UIStrings.groupName),
101
+ widthWeighting: 10,
102
+ hideable: false,
103
+ visible: true,
104
+ sortable: true,
105
+ },
106
+ ],
107
+ rows: this.#buildRows(),
108
+ initialSort: {
109
+ columnId: 'event-time',
110
+ direction: DataGrid.DataGridUtils.SortDirection.ASC,
111
+ },
112
+ };
113
+
114
+ return LitHtml.html`
115
+ <${DataGrid.DataGridController.DataGridController.litTagName} .data=${
116
+ gridData as DataGrid.DataGridController.DataGridControllerData}></${
117
+ DataGrid.DataGridController.DataGridController.litTagName}>
118
+ `;
119
+ }
120
+
121
+ #buildRows(): DataGrid.DataGridUtils.Row[] {
122
+ return this.#datastores.map(event => ({
123
+ cells: [
124
+ {
125
+ columnId: 'event-time',
126
+ value: event.accessTime,
127
+ renderer: this.#renderDateForDataGridCell.bind(this),
128
+ },
129
+ {columnId: 'event-type', value: event.type},
130
+ {columnId: 'event-group-owner', value: event.ownerOrigin},
131
+ {columnId: 'event-group-name', value: event.name},
132
+ ],
133
+ }));
134
+ }
135
+
136
+ #renderDateForDataGridCell(value: DataGrid.DataGridUtils.CellValue): LitHtml.TemplateResult {
137
+ const date = new Date(1e3 * (value as number));
138
+ return LitHtml.html`${date.toLocaleString()}`;
139
+ }
140
+ }
141
+
142
+ ComponentHelpers.CustomElements.defineComponent('devtools-interest-group-access-grid', InterestGroupAccessGrid);
143
+
144
+ declare global {
145
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
146
+ interface HTMLElementTagNameMap {
147
+ 'devtools-interest-group-access-grid': InterestGroupAccessGrid;
148
+ }
149
+ }
@@ -5,6 +5,7 @@
5
5
  import * as BackForwardCacheView from './BackForwardCacheView.js';
6
6
  import * as EndpointsGrid from './EndpointsGrid.js';
7
7
  import * as FrameDetailsView from './FrameDetailsView.js';
8
+ import * as InterestGroupAccessGrid from './InterestGroupAccessGrid.js';
8
9
  import * as OriginTrialTreeView from './OriginTrialTreeView.js';
9
10
  import * as ReportsGrid from './ReportsGrid.js';
10
11
  import * as StackTrace from './StackTrace.js';
@@ -14,6 +15,7 @@ export {
14
15
  BackForwardCacheView,
15
16
  EndpointsGrid,
16
17
  FrameDetailsView,
18
+ InterestGroupAccessGrid,
17
19
  OriginTrialTreeView,
18
20
  ReportsGrid,
19
21
  StackTrace,
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright (c) 2021 The Chromium Authors. All rights reserved.
3
+ * Use of this source code is governed by a BSD-style license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+ :host {
7
+ padding: 20px;
8
+ }
9
+
10
+ .heading {
11
+ font-size: 15px;
12
+ }
13
+
14
+ devtools-data-grid-controller {
15
+ border: 1px solid var(--color-details-hairline);
16
+ margin-top: 20px;
17
+ }
18
+
19
+ .info-icon {
20
+ vertical-align: text-bottom;
21
+ height: 14px;
22
+ }
23
+
24
+ .no-tt-message {
25
+ margin-top: 20px;
26
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Copyright 2021 The Chromium Authors. All rights reserved.
3
+ * Use of this source code is governed by a BSD-style license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ .placeholder {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ font-size: 13px;
12
+ color: var(--color-text-secondary);
13
+ }
@@ -56,7 +56,7 @@ import type {Chrome} from '../../../extension-api/ExtensionAPI.js'; // eslint-di
56
56
  import {format} from './ConsoleFormat.js';
57
57
  import type {ConsoleViewportElement} from './ConsoleViewport.js';
58
58
  import consoleViewStyles from './consoleView.css.js';
59
- import {parseSourcePositionsFromErrorStack} from './ErrorStackParser.js';
59
+ import {augmentErrorStackWithScriptIds, parseSourcePositionsFromErrorStack} from './ErrorStackParser.js';
60
60
 
61
61
  const UIStrings = {
62
62
  /**
@@ -236,6 +236,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
236
236
  private requestResolver: Logs.RequestResolver.RequestResolver;
237
237
  private issueResolver: IssuesManager.IssueResolver.IssueResolver;
238
238
 
239
+ /** Formatting Error#stack is asynchronous. Allow tests to wait for the result */
240
+ #formatErrorStackPromiseForTest = Promise.resolve();
241
+
239
242
  constructor(
240
243
  consoleMessage: SDK.ConsoleModel.ConsoleMessage, linkifier: Components.Linkifier.Linkifier,
241
244
  requestResolver: Logs.RequestResolver.RequestResolver, issueResolver: IssuesManager.IssueResolver.IssueResolver,
@@ -307,6 +310,10 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
307
310
  return this.message;
308
311
  }
309
312
 
313
+ formatErrorStackPromiseForTest(): Promise<void> {
314
+ return this.#formatErrorStackPromiseForTest;
315
+ }
316
+
310
317
  protected buildMessage(): HTMLElement {
311
318
  let messageElement;
312
319
  let messageText: Common.UIString.LocalizedString|string = this.message.messageText;
@@ -816,11 +823,28 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
816
823
 
817
824
  private formatParameterAsError(output: SDK.RemoteObject.RemoteObject): HTMLElement {
818
825
  const result = document.createElement('span');
819
- const errorSpan = this.tryFormatAsError(output.description || '');
820
- result.appendChild(errorSpan ? errorSpan : this.linkifyStringAsFragment(output.description || ''));
826
+ const errorStack = output.description || '';
827
+
828
+ // Combine the ExceptionDetails for this error object with the parsed Error#stack.
829
+ // The Exceptiondetails include script IDs for stack frames, which allows more accurate
830
+ // linking.
831
+ this.#formatErrorStackPromiseForTest = this.retrieveExceptionDetails(output).then(exceptionDetails => {
832
+ const errorSpan = this.tryFormatAsError(errorStack, exceptionDetails);
833
+ result.appendChild(errorSpan ?? this.linkifyStringAsFragment(errorStack));
834
+ });
835
+
821
836
  return result;
822
837
  }
823
838
 
839
+ private async retrieveExceptionDetails(errorObject: SDK.RemoteObject.RemoteObject):
840
+ Promise<Protocol.Runtime.ExceptionDetails|undefined> {
841
+ const runtimeModel = this.message.runtimeModel();
842
+ if (runtimeModel && errorObject.objectId) {
843
+ return runtimeModel.getExceptionDetails(errorObject.objectId);
844
+ }
845
+ return undefined;
846
+ }
847
+
824
848
  private formatAsArrayEntry(output: SDK.RemoteObject.RemoteObject): HTMLElement {
825
849
  return this.previewFormatter.renderPropertyPreview(
826
850
  output.type, output.subtype, output.className, output.description);
@@ -1422,7 +1446,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1422
1446
  return true;
1423
1447
  }
1424
1448
 
1425
- private tryFormatAsError(string: string): HTMLElement|null {
1449
+ private tryFormatAsError(string: string, exceptionDetails?: Protocol.Runtime.ExceptionDetails): HTMLElement|null {
1426
1450
  const runtimeModel = this.message.runtimeModel();
1427
1451
  if (!runtimeModel) {
1428
1452
  return null;
@@ -1432,6 +1456,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1432
1456
  if (!linkInfos?.length) {
1433
1457
  return null;
1434
1458
  }
1459
+ if (exceptionDetails?.stackTrace) {
1460
+ augmentErrorStackWithScriptIds(linkInfos, exceptionDetails.stackTrace);
1461
+ }
1435
1462
 
1436
1463
  const debuggerModel = runtimeModel.debuggerModel();
1437
1464
  const formattedResult = document.createElement('span');
@@ -1447,8 +1474,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1447
1474
  const suffix = `${line.substring(link.positionRight)}${newline}`;
1448
1475
 
1449
1476
  formattedLine.appendChild(this.linkifyStringAsFragment(prefix));
1450
- const scriptLocationLink =
1451
- this.linkifier.linkifyScriptLocation(debuggerModel.target(), null, link.url, link.lineNumber, {
1477
+ const scriptLocationLink = this.linkifier.linkifyScriptLocation(
1478
+ debuggerModel.target(), link.scriptId || null, link.url, link.lineNumber, {
1452
1479
  columnNumber: link.columnNumber,
1453
1480
  className: undefined,
1454
1481
  tabStop: undefined,
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import type * as SDK from '../../core/sdk/sdk.js';
7
+ import type * as Protocol from '../../generated/protocol.js';
7
8
 
8
9
  export interface ParsedErrorFrame {
9
10
  line: string;
@@ -11,6 +12,7 @@ export interface ParsedErrorFrame {
11
12
  url: string,
12
13
  lineNumber?: number,
13
14
  columnNumber?: number, enclosedInBraces: boolean, positionLeft: number, positionRight: number,
15
+ scriptId?: Protocol.Runtime.ScriptId,
14
16
  };
15
17
  }
16
18
 
@@ -115,3 +117,35 @@ function parseOrScriptMatch(debuggerModel: SDK.DebuggerModel.DebuggerModel, url:
115
117
  }
116
118
  return null;
117
119
  }
120
+
121
+ /**
122
+ * Error#stack output only contains script URLs. In some cases we are able to
123
+ * retrieve additional exception details from V8 that we can use to augment
124
+ * the parsed Error#stack with script IDs.
125
+ * This function sets the `scriptId` field in `ParsedErrorFrame` when it finds
126
+ * the corresponding info in `Protocol.Runtime.StackTrace`.
127
+ */
128
+ export function augmentErrorStackWithScriptIds(
129
+ parsedFrames: ParsedErrorFrame[], protocolStackTrace: Protocol.Runtime.StackTrace): void {
130
+ // Note that the number of frames between the two stack traces can differ. The
131
+ // parsed Error#stack can contain Builtin frames which are not present in the protocol
132
+ // stack. This means its easier to always search the whole protocol stack for a matching
133
+ // frame rather then trying to detect the Builtin frames and skipping them.
134
+ for (const parsedFrame of parsedFrames) {
135
+ const protocolFrame = protocolStackTrace.callFrames.find(frame => framesMatch(parsedFrame, frame));
136
+ if (protocolFrame && parsedFrame.link) {
137
+ parsedFrame.link.scriptId = protocolFrame.scriptId;
138
+ }
139
+ }
140
+ }
141
+
142
+ /** Returns true iff both stack frames have the same url and line/column numbers. The function name is ignored */
143
+ function framesMatch(parsedFrame: ParsedErrorFrame, protocolFrame: Protocol.Runtime.CallFrame): boolean {
144
+ if (!parsedFrame.link) {
145
+ return false;
146
+ }
147
+
148
+ const {url, lineNumber, columnNumber} = parsedFrame.link;
149
+ return url === protocolFrame.url && lineNumber === protocolFrame.lineNumber &&
150
+ columnNumber === protocolFrame.columnNumber;
151
+ }
@@ -467,7 +467,9 @@ export class DeviceModeView extends UI.Widget.VBox {
467
467
 
468
468
  const canvas = document.createElement('canvas');
469
469
  canvas.width = Math.floor(outlineRect.width);
470
- canvas.height = Math.floor(outlineRect.height);
470
+ // Cap the height to not hit the GPU limit.
471
+ // https://crbug.com/1260828
472
+ canvas.height = Math.min((1 << 14), Math.floor(outlineRect.height));
471
473
  const ctx = canvas.getContext('2d');
472
474
  if (!ctx) {
473
475
  throw new Error('Could not get 2d context from canvas.');
@@ -507,7 +509,9 @@ export class DeviceModeView extends UI.Widget.VBox {
507
509
  pageImage.onload = (): void => {
508
510
  const canvas = document.createElement('canvas');
509
511
  canvas.width = pageImage.naturalWidth;
510
- canvas.height = pageImage.naturalHeight;
512
+ // Cap the height to not hit the GPU limit.
513
+ // https://crbug.com/1260828
514
+ canvas.height = Math.min((1 << 14), Math.floor(pageImage.naturalHeight));
511
515
  const ctx = canvas.getContext('2d');
512
516
  if (!ctx) {
513
517
  throw new Error('Could not get 2d context for base64 screenshot.');
@@ -364,9 +364,16 @@ export class UISourceCodeFrame extends
364
364
  this.unloadUISourceCode();
365
365
  this.persistenceBinding = binding;
366
366
  this.initializeUISourceCode();
367
+ this.reloadMessages();
367
368
  this.reloadPlugins();
368
369
  }
369
370
 
371
+ private reloadMessages(): void {
372
+ const messages = [...this.allMessages()];
373
+ const {editor} = this.textEditor;
374
+ editor.dispatch({effects: setRowMessages.of(RowMessages.create(messages))});
375
+ }
376
+
370
377
  private updateStyle(): void {
371
378
  this.setEditable(this.canEditSourceInternal());
372
379
  }
@@ -171,7 +171,7 @@ export class WatchExpressionsSidebarPane extends UI.ThrottledWidget.ThrottledWid
171
171
  this.createWatchExpression(null).startEditing();
172
172
  }
173
173
 
174
- doUpdate(): Promise<void> {
174
+ async doUpdate(): Promise<void> {
175
175
  this.linkifier.reset();
176
176
  this.contentElement.removeChildren();
177
177
  this.treeOutline.removeChildren();
@@ -191,7 +191,6 @@ export class WatchExpressionsSidebarPane extends UI.ThrottledWidget.ThrottledWid
191
191
 
192
192
  this.createWatchExpression(expression);
193
193
  }
194
- return Promise.resolve();
195
194
  }
196
195
 
197
196
  private createWatchExpression(expression: string|null): WatchExpression {