chrome-devtools-frontend 1.0.942529 → 1.0.943986

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 (212) hide show
  1. package/WATCHLISTS +1 -1
  2. package/config/gni/all_devtools_files.gni +0 -14
  3. package/config/gni/devtools_grd_files.gni +6 -5
  4. package/front_end/Tests.js +0 -32
  5. package/front_end/core/i18n/locales/af.json +455 -44
  6. package/front_end/core/i18n/locales/am.json +455 -44
  7. package/front_end/core/i18n/locales/ar.json +455 -44
  8. package/front_end/core/i18n/locales/as.json +455 -44
  9. package/front_end/core/i18n/locales/az.json +455 -44
  10. package/front_end/core/i18n/locales/be.json +456 -45
  11. package/front_end/core/i18n/locales/bg.json +455 -44
  12. package/front_end/core/i18n/locales/bn.json +455 -44
  13. package/front_end/core/i18n/locales/bs.json +455 -44
  14. package/front_end/core/i18n/locales/ca.json +457 -46
  15. package/front_end/core/i18n/locales/cs.json +458 -47
  16. package/front_end/core/i18n/locales/cy.json +455 -44
  17. package/front_end/core/i18n/locales/da.json +455 -44
  18. package/front_end/core/i18n/locales/de.json +455 -44
  19. package/front_end/core/i18n/locales/el.json +455 -44
  20. package/front_end/core/i18n/locales/en-GB.json +449 -38
  21. package/front_end/core/i18n/locales/en-US.json +8 -8
  22. package/front_end/core/i18n/locales/en-XL.json +8 -8
  23. package/front_end/core/i18n/locales/es-419.json +455 -44
  24. package/front_end/core/i18n/locales/es.json +455 -44
  25. package/front_end/core/i18n/locales/et.json +455 -44
  26. package/front_end/core/i18n/locales/eu.json +462 -51
  27. package/front_end/core/i18n/locales/fa.json +455 -44
  28. package/front_end/core/i18n/locales/fi.json +455 -44
  29. package/front_end/core/i18n/locales/fil.json +454 -43
  30. package/front_end/core/i18n/locales/fr-CA.json +455 -44
  31. package/front_end/core/i18n/locales/fr.json +456 -45
  32. package/front_end/core/i18n/locales/gl.json +455 -44
  33. package/front_end/core/i18n/locales/gu.json +456 -45
  34. package/front_end/core/i18n/locales/he.json +455 -44
  35. package/front_end/core/i18n/locales/hi.json +455 -44
  36. package/front_end/core/i18n/locales/hr.json +455 -44
  37. package/front_end/core/i18n/locales/hu.json +455 -44
  38. package/front_end/core/i18n/locales/hy.json +455 -44
  39. package/front_end/core/i18n/locales/id.json +455 -44
  40. package/front_end/core/i18n/locales/is.json +455 -44
  41. package/front_end/core/i18n/locales/it.json +502 -91
  42. package/front_end/core/i18n/locales/ja.json +456 -45
  43. package/front_end/core/i18n/locales/ka.json +455 -44
  44. package/front_end/core/i18n/locales/kk.json +456 -45
  45. package/front_end/core/i18n/locales/km.json +455 -44
  46. package/front_end/core/i18n/locales/kn.json +455 -44
  47. package/front_end/core/i18n/locales/ko.json +455 -44
  48. package/front_end/core/i18n/locales/ky.json +456 -45
  49. package/front_end/core/i18n/locales/lo.json +454 -43
  50. package/front_end/core/i18n/locales/lt.json +455 -44
  51. package/front_end/core/i18n/locales/lv.json +458 -47
  52. package/front_end/core/i18n/locales/mk.json +455 -44
  53. package/front_end/core/i18n/locales/ml.json +461 -50
  54. package/front_end/core/i18n/locales/mn.json +455 -44
  55. package/front_end/core/i18n/locales/mr.json +455 -44
  56. package/front_end/core/i18n/locales/ms.json +455 -44
  57. package/front_end/core/i18n/locales/my.json +456 -45
  58. package/front_end/core/i18n/locales/ne.json +456 -45
  59. package/front_end/core/i18n/locales/nl.json +532 -121
  60. package/front_end/core/i18n/locales/no.json +455 -44
  61. package/front_end/core/i18n/locales/or.json +455 -44
  62. package/front_end/core/i18n/locales/pa.json +455 -44
  63. package/front_end/core/i18n/locales/pl.json +455 -44
  64. package/front_end/core/i18n/locales/pt-PT.json +504 -93
  65. package/front_end/core/i18n/locales/pt.json +454 -43
  66. package/front_end/core/i18n/locales/ro.json +455 -44
  67. package/front_end/core/i18n/locales/ru.json +455 -44
  68. package/front_end/core/i18n/locales/si.json +455 -44
  69. package/front_end/core/i18n/locales/sk.json +456 -45
  70. package/front_end/core/i18n/locales/sl.json +455 -44
  71. package/front_end/core/i18n/locales/sq.json +455 -44
  72. package/front_end/core/i18n/locales/sr-Latn.json +455 -44
  73. package/front_end/core/i18n/locales/sr.json +455 -44
  74. package/front_end/core/i18n/locales/sv.json +456 -45
  75. package/front_end/core/i18n/locales/sw.json +455 -44
  76. package/front_end/core/i18n/locales/ta.json +456 -45
  77. package/front_end/core/i18n/locales/te.json +454 -43
  78. package/front_end/core/i18n/locales/th.json +455 -44
  79. package/front_end/core/i18n/locales/tr.json +455 -44
  80. package/front_end/core/i18n/locales/uk.json +455 -44
  81. package/front_end/core/i18n/locales/ur.json +455 -44
  82. package/front_end/core/i18n/locales/uz.json +455 -44
  83. package/front_end/core/i18n/locales/vi.json +455 -44
  84. package/front_end/core/i18n/locales/zh-HK.json +459 -48
  85. package/front_end/core/i18n/locales/zh-TW.json +457 -46
  86. package/front_end/core/i18n/locales/zh.json +460 -49
  87. package/front_end/core/i18n/locales/zu.json +455 -44
  88. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  89. package/front_end/core/sdk/AccessibilityModel.ts +99 -78
  90. package/front_end/core/sdk/CPUProfilerModel.ts +7 -9
  91. package/front_end/core/sdk/ConsoleModel.ts +27 -33
  92. package/front_end/core/sdk/NetworkManager.ts +3 -0
  93. package/front_end/core/sdk/Script.ts +0 -4
  94. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +13 -12
  95. package/front_end/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.ts +1 -1
  96. package/front_end/entrypoints/devtools_app/devtools_app.js +1 -1
  97. package/front_end/entrypoints/devtools_app/devtools_app.json +1 -4
  98. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
  99. package/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.ts +1 -1
  100. package/front_end/entrypoints/inspector/inspector.js +1 -1
  101. package/front_end/entrypoints/inspector/inspector.json +1 -3
  102. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +2 -3
  103. package/front_end/entrypoints/js_app/js_app.js +1 -1
  104. package/front_end/entrypoints/js_app/js_app.json +1 -3
  105. package/front_end/entrypoints/main/MainImpl.ts +2 -2
  106. package/front_end/entrypoints/main/main-meta.ts +1 -2
  107. package/front_end/entrypoints/ndb_app/ndb_app.js +1 -1
  108. package/front_end/entrypoints/node_app/node_app-meta.ts +0 -2
  109. package/front_end/entrypoints/node_app/node_app.js +1 -1
  110. package/front_end/entrypoints/node_app/node_app.json +1 -3
  111. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -1
  112. package/front_end/entrypoints/shell/shell.json +1 -4
  113. package/front_end/entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.ts +1 -1
  114. package/front_end/entrypoints/worker_app/worker_app.js +1 -1
  115. package/front_end/entrypoints/worker_app/worker_app.json +1 -3
  116. package/front_end/generated/InspectorBackendCommands.js +21 -1
  117. package/front_end/generated/protocol-mapping.d.ts +32 -1
  118. package/front_end/generated/protocol-proxy-api.d.ts +36 -2
  119. package/front_end/generated/protocol.d.ts +120 -7
  120. package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +5 -1
  121. package/front_end/models/bindings/DefaultScriptMapping.ts +1 -9
  122. package/front_end/models/bindings/ResourceScriptMapping.ts +3 -11
  123. package/front_end/models/formatter/SourceFormatter.ts +0 -15
  124. package/front_end/models/persistence/persistence-meta.ts +0 -1
  125. package/front_end/panels/accessibility/accessibility-meta.ts +0 -1
  126. package/front_end/panels/animation/animation-meta.ts +0 -1
  127. package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
  128. package/front_end/panels/application/BackForwardCacheStrings.ts +3 -1
  129. package/front_end/panels/application/BackForwardCacheView.ts +26 -26
  130. package/front_end/panels/application/application-meta.ts +0 -1
  131. package/front_end/panels/application/components/stackTraceRow.css +8 -0
  132. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +1 -2
  133. package/front_end/panels/changes/changes-meta.ts +0 -1
  134. package/front_end/panels/console/ConsolePinPane.ts +2 -6
  135. package/front_end/panels/console/ConsoleViewMessage.ts +8 -1
  136. package/front_end/panels/console/console-meta.ts +0 -1
  137. package/front_end/panels/console_counters/console_counters-meta.ts +0 -1
  138. package/front_end/panels/coverage/coverage-meta.ts +0 -1
  139. package/front_end/panels/css_overview/css_overview-meta.ts +0 -1
  140. package/front_end/panels/developer_resources/developer_resources-meta.ts +0 -1
  141. package/front_end/panels/elements/AccessibilityTreeUtils.ts +96 -66
  142. package/front_end/panels/elements/AccessibilityTreeView.ts +76 -125
  143. package/front_end/panels/elements/ElementsPanel.ts +6 -7
  144. package/front_end/panels/elements/elements-meta.ts +0 -1
  145. package/front_end/panels/emulation/emulation-meta.ts +0 -1
  146. package/front_end/panels/help/help-meta.ts +0 -1
  147. package/front_end/panels/input/input-meta.ts +0 -1
  148. package/front_end/panels/issues/issues-meta.ts +0 -1
  149. package/front_end/panels/js_profiler/js_profiler-meta.ts +0 -4
  150. package/front_end/panels/layers/layers-meta.ts +0 -4
  151. package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -1
  152. package/front_end/panels/lighthouse/module.json +0 -3
  153. package/front_end/panels/media/media-meta.ts +0 -1
  154. package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +0 -1
  155. package/front_end/panels/network/network-meta.ts +1 -2
  156. package/front_end/panels/performance_monitor/performance_monitor-meta.ts +0 -1
  157. package/front_end/panels/profiler/CPUProfileView.ts +10 -3
  158. package/front_end/panels/profiler/profiler-meta.ts +0 -3
  159. package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +0 -1
  160. package/front_end/panels/screencast/screencast-meta.ts +0 -4
  161. package/front_end/panels/security/security-meta.ts +0 -1
  162. package/front_end/panels/sensors/sensors-meta.ts +0 -1
  163. package/front_end/panels/settings/emulation/emulation-meta.ts +0 -1
  164. package/front_end/panels/settings/settings-meta.ts +0 -1
  165. package/front_end/panels/sources/Plugin.ts +0 -3
  166. package/front_end/panels/sources/UISourceCodeFrame.ts +23 -49
  167. package/front_end/panels/sources/sources-meta.ts +2 -6
  168. package/front_end/panels/timeline/timeline-meta.ts +2 -9
  169. package/front_end/panels/web_audio/web_audio-meta.ts +0 -1
  170. package/front_end/panels/webauthn/webauthn-meta.ts +0 -1
  171. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  172. package/front_end/third_party/codemirror.next/package.json +1 -1
  173. package/front_end/ui/components/docs/component_docs.ts +14 -0
  174. package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -1
  175. package/front_end/ui/components/docs/toggle_dark_mode.ts +1 -0
  176. package/front_end/ui/components/docs/toggle_fonts.ts +2 -0
  177. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -1
  178. package/front_end/ui/components/linear_memory_inspector/linear_memory_inspector-meta.ts +1 -2
  179. package/front_end/ui/components/tree_outline/TreeOutline.ts +71 -8
  180. package/front_end/ui/components/tree_outline/TreeOutlineUtils.ts +8 -6
  181. package/front_end/ui/legacy/Dialog.ts +8 -3
  182. package/front_end/ui/legacy/SoftContextMenu.ts +1 -1
  183. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  184. package/front_end/ui/legacy/UIUtils.ts +1 -1
  185. package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +1 -2
  186. package/front_end/ui/legacy/components/inline_editor/cssAngle.css +4 -0
  187. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +2 -2
  188. package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -4
  189. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -3
  190. package/front_end/ui/legacy/components/quick_open/quick_open-meta.ts +2 -3
  191. package/front_end/ui/legacy/components/source_frame/FontView.ts +3 -1
  192. package/front_end/ui/legacy/components/source_frame/ImageView.ts +3 -1
  193. package/front_end/ui/legacy/components/source_frame/JSONView.ts +3 -1
  194. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +2 -1
  195. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +6 -6
  196. package/front_end/ui/legacy/components/source_frame/XMLView.ts +5 -2
  197. package/front_end/ui/legacy/textButton.css +5 -4
  198. package/inspector_overlay/css_grid_label_helpers.ts +1 -1
  199. package/inspector_overlay/highlight_common.ts +1 -1
  200. package/inspector_overlay/tool_highlight.ts +1 -1
  201. package/package.json +1 -1
  202. package/scripts/check_gn.js +0 -35
  203. package/scripts/eslint_rules/lib/es_modules_import.js +15 -24
  204. package/scripts/eslint_rules/tests/es_modules_import_test.js +8 -16
  205. package/front_end/emulated_devices/module.json +0 -4
  206. package/front_end/panels/js_profiler/module.json +0 -5
  207. package/front_end/panels/layers/module.json +0 -4
  208. package/front_end/panels/profiler/module.json +0 -3
  209. package/front_end/panels/screencast/module.json +0 -3
  210. package/front_end/panels/timeline/module.json +0 -5
  211. package/front_end/ui/legacy/components/source_frame/messagesPopover.css +0 -32
  212. package/front_end/ui/legacy/components/source_frame/module.json +0 -11
@@ -16,9 +16,10 @@ const UIStrings = {
16
16
  'Back/forward cache is disabled by flags. Visit chrome://flags/#back-forward-cache to enable it locally on this device.',
17
17
  /**
18
18
  * @description Description text for not restored reason RelatedActiveContentsExist.
19
+ * Note: "window.open()" is the name of a JavaScript method and should not be translated.
19
20
  */
20
21
  relatedActiveContentsExist:
21
- 'The page was opened using `window.open()` and another tab has a reference to it, or the page opened a window.',
22
+ 'The page was opened using \'`window.open()`\' and another tab has a reference to it, or the page opened a window.',
22
23
  /**
23
24
  * @description Description text for not restored reason HTTPStatusNotOK.
24
25
  */
@@ -83,6 +84,7 @@ const UIStrings = {
83
84
  sessionRestored: 'Chrome restarted and cleared the back/forward cache entries.',
84
85
  /**
85
86
  * @description Description text for not restored reason ServiceWorkerPostMessage.
87
+ * Note: "MessageEvent" should not be translated.
86
88
  */
87
89
  serviceWorkerPostMessage: 'A service worker attempted to send the page in back/forward cache a `MessageEvent`.',
88
90
  /**
@@ -17,67 +17,67 @@ import backForwardCacheViewStyles from './backForwardCacheView.css.js';
17
17
 
18
18
  const UIStrings = {
19
19
  /**
20
- * @description Title text in Back-Forward Cache view of the Application panel
20
+ * @description Title text in back/forward cache view of the Application panel
21
21
  */
22
22
  mainFrame: 'Main Frame',
23
23
  /**
24
- * @description Title text in Back-Forward Cache view of the Application panel
24
+ * @description Title text in back/forward cache view of the Application panel
25
25
  */
26
- backForwardCacheTitle: 'Back-Forward Cache',
26
+ backForwardCacheTitle: 'Back/forward cache',
27
27
  /**
28
28
  * @description Status text for the status of the main frame
29
29
  */
30
30
  unavailable: 'unavailable',
31
31
  /**
32
- * @description Entry name text in the Back-Forward Cache view of the Application panel
32
+ * @description Entry name text in the back/forward cache view of the Application panel
33
33
  */
34
34
  url: 'URL',
35
35
  /**
36
- * @description Entry name text in the Back-Forward Cache view of the Application panel
36
+ * @description Entry name text in the back/forward cache view of the Application panel
37
37
  */
38
- bfcacheStatus: 'Back-Forward Cache Status',
38
+ bfcacheStatus: 'Back/forward cache Status',
39
39
  /**
40
- * @description Status text for the status of the Back-Forward Cache status
40
+ * @description Status text for the status of the back/forward cache status
41
41
  */
42
42
  unknown: 'unknown',
43
43
  /**
44
- * @description Status text for the status of the Back-Forward Cache status indicating that
45
- * the Back-Forward Cache was not used and a normal navigation occured instead.
44
+ * @description Status text for the status of the back/forward cache status indicating that
45
+ * the back/forward cache was not used and a normal navigation occured instead.
46
46
  */
47
- normalNavigation: 'Normal navigation (Not restored from Back-Forward Cache)',
47
+ normalNavigation: 'Normal navigation (Not restored from back/forward cache)',
48
48
  /**
49
- * @description Status text for the status of the Back-Forward Cache status indicating that
50
- * the Back-Forward Cache was used to restore the page instead of reloading it.
49
+ * @description Status text for the status of the back/forward cache status indicating that
50
+ * the back/forward cache was used to restore the page instead of reloading it.
51
51
  */
52
- restoredFromBFCache: 'Restored from Back-Forward Cache',
52
+ restoredFromBFCache: 'Restored from back/forward cache',
53
53
  /**
54
54
  * @description Label for a list of reasons which prevent the page from being eligible for
55
- * Back-Forward Cache. These reasons are actionable i.e. they can be cleaned up to make the
56
- * page eligible for Back-Forward Cache.
55
+ * back/forward cache. These reasons are actionable i.e. they can be cleaned up to make the
56
+ * page eligible for back/forward cache.
57
57
  */
58
58
  pageSupportNeeded: 'Actionable',
59
59
  /**
60
60
  * @description Explanation for actionable items which prevent the page from being eligible
61
- * for Back-Forward Cache.
61
+ * for back/forward cache.
62
62
  */
63
63
  pageSupportNeededExplanation:
64
- 'These reasons are actionable i.e. they can be cleaned up to make the page eligible for Back-Forward Cache.',
64
+ 'These reasons are actionable i.e. they can be cleaned up to make the page eligible for back/forward cache.',
65
65
  /**
66
66
  * @description Label for a list of reasons which prevent the page from being eligible for
67
- * Back-Forward Cache. These reasons are circumstantial / not actionable i.e. they cannot be
68
- * cleaned up by developers to make the page eligible for Back-Forward Cache.
67
+ * back/forward cache. These reasons are circumstantial / not actionable i.e. they cannot be
68
+ * cleaned up by developers to make the page eligible for back/forward cache.
69
69
  */
70
70
  circumstantial: 'Not Actionable',
71
71
  /**
72
72
  * @description Explanation for circumstantial/non-actionable items which prevent the page from being eligible
73
- * for Back-Forward Cache.
73
+ * for back/forward cache.
74
74
  */
75
75
  circumstantialExplanation:
76
76
  'These reasons are not actionable i.e. caching was prevented by something outside of the direct control of the page.',
77
77
  /**
78
78
  * @description Label for a list of reasons which prevent the page from being eligible for
79
- * Back-Forward Cache. These reasons are pending support by chrome i.e. in a future version
80
- * of chrome they will not prevent Back-Forward Cache usage anymore.
79
+ * back/forward cache. These reasons are pending support by chrome i.e. in a future version
80
+ * of chrome they will not prevent back/forward cache usage anymore.
81
81
  */
82
82
  supportPending: 'Pending Support',
83
83
  /**
@@ -86,10 +86,10 @@ const UIStrings = {
86
86
  runTest: 'Run Test',
87
87
  /**
88
88
  * @description Explanation for 'pending support' items which prevent the page from being eligible
89
- * for Back-Forward Cache.
89
+ * for back/forward cache.
90
90
  */
91
91
  supportPendingExplanation:
92
- 'Chrome support for these reasons is pending i.e. they will not prevent the page from being eligible for Back-Forward Cache in a future version of Chrome.',
92
+ 'Chrome support for these reasons is pending i.e. they will not prevent the page from being eligible for back/forward cache in a future version of Chrome.',
93
93
  };
94
94
  const str_ = i18n.i18n.registerUIStrings('panels/application/BackForwardCacheView.ts', UIStrings);
95
95
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -168,9 +168,9 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
168
168
 
169
169
  // We can know whether the current page can use BFCache
170
170
  // as the browser navigates to another unrelated page and goes back to the current page.
171
- // We chose "chrome://version" because it must be cross-site.
171
+ // We chose "chrome://terms" because it must be cross-site.
172
172
  // Ideally, We want to have our own testing page like "chrome: //bfcache-test".
173
- resourceTreeModel.navigate('chrome://version/');
173
+ resourceTreeModel.navigate('chrome://terms');
174
174
  }
175
175
  }
176
176
 
@@ -6,7 +6,6 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as SDK from '../../core/sdk/sdk.js';
7
7
  import * as UI from '../../ui/legacy/legacy.js';
8
8
 
9
- // eslint-disable-next-line rulesdir/es_modules_import
10
9
  import type * as Resources from './application.js';
11
10
 
12
11
  import * as i18n from '../../core/i18n/i18n.js';
@@ -26,3 +26,11 @@
26
26
  .ignore-list-link {
27
27
  opacity: 60%;
28
28
  }
29
+
30
+ .link,
31
+ .devtools-link {
32
+ color: var(--color-link);
33
+ text-decoration: underline;
34
+ cursor: pointer;
35
+ padding: 2px 0; /* adjust focus ring size */
36
+ }
@@ -4,10 +4,9 @@
4
4
 
5
5
  import * as SDK from '../../core/sdk/sdk.js';
6
6
  import * as UI from '../../ui/legacy/legacy.js';
7
+ import type * as Sources from '../sources/sources.js';
7
8
 
8
- // eslint-disable-next-line rulesdir/es_modules_import
9
9
  import type * as BrowserDebugger from './browser_debugger.js';
10
- import type * as Sources from '../sources/sources.js';
11
10
 
12
11
  import * as i18n from '../../core/i18n/i18n.js';
13
12
  const UIStrings = {
@@ -7,7 +7,6 @@ import * as i18n from '../../core/i18n/i18n.js';
7
7
  import * as WorkspaceDiff from '../../models/workspace_diff/workspace_diff.js';
8
8
  import * as UI from '../../ui/legacy/legacy.js';
9
9
 
10
- // eslint-disable-next-line rulesdir/es_modules_import
11
10
  import type * as Changes from './changes.js';
12
11
 
13
12
  let loadedChangesModule: (typeof Changes|undefined);
@@ -164,8 +164,6 @@ export class ConsolePinPane extends UI.ThrottledWidget.ThrottledWidget {
164
164
  }
165
165
  }
166
166
 
167
- let consolePinNumber = 0;
168
-
169
167
  export class ConsolePin {
170
168
  private readonly pinElement: Element;
171
169
  private readonly pinPreview: HTMLElement;
@@ -175,11 +173,9 @@ export class ConsolePin {
175
173
  private committedExpression: string;
176
174
  private hovered: boolean;
177
175
  private lastNode: SDK.RemoteObject.RemoteObject|null;
178
- private consolePinNumber: number;
179
176
  private deletePinIcon: UI.UIUtils.DevToolsCloseButton;
180
177
 
181
178
  constructor(expression: string, private readonly pinPane: ConsolePinPane, private readonly focusOut: () => void) {
182
- this.consolePinNumber = ++consolePinNumber;
183
179
  this.deletePinIcon = document.createElement('div', {is: 'dt-close-button'}) as UI.UIUtils.DevToolsCloseButton;
184
180
  this.deletePinIcon.gray = true;
185
181
  this.deletePinIcon.classList.add('close-button');
@@ -325,8 +321,8 @@ export class ConsolePin {
325
321
  const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
326
322
  const preprocessedExpression = ObjectUI.JavaScriptREPL.JavaScriptREPL.preprocessExpression(text);
327
323
  const {preview, result} = await ObjectUI.JavaScriptREPL.JavaScriptREPL.evaluateAndBuildPreview(
328
- `${preprocessedExpression}\n//# sourceURL=watch-expression-${this.consolePinNumber}.devtools`,
329
- throwOnSideEffect, false /* replMode */, timeout, !isEditing /* allowErrors */, 'console');
324
+ preprocessedExpression, throwOnSideEffect, false /* replMode */, timeout, !isEditing /* allowErrors */,
325
+ 'console', true /* awaitPromise */);
330
326
  if (this.lastResult && this.lastExecutionContext) {
331
327
  this.lastExecutionContext.runtimeModel.releaseEvaluationResult(this.lastResult);
332
328
  }
@@ -50,9 +50,12 @@ import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
50
50
  import * as Components from '../../ui/legacy/components/utils/utils.js';
51
51
  import * as UI from '../../ui/legacy/legacy.js';
52
52
  import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
53
+ // eslint-disable-next-line rulesdir/es_modules_import
54
+ import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
53
55
  import type {Chrome} from '../../../extension-api/ExtensionAPI.js'; // eslint-disable-line rulesdir/es_modules_import
54
56
 
55
57
  import type {ConsoleViewportElement} from './ConsoleViewport.js';
58
+ import consoleViewStyles from './consoleView.css.js';
56
59
 
57
60
  const UIStrings = {
58
61
  /**
@@ -2067,7 +2070,11 @@ export class ConsoleTableMessageView extends ConsoleViewMessage {
2067
2070
  const tableElement = formattedResult.createChild('div', 'console-message-formatted-table');
2068
2071
  const dataGridContainer = tableElement.createChild('span');
2069
2072
  tableElement.appendChild(this.formatParameter(actualTable, true, false));
2070
- dataGridContainer.appendChild(this.dataGrid.element);
2073
+ const shadowRoot = dataGridContainer.attachShadow({mode: 'open'});
2074
+ const dataGridWidget = this.dataGrid.asWidget();
2075
+ dataGridWidget.markAsRoot();
2076
+ dataGridWidget.show(shadowRoot as unknown as Element);
2077
+ dataGridWidget.registerCSSFiles([consoleViewStyles, objectValueStyles]);
2071
2078
  formattedMessage.appendChild(formattedResult);
2072
2079
  this.dataGrid.renderInline();
2073
2080
  }
@@ -5,7 +5,6 @@
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as UI from '../../ui/legacy/legacy.js';
7
7
 
8
- // eslint-disable-next-line rulesdir/es_modules_import
9
8
  import type * as Console from './console.js';
10
9
 
11
10
  import * as i18n from '../../core/i18n/i18n.js';
@@ -4,7 +4,6 @@
4
4
 
5
5
  import * as UI from '../../ui/legacy/legacy.js';
6
6
 
7
- // eslint-disable-next-line rulesdir/es_modules_import
8
7
  import type * as ConsoleCounters from './console_counters.js';
9
8
 
10
9
  let loadedConsoleCountersModule: (typeof ConsoleCounters|undefined);
@@ -5,7 +5,6 @@
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
6
  import * as UI from '../../ui/legacy/legacy.js';
7
7
 
8
- // eslint-disable-next-line rulesdir/es_modules_import
9
8
  import type * as Coverage from './coverage.js';
10
9
 
11
10
  const UIStrings = {
@@ -5,7 +5,6 @@
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
6
  import * as UI from '../../ui/legacy/legacy.js';
7
7
 
8
- // eslint-disable-next-line rulesdir/es_modules_import
9
8
  import type * as CSSOverview from './css_overview.js';
10
9
 
11
10
  const UIStrings = {
@@ -6,7 +6,6 @@ import * as i18n from '../../core/i18n/i18n.js';
6
6
  import * as Root from '../../core/root/root.js';
7
7
  import * as UI from '../../ui/legacy/legacy.js';
8
8
 
9
- // eslint-disable-next-line rulesdir/es_modules_import
10
9
  import type * as DeveloperResources from './developer_resources.js';
11
10
 
12
11
  const UIStrings = {
@@ -6,87 +6,113 @@ import * as SDK from '../../core/sdk/sdk.js';
6
6
  import type * as TreeOutline from '../../ui/components/tree_outline/tree_outline.js';
7
7
  import * as ElementsComponents from './components/components.js';
8
8
  import * as LitHtml from '../../ui/lit-html/lit-html.js';
9
+ import type * as Protocol from '../../generated/protocol.js';
9
10
 
10
11
  export type AXTreeNodeData = SDK.AccessibilityModel.AccessibilityNode;
11
12
  export type AXTreeNode = TreeOutline.TreeOutlineUtils.TreeNode<AXTreeNodeData>;
12
13
 
13
- export function sdkNodeToAXTreeNode(sdkNode: SDK.AccessibilityModel.AccessibilityNode): AXTreeNode {
14
- const treeNodeData = sdkNode;
15
- const role = sdkNode.role()?.value;
16
-
17
- if (role === 'Iframe') {
18
- return {
19
- treeNodeData,
20
- children: async(): Promise<AXTreeNode[]> => {
21
- const domNode = await sdkNode.deferredDOMNode()?.resolvePromise();
22
- if (!domNode) {
23
- throw new Error('Could not find corresponding DOMNode');
24
- }
25
- const frameId = domNode.frameOwnerFrameId();
14
+ function isLeafNode(node: SDK.AccessibilityModel.AccessibilityNode): boolean {
15
+ return node.numChildren() === 0 && node.role()?.value !== 'Iframe';
16
+ }
26
17
 
27
- let document = domNode.contentDocument();
28
- if (!document && frameId) {
29
- const frame = SDK.FrameManager.FrameManager.instance().getFrame(frameId);
30
- if (!frame) {
31
- return [];
32
- }
33
- document = await frame.resourceTreeModel().domModel().requestDocument();
34
- }
35
- if (!document) {
36
- return [];
37
- }
18
+ function getModel(frameId: Protocol.Page.FrameId): SDK.AccessibilityModel.AccessibilityModel {
19
+ const frame = SDK.FrameManager.FrameManager.instance().getFrame(frameId);
20
+ const model = frame?.resourceTreeModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
21
+ if (!model) {
22
+ throw Error('Could not instantiate model for frameId');
23
+ }
24
+ return model;
25
+ }
38
26
 
39
- const axmodel = document.domModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
40
- if (!axmodel) {
41
- throw new Error('Could not find AccessibilityModel for child document');
42
- }
43
- // Check if we have requested the node before:
44
- let localRoot = axmodel.axNodeForDOMNode(document);
45
- if (!localRoot && frameId) {
46
- // Request the root node of the iframe document:
47
- localRoot = await axmodel.requestRootNode(1, frameId) || null;
48
- }
49
- if (!localRoot) {
50
- throw new Error('Could not find root node');
51
- }
52
- return [sdkNodeToAXTreeNode(localRoot)];
53
- },
54
- id: sdkNode.id(),
55
- };
27
+ export async function getRootNode(frameId: Protocol.Page.FrameId): Promise<SDK.AccessibilityModel.AccessibilityNode> {
28
+ const model = getModel(frameId);
29
+ const root = await model.requestRootNode(frameId);
30
+ if (!root) {
31
+ throw Error('No accessibility root for frame');
56
32
  }
33
+ return root;
34
+ }
57
35
 
58
- if (!sdkNode.numChildren()) {
59
- return {
60
- treeNodeData,
61
- id: sdkNode.id(),
62
- };
36
+ function getFrameIdForNodeOrDocument(node: SDK.DOMModel.DOMNode): Protocol.Page.FrameId {
37
+ let frameId;
38
+ if (node instanceof SDK.DOMModel.DOMDocument) {
39
+ frameId = node.body?.frameId();
40
+ } else {
41
+ frameId = node.frameId();
42
+ }
43
+ if (!frameId) {
44
+ throw Error('No frameId for DOM node');
63
45
  }
46
+ return frameId;
47
+ }
64
48
 
65
- return {
66
- treeNodeData,
67
- children: async(): Promise<AXTreeNode[]> => {
68
- if (sdkNode.numChildren() === sdkNode.children().length) {
69
- return sdkNode.children().map(child => sdkNodeToAXTreeNode(child));
70
- }
71
- // numChildren returns the number of children that this node has, whereas node.children()
72
- // returns only children that have been loaded. If these two don't match, that means that
73
- // there are backend children that need to be loaded into the model, so request them now.
74
- await sdkNode.accessibilityModel().requestAXChildren(sdkNode.id(), sdkNode.getFrameId() || undefined);
49
+ export async function getNodeAndAncestorsFromDOMNode(domNode: SDK.DOMModel.DOMNode):
50
+ Promise<SDK.AccessibilityModel.AccessibilityNode[]> {
51
+ let frameId = getFrameIdForNodeOrDocument(domNode);
52
+ const model = getModel(frameId);
53
+ const result = await model.requestAndLoadSubTreeToNode(domNode);
54
+ if (!result) {
55
+ throw Error('Could not retrieve accessibility node for inspected DOM node');
56
+ }
75
57
 
76
- if (sdkNode.numChildren() !== sdkNode.children().length) {
77
- throw new Error('Once loaded, number of children and length of children must match.');
78
- }
58
+ const topFrameId = SDK.FrameManager.FrameManager.instance().getTopFrame()?.id;
59
+ if (!topFrameId) {
60
+ return result;
61
+ }
62
+ while (frameId !== topFrameId) {
63
+ const node = await SDK.FrameManager.FrameManager.instance().getFrame(frameId)?.getOwnerDOMNodeOrDocument();
64
+ if (!node) {
65
+ break;
66
+ }
67
+ frameId = getFrameIdForNodeOrDocument(node);
68
+ const model = getModel(frameId);
69
+ const ancestors = await model.requestAndLoadSubTreeToNode(node);
70
+ result.push(...ancestors || []);
71
+ }
72
+ return result;
73
+ }
79
74
 
80
- const treeNodeChildren: AXTreeNode[] = [];
75
+ async function getChildren(node: SDK.AccessibilityModel.AccessibilityNode):
76
+ Promise<SDK.AccessibilityModel.AccessibilityNode[]> {
77
+ if (node.role()?.value === 'Iframe') {
78
+ const domNode = await node.deferredDOMNode()?.resolvePromise();
79
+ if (!domNode) {
80
+ throw new Error('Could not find corresponding DOMNode');
81
+ }
82
+ const frameId = domNode.frameOwnerFrameId();
83
+ if (!frameId) {
84
+ throw Error('No owner frameId on iframe node');
85
+ }
86
+ const localRoot = await getRootNode(frameId);
87
+ return [localRoot];
88
+ }
89
+ if (node.hasUnloadedChildren()) {
90
+ await node.accessibilityModel().requestAXChildren(node.id(), node.getFrameId() || undefined);
91
+ if (node.numChildren() !== node.children().length) {
92
+ throw new Error('Once loaded, number of children and length of children must match.');
93
+ }
94
+ }
95
+ return node.children();
96
+ }
81
97
 
82
- for (const child of sdkNode.children()) {
83
- treeNodeChildren.push(sdkNodeToAXTreeNode(child));
84
- }
98
+ export async function sdkNodeToAXTreeNodes(sdkNode: SDK.AccessibilityModel.AccessibilityNode): Promise<AXTreeNode[]> {
99
+ const treeNodeData = sdkNode;
100
+ if (isLeafNode(sdkNode)) {
101
+ return [{
102
+ treeNodeData,
103
+ id: getNodeId(sdkNode),
104
+ }];
105
+ }
85
106
 
86
- return treeNodeChildren;
107
+ return [{
108
+ treeNodeData,
109
+ children: async(): Promise<AXTreeNode[]> => {
110
+ const childNodes = await getChildren(sdkNode);
111
+ const childTreeNodes = await Promise.all(childNodes.map(childNode => sdkNodeToAXTreeNodes(childNode)));
112
+ return childTreeNodes.flat(1);
87
113
  },
88
- id: sdkNode.id(),
89
- };
114
+ id: getNodeId(sdkNode),
115
+ }];
90
116
  }
91
117
 
92
118
  type Data = ElementsComponents.AccessibilityTreeNode.AccessibilityTreeNodeData;
@@ -99,3 +125,7 @@ export function accessibilityNodeRenderer(node: AXTreeNode): LitHtml.TemplateRes
99
125
  const ignored = sdkNode.ignored();
100
126
  return LitHtml.html`<${tag} .data=${{name, role, ignored} as Data}></${tag}>`;
101
127
  }
128
+
129
+ export function getNodeId(node: SDK.AccessibilityModel.AccessibilityNode): string {
130
+ return node.getFrameId() + '#' + node.id();
131
+ }