chrome-devtools-frontend 1.0.957495 → 1.0.959543

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 (159) hide show
  1. package/.eslintignore +0 -1
  2. package/AUTHORS +1 -0
  3. package/config/owner/COMMON_OWNERS +0 -1
  4. package/config/owner/INFRA_OWNERS +0 -1
  5. package/extension-api/ExtensionAPI.d.ts +7 -0
  6. package/front_end/Images/generate-css-vars.js +12 -13
  7. package/front_end/Tests.js +14 -0
  8. package/front_end/core/common/Debouncer.ts +1 -1
  9. package/front_end/core/common/Settings.ts +33 -0
  10. package/front_end/core/host/InspectorFrontendHost.ts +7 -3
  11. package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
  12. package/front_end/core/host/UserMetrics.ts +2 -2
  13. package/front_end/core/i18n/i18nImpl.ts +1 -1
  14. package/front_end/core/i18n/locales/af.json +399 -354
  15. package/front_end/core/i18n/locales/am.json +399 -354
  16. package/front_end/core/i18n/locales/ar.json +399 -354
  17. package/front_end/core/i18n/locales/as.json +399 -354
  18. package/front_end/core/i18n/locales/az.json +399 -354
  19. package/front_end/core/i18n/locales/be.json +399 -354
  20. package/front_end/core/i18n/locales/bg.json +399 -354
  21. package/front_end/core/i18n/locales/bn.json +399 -354
  22. package/front_end/core/i18n/locales/bs.json +400 -355
  23. package/front_end/core/i18n/locales/ca.json +399 -354
  24. package/front_end/core/i18n/locales/cs.json +399 -354
  25. package/front_end/core/i18n/locales/cy.json +399 -354
  26. package/front_end/core/i18n/locales/da.json +399 -354
  27. package/front_end/core/i18n/locales/de.json +399 -354
  28. package/front_end/core/i18n/locales/el.json +399 -354
  29. package/front_end/core/i18n/locales/en-GB.json +420 -375
  30. package/front_end/core/i18n/locales/es-419.json +399 -354
  31. package/front_end/core/i18n/locales/es.json +399 -354
  32. package/front_end/core/i18n/locales/et.json +399 -354
  33. package/front_end/core/i18n/locales/eu.json +403 -358
  34. package/front_end/core/i18n/locales/fa.json +399 -354
  35. package/front_end/core/i18n/locales/fi.json +399 -354
  36. package/front_end/core/i18n/locales/fil.json +399 -354
  37. package/front_end/core/i18n/locales/fr-CA.json +399 -354
  38. package/front_end/core/i18n/locales/fr.json +399 -354
  39. package/front_end/core/i18n/locales/gl.json +399 -354
  40. package/front_end/core/i18n/locales/gu.json +399 -354
  41. package/front_end/core/i18n/locales/he.json +399 -354
  42. package/front_end/core/i18n/locales/hi.json +399 -354
  43. package/front_end/core/i18n/locales/hr.json +399 -354
  44. package/front_end/core/i18n/locales/hu.json +399 -354
  45. package/front_end/core/i18n/locales/hy.json +399 -354
  46. package/front_end/core/i18n/locales/id.json +399 -354
  47. package/front_end/core/i18n/locales/is.json +399 -354
  48. package/front_end/core/i18n/locales/it.json +399 -354
  49. package/front_end/core/i18n/locales/ja.json +399 -354
  50. package/front_end/core/i18n/locales/ka.json +399 -354
  51. package/front_end/core/i18n/locales/kk.json +400 -355
  52. package/front_end/core/i18n/locales/km.json +399 -354
  53. package/front_end/core/i18n/locales/kn.json +399 -354
  54. package/front_end/core/i18n/locales/ko.json +399 -354
  55. package/front_end/core/i18n/locales/ky.json +399 -354
  56. package/front_end/core/i18n/locales/lo.json +399 -354
  57. package/front_end/core/i18n/locales/lt.json +399 -354
  58. package/front_end/core/i18n/locales/lv.json +399 -354
  59. package/front_end/core/i18n/locales/mk.json +399 -354
  60. package/front_end/core/i18n/locales/ml.json +399 -354
  61. package/front_end/core/i18n/locales/mn.json +399 -354
  62. package/front_end/core/i18n/locales/mr.json +399 -354
  63. package/front_end/core/i18n/locales/ms.json +399 -354
  64. package/front_end/core/i18n/locales/my.json +399 -354
  65. package/front_end/core/i18n/locales/ne.json +399 -354
  66. package/front_end/core/i18n/locales/nl.json +399 -354
  67. package/front_end/core/i18n/locales/no.json +399 -354
  68. package/front_end/core/i18n/locales/or.json +399 -354
  69. package/front_end/core/i18n/locales/pa.json +410 -365
  70. package/front_end/core/i18n/locales/pl.json +399 -354
  71. package/front_end/core/i18n/locales/pt-PT.json +399 -354
  72. package/front_end/core/i18n/locales/pt.json +399 -354
  73. package/front_end/core/i18n/locales/ro.json +399 -354
  74. package/front_end/core/i18n/locales/ru.json +399 -354
  75. package/front_end/core/i18n/locales/si.json +399 -354
  76. package/front_end/core/i18n/locales/sk.json +399 -354
  77. package/front_end/core/i18n/locales/sl.json +399 -354
  78. package/front_end/core/i18n/locales/sq.json +399 -354
  79. package/front_end/core/i18n/locales/sr-Latn.json +399 -354
  80. package/front_end/core/i18n/locales/sr.json +399 -354
  81. package/front_end/core/i18n/locales/sv.json +399 -354
  82. package/front_end/core/i18n/locales/sw.json +399 -354
  83. package/front_end/core/i18n/locales/ta.json +405 -360
  84. package/front_end/core/i18n/locales/te.json +399 -354
  85. package/front_end/core/i18n/locales/th.json +399 -354
  86. package/front_end/core/i18n/locales/tr.json +399 -354
  87. package/front_end/core/i18n/locales/uk.json +399 -354
  88. package/front_end/core/i18n/locales/ur.json +399 -354
  89. package/front_end/core/i18n/locales/uz.json +399 -354
  90. package/front_end/core/i18n/locales/vi.json +399 -354
  91. package/front_end/core/i18n/locales/zh-HK.json +399 -354
  92. package/front_end/core/i18n/locales/zh-TW.json +399 -354
  93. package/front_end/core/i18n/locales/zh.json +399 -354
  94. package/front_end/core/i18n/locales/zu.json +399 -354
  95. package/front_end/core/platform/generate-dcheck.js +2 -2
  96. package/front_end/core/protocol_client/InspectorBackend.ts +3 -3
  97. package/front_end/core/sdk/Connections.ts +1 -1
  98. package/front_end/core/sdk/IsolateManager.ts +1 -1
  99. package/front_end/core/sdk/PageResourceLoader.ts +4 -2
  100. package/front_end/core/sdk/ProfileTreeModel.ts +1 -1
  101. package/front_end/devtools_compatibility.js +9 -0
  102. package/front_end/entrypoints/main/MainImpl.ts +7 -2
  103. package/front_end/entrypoints/main/main-meta.ts +24 -24
  104. package/front_end/generated/SupportedCSSProperties.js +2 -2
  105. package/front_end/models/extensions/ExtensionAPI.ts +33 -5
  106. package/front_end/models/extensions/ExtensionServer.ts +28 -0
  107. package/front_end/models/logs/LogManager.ts +1 -1
  108. package/front_end/models/persistence/Automapping.ts +32 -4
  109. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
  110. package/front_end/models/persistence/PersistenceImpl.ts +33 -13
  111. package/front_end/models/persistence/WorkspaceSettingsTab.ts +0 -1
  112. package/front_end/models/persistence/workspaceSettingsTab.css +3 -7
  113. package/front_end/models/workspace/UISourceCode.ts +1 -1
  114. package/front_end/panels/application/StorageView.ts +1 -1
  115. package/front_end/panels/console/ConsoleView.ts +1 -1
  116. package/front_end/panels/elements/AccessibilityTreeView.ts +2 -2
  117. package/front_end/panels/elements/ComputedStyleModel.ts +1 -1
  118. package/front_end/panels/elements/ElementsPanel.ts +34 -29
  119. package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
  120. package/front_end/panels/elements/elementsPanel.css +10 -4
  121. package/front_end/panels/network/NetworkItemView.ts +1 -1
  122. package/front_end/panels/profiler/HeapTimelineOverview.ts +2 -2
  123. package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -1
  124. package/front_end/panels/screencast/ScreencastView.ts +2 -2
  125. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  126. package/front_end/panels/settings/settingsScreen.css +11 -5
  127. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  128. package/front_end/panels/sources/NavigatorView.ts +1 -1
  129. package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
  130. package/front_end/panels/sources/sources-meta.ts +14 -11
  131. package/front_end/panels/timeline/TimelineController.ts +2 -2
  132. package/front_end/panels/timeline/TimelineLoader.ts +3 -3
  133. package/front_end/panels/timeline/TimelinePanel.ts +1 -1
  134. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  135. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  136. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
  137. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +76 -12
  138. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  139. package/front_end/third_party/codemirror.next/package.json +13 -13
  140. package/front_end/ui/components/buttons/Button.ts +5 -1
  141. package/front_end/ui/components/buttons/button.css +10 -1
  142. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +2 -2
  143. package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
  144. package/front_end/ui/components/text_editor/cursor_tooltip.ts +1 -1
  145. package/front_end/ui/components/text_editor/javascript.ts +1 -1
  146. package/front_end/ui/legacy/SearchableView.ts +1 -1
  147. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  148. package/front_end/ui/legacy/TextPrompt.ts +2 -1
  149. package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +1 -1
  150. package/front_end/ui/legacy/filter.css +1 -0
  151. package/front_end/ui/legacy/toolbar.css +2 -0
  152. package/package.json +1 -1
  153. package/scripts/build/generate_css_js_files.js +8 -6
  154. package/scripts/build/generate_html_entrypoint.js +2 -1
  155. package/scripts/build/ninja/copy-file.js +2 -1
  156. package/scripts/build/ninja/copy-files.js +2 -1
  157. package/scripts/build/ninja/generate-declaration.js +2 -1
  158. package/scripts/build/ninja/node.gni +4 -1
  159. package/scripts/build/ninja/write-if-changed.js +27 -0
@@ -83,7 +83,7 @@ export class ComputedStyleModel extends Common.ObjectWrapper.ObjectWrapper<Event
83
83
  clearTimeout(this.frameResizedTimer);
84
84
  }
85
85
 
86
- this.frameResizedTimer = setTimeout(refreshContents.bind(this), 100);
86
+ this.frameResizedTimer = window.setTimeout(refreshContents.bind(this), 100);
87
87
  }
88
88
 
89
89
  private elementNode(): SDK.DOMModel.DOMNode|null {
@@ -42,7 +42,7 @@ import * as Extensions from '../../models/extensions/extensions.js';
42
42
  import elementsPanelStyles from './elementsPanel.css.js';
43
43
 
44
44
  import type * as Adorners from '../../ui/components/adorners/adorners.js';
45
- import * as IconButton from '../../ui/components/icon_button/icon_button.js';
45
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
46
46
  import * as Components from '../../ui/legacy/components/utils/utils.js';
47
47
  import * as UI from '../../ui/legacy/legacy.js';
48
48
 
@@ -142,20 +142,21 @@ const UIStrings = {
142
142
  const str_ = i18n.i18n.registerUIStrings('panels/elements/ElementsPanel.ts', UIStrings);
143
143
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
144
144
 
145
- const createAccessibilityTreeToggleButton = (isActive: boolean): HTMLButtonElement => {
146
- const button = document.createElement('button');
145
+ const createAccessibilityTreeToggleButton = (isActive: boolean): HTMLElement => {
146
+ const button = new Buttons.Button.Button();
147
+ const title =
148
+ isActive ? i18nString(UIStrings.switchToDomTreeView) : i18nString(UIStrings.switchToAccessibilityTreeView);
149
+ button.data = {
150
+ active: isActive,
151
+ variant: Buttons.Button.Variant.TOOLBAR,
152
+ iconUrl: new URL('../../Images/accessibility-icon.svg', import.meta.url).toString(),
153
+ title,
154
+ };
155
+ button.tabIndex = 0;
156
+ button.classList.add('axtree-button');
147
157
  if (isActive) {
148
- button.classList.add('axtree-button', 'axtree-button-active');
149
- } else {
150
- button.classList.add('axtree-button');
158
+ button.classList.add('active');
151
159
  }
152
- button.tabIndex = 0;
153
- button.title =
154
- isActive ? i18nString(UIStrings.switchToDomTreeView) : i18nString(UIStrings.switchToAccessibilityTreeView);
155
- const icon = new IconButton.Icon.Icon();
156
- const bgColor = isActive ? 'var(--color-primary)' : 'var(--color-text-secondary)';
157
- icon.data = {iconName: 'accessibility-icon', color: bgColor, width: '16px', height: '16px'};
158
- button.appendChild(icon);
159
160
  return button;
160
161
  };
161
162
 
@@ -166,7 +167,8 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
166
167
  UI.View.ViewLocationResolver {
167
168
  private splitWidget: UI.SplitWidget.SplitWidget;
168
169
  private readonly searchableViewInternal: UI.SearchableView.SearchableView;
169
- private contentElementInternal: HTMLDivElement;
170
+ private mainContainer: HTMLDivElement;
171
+ private domTreeContainer: HTMLDivElement;
170
172
  private splitMode: _splitMode|null;
171
173
  private readonly accessibilityTreeView: AccessibilityTreeView|undefined;
172
174
  private breadcrumbs: ElementsComponents.ElementsBreadcrumbs.ElementsBreadcrumbs;
@@ -185,8 +187,8 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
185
187
  private readonly adornerManager: ElementsComponents.AdornerManager.AdornerManager;
186
188
  private adornerSettingsPane: ElementsComponents.AdornerSettingsPane.AdornerSettingsPane|null;
187
189
  private readonly adornersByName: Map<string, Set<Adorners.Adorner.Adorner>>;
188
- accessibilityTreeButton?: HTMLButtonElement;
189
- domTreeButton?: HTMLButtonElement;
190
+ accessibilityTreeButton?: HTMLElement;
191
+ domTreeButton?: HTMLElement;
190
192
  private selectedNodeOnReset?: SDK.DOMModel.DOMNode;
191
193
  private hasNonDefaultSelectedNode?: boolean;
192
194
  private searchConfig?: UI.SearchableView.SearchConfig;
@@ -210,24 +212,27 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
210
212
  this.searchableViewInternal.setPlaceholder(i18nString(UIStrings.findByStringSelectorOrXpath));
211
213
  const stackElement = this.searchableViewInternal.element;
212
214
 
213
- this.contentElementInternal = document.createElement('div');
215
+ this.mainContainer = document.createElement('div');
216
+ this.domTreeContainer = document.createElement('div');
214
217
  const crumbsContainer = document.createElement('div');
215
218
  if (Root.Runtime.experiments.isEnabled('fullAccessibilityTree')) {
216
219
  this.initializeFullAccessibilityTreeView();
217
220
  }
218
- stackElement.appendChild(this.contentElementInternal);
221
+ this.mainContainer.appendChild(this.domTreeContainer);
222
+ stackElement.appendChild(this.mainContainer);
219
223
  stackElement.appendChild(crumbsContainer);
220
224
 
221
- UI.ARIAUtils.markAsMain(this.contentElementInternal);
222
- UI.ARIAUtils.setAccessibleName(this.contentElementInternal, i18nString(UIStrings.domTreeExplorer));
225
+ UI.ARIAUtils.markAsMain(this.domTreeContainer);
226
+ UI.ARIAUtils.setAccessibleName(this.domTreeContainer, i18nString(UIStrings.domTreeExplorer));
223
227
 
224
228
  this.splitWidget.setMainWidget(this.searchableViewInternal);
225
229
  this.splitMode = null;
226
230
 
227
- this.contentElementInternal.id = 'elements-content';
231
+ this.mainContainer.id = 'main-content';
232
+ this.domTreeContainer.id = 'elements-content';
228
233
  // FIXME: crbug.com/425984
229
234
  if (Common.Settings.Settings.instance().moduleSetting('domWordWrap').get()) {
230
- this.contentElementInternal.classList.add('elements-wrap');
235
+ this.domTreeContainer.classList.add('elements-wrap');
231
236
  }
232
237
  Common.Settings.Settings.instance()
233
238
  .moduleSetting('domWordWrap')
@@ -281,7 +286,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
281
286
  this.domTreeButton = createAccessibilityTreeToggleButton(true);
282
287
  this.domTreeButton.addEventListener('click', this.showDOMTree.bind(this));
283
288
 
284
- this.contentElementInternal.appendChild(this.accessibilityTreeButton);
289
+ this.mainContainer.appendChild(this.accessibilityTreeButton);
285
290
  }
286
291
 
287
292
  private showAccessibilityTree(): void {
@@ -432,12 +437,12 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
432
437
 
433
438
  for (const treeOutline of this.treeOutlines) {
434
439
  // Attach heavy component lazily
435
- if (treeOutline.element.parentElement !== this.contentElementInternal) {
440
+ if (treeOutline.element.parentElement !== this.domTreeContainer) {
436
441
  const header = this.treeOutlineHeaders.get(treeOutline);
437
442
  if (header) {
438
- this.contentElementInternal.appendChild(header);
443
+ this.domTreeContainer.appendChild(header);
439
444
  }
440
- this.contentElementInternal.appendChild(treeOutline.element);
445
+ this.domTreeContainer.appendChild(treeOutline.element);
441
446
  }
442
447
  }
443
448
 
@@ -468,10 +473,10 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
468
473
  for (const treeOutline of this.treeOutlines) {
469
474
  treeOutline.setVisible(false);
470
475
  // Detach heavy component on hide
471
- this.contentElementInternal.removeChild(treeOutline.element);
476
+ this.domTreeContainer.removeChild(treeOutline.element);
472
477
  const header = this.treeOutlineHeaders.get(treeOutline);
473
478
  if (header) {
474
- this.contentElementInternal.removeChild(header);
479
+ this.domTreeContainer.removeChild(header);
475
480
  }
476
481
  }
477
482
  super.willHide();
@@ -667,7 +672,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
667
672
  }
668
673
 
669
674
  private domWordWrapSettingChanged(event: Common.EventTarget.EventTargetEvent<boolean>): void {
670
- this.contentElementInternal.classList.toggle('elements-wrap', event.data);
675
+ this.domTreeContainer.classList.toggle('elements-wrap', event.data);
671
676
  for (const treeOutline of this.treeOutlines) {
672
677
  treeOutline.setWordWrap(event.data);
673
678
  }
@@ -590,7 +590,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
590
590
 
591
591
  async doUpdate(): Promise<void> {
592
592
  if (!this.initialUpdateCompleted) {
593
- setTimeout(() => {
593
+ window.setTimeout(() => {
594
594
  if (!this.initialUpdateCompleted) {
595
595
  // the spinner will get automatically removed when innerRebuildUpdate is called
596
596
  this.sectionsContainer.createChild('span', 'spinner');
@@ -1650,7 +1650,7 @@ export class StylePropertiesSection {
1650
1650
  if (this.hoverTimer) {
1651
1651
  clearTimeout(this.hoverTimer);
1652
1652
  }
1653
- this.hoverTimer = setTimeout(this.highlight.bind(this), 300);
1653
+ this.hoverTimer = window.setTimeout(this.highlight.bind(this), 300);
1654
1654
  }
1655
1655
 
1656
1656
  highlight(mode: string|undefined = 'all'): void {
@@ -27,11 +27,15 @@
27
27
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
28
  */
29
29
 
30
- #elements-content {
30
+ #main-content {
31
+ position: relative;
31
32
  flex: 1 1;
33
+ }
34
+
35
+ #elements-content {
32
36
  overflow: auto;
33
37
  padding: 2px 0 0;
34
- position: relative;
38
+ height: 100%;
35
39
  }
36
40
 
37
41
  .style-panes-wrapper {
@@ -82,11 +86,13 @@ devtools-tree-outline {
82
86
 
83
87
  .axtree-button {
84
88
  position: absolute;
85
- padding: 4px;
86
89
  top: 16px;
87
- right: 16px;
90
+ right: 20px;
91
+ background-color: var(--color-background-elevation-1);
88
92
  display: flex;
89
93
  justify-content: center;
90
94
  align-items: center;
91
95
  z-index: 1;
96
+ border: 1px solid var(--color-details-hairline);
97
+ border-radius: 3px;
92
98
  }
@@ -275,7 +275,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
275
275
  if (!this.selectTab(tabId)) {
276
276
  // maybeAppendPayloadPanel might cause payload tab to appear asynchronously, so
277
277
  // it makes sense to retry on the next tick
278
- setTimeout(() => {
278
+ window.setTimeout(() => {
279
279
  if (!this.selectTab(tabId)) {
280
280
  this.selectTab('headers');
281
281
  }
@@ -196,7 +196,7 @@ export class HeapTimelineOverview extends Common.ObjectWrapper.eventMixin<EventT
196
196
 
197
197
  onWindowChanged(): void {
198
198
  if (!this.updateGridTimerId) {
199
- this.updateGridTimerId = setTimeout(this.updateGrid.bind(this), 10);
199
+ this.updateGridTimerId = window.setTimeout(this.updateGrid.bind(this), 10);
200
200
  }
201
201
  }
202
202
 
@@ -204,7 +204,7 @@ export class HeapTimelineOverview extends Common.ObjectWrapper.eventMixin<EventT
204
204
  if (this.updateTimerId) {
205
205
  return;
206
206
  }
207
- this.updateTimerId = setTimeout(this.update.bind(this), 10);
207
+ this.updateTimerId = window.setTimeout(this.update.bind(this), 10);
208
208
  }
209
209
 
210
210
  updateBoundaries(): void {
@@ -203,7 +203,7 @@ export class LiveHeapProfileView extends UI.Widget.VBox {
203
203
  return;
204
204
  }
205
205
  this.update(isolates, profiles);
206
- await new Promise(r => setTimeout(r, 3000));
206
+ await new Promise(r => window.setTimeout(r, 3000));
207
207
  } while (this.currentPollId === pollId);
208
208
  }
209
209
 
@@ -796,7 +796,7 @@ export class ProgressTracker {
796
796
  private onLoad(): void {
797
797
  this.requestIds = null;
798
798
  this.updateProgress(1); // Display 100% progress on load, hide it in 0.5s.
799
- setTimeout(() => {
799
+ window.setTimeout(() => {
800
800
  if (!this.navigationProgressVisible()) {
801
801
  this.displayProgress(0);
802
802
  }
@@ -831,7 +831,7 @@ export class ProgressTracker {
831
831
  return;
832
832
  }
833
833
  ++this.finishedRequests;
834
- setTimeout(() => {
834
+ window.setTimeout(() => {
835
835
  this.updateProgress(
836
836
  this.finishedRequests / this.startedRequests * 0.9); // Finished requests drive the progress up to 90%.
837
837
  }, 500); // Delay to give the new requests time to start. This makes the progress smoother.
@@ -392,7 +392,7 @@ export class ExperimentsSettingsTab extends SettingsTab {
392
392
  constructor() {
393
393
  super(i18nString(UIStrings.experiments), 'experiments-tab-content');
394
394
  const filterSection = this.appendSection();
395
- filterSection.style.paddingTop = '1px';
395
+ filterSection.classList.add('experiments-filter');
396
396
 
397
397
  const labelElement = filterSection.createChild('label');
398
398
  labelElement.textContent = i18nString(UIStrings.filterExperimentsLabel);
@@ -74,10 +74,15 @@ fieldset {
74
74
  border: none;
75
75
  }
76
76
 
77
- .settings-tab label {
78
- padding-right: 4px;
79
- display: inline-flex;
80
- flex-shrink: 0;
77
+ .experiments-filter {
78
+ padding-top: 1px;
79
+ display: flex;
80
+ align-items: center;
81
+ }
82
+
83
+ label {
84
+ padding-right: 8px;
85
+ padding-bottom: 8px;
81
86
  }
82
87
 
83
88
  .settings-tab p {
@@ -90,7 +95,7 @@ fieldset {
90
95
 
91
96
  .settings-select {
92
97
  align-items: center;
93
- display: flex;
98
+ display: grid;
94
99
  }
95
100
 
96
101
  .settings-experiments-warning-subsection-warning {
@@ -169,6 +174,7 @@ fieldset {
169
174
 
170
175
  .settings-tab select {
171
176
  margin-left: 10px;
177
+ width: 80%;
172
178
  }
173
179
 
174
180
  .settings-experiment {
@@ -603,7 +603,7 @@ export class DebuggerPlugin extends Plugin {
603
603
  } else if (/^text\/(javascript|typescript|jsx)/.test(this.uiSourceCode.mimeType())) {
604
604
  let node: CodeMirror.SyntaxNode|null = CodeMirror.syntaxTree(editor.state).resolveInner(textPosition, 1);
605
605
  // Only do something if the cursor is over a leaf node.
606
- if (node.firstChild) {
606
+ if (node?.firstChild) {
607
607
  return null;
608
608
  }
609
609
  while (
@@ -1137,7 +1137,7 @@ export class NavigatorSourceTreeElement extends UI.TreeOutline.TreeElement {
1137
1137
  super.selectOnMouseDown(event);
1138
1138
  return;
1139
1139
  }
1140
- setTimeout(rename.bind(this), 300);
1140
+ window.setTimeout(rename.bind(this), 300);
1141
1141
 
1142
1142
  function rename(this: NavigatorSourceTreeElement): void {
1143
1143
  if (this.shouldRenameOnMouseDown()) {
@@ -240,7 +240,7 @@ export class SourcesSearchScope implements Search.SearchConfig.SearchScope {
240
240
 
241
241
  ++callbacksLeft;
242
242
  const uiSourceCode = files[fileIndex++];
243
- setTimeout(searchInNextFile.bind(this, uiSourceCode), 0);
243
+ window.setTimeout(searchInNextFile.bind(this, uiSourceCode), 0);
244
244
  }
245
245
 
246
246
  function contentLoaded(
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
+ import * as Host from '../../core/host/host.js';
6
7
  import * as i18n from '../../core/i18n/i18n.js';
7
8
  import * as Root from '../../core/root/root.js';
8
9
  import * as SDK from '../../core/sdk/sdk.js';
@@ -1097,17 +1098,19 @@ UI.ActionRegistration.registerActionExtension({
1097
1098
  title: i18nLazyString(UIStrings.createNewSnippet),
1098
1099
  });
1099
1100
 
1100
- UI.ActionRegistration.registerActionExtension({
1101
- category: UI.ActionRegistration.ActionCategory.SOURCES,
1102
- actionId: 'sources.add-folder-to-workspace',
1103
- async loadActionDelegate() {
1104
- const Sources = await loadSourcesModule();
1105
- return Sources.SourcesNavigator.ActionDelegate.instance();
1106
- },
1107
- iconClass: UI.ActionRegistration.IconClass.LARGE_ICON_ADD,
1108
- title: i18nLazyString(UIStrings.addFolderToWorkspace),
1109
- condition: Root.Runtime.ConditionName.NOT_SOURCES_HIDE_ADD_FOLDER,
1110
- });
1101
+ if (!Host.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()) {
1102
+ UI.ActionRegistration.registerActionExtension({
1103
+ category: UI.ActionRegistration.ActionCategory.SOURCES,
1104
+ actionId: 'sources.add-folder-to-workspace',
1105
+ async loadActionDelegate() {
1106
+ const Sources = await loadSourcesModule();
1107
+ return Sources.SourcesNavigator.ActionDelegate.instance();
1108
+ },
1109
+ iconClass: UI.ActionRegistration.IconClass.LARGE_ICON_ADD,
1110
+ title: i18nLazyString(UIStrings.addFolderToWorkspace),
1111
+ condition: Root.Runtime.ConditionName.NOT_SOURCES_HIDE_ADD_FOLDER,
1112
+ });
1113
+ }
1111
1114
 
1112
1115
  UI.ActionRegistration.registerActionExtension({
1113
1116
  category: UI.ActionRegistration.ActionCategory.DEBUGGER,
@@ -146,7 +146,7 @@ export class TimelineController implements SDK.TargetManager.SDKModelObserver<SD
146
146
  const extensionCompletionPromises = this.extensionSessions.map(session => session.stop());
147
147
  if (extensionCompletionPromises.length) {
148
148
  tracingStoppedPromises.push(
149
- Promise.race([Promise.all(extensionCompletionPromises), new Promise(r => setTimeout(r, 5000))]));
149
+ Promise.race([Promise.all(extensionCompletionPromises), new Promise(r => window.setTimeout(r, 5000))]));
150
150
  }
151
151
  await Promise.all(tracingStoppedPromises);
152
152
  }
@@ -222,7 +222,7 @@ export class TimelineController implements SDK.TargetManager.SDKModelObserver<SD
222
222
 
223
223
  private allSourcesFinished(): void {
224
224
  this.client.processingStarted();
225
- setTimeout(() => this.finalizeTrace(), 0);
225
+ window.setTimeout(() => this.finalizeTrace(), 0);
226
226
  }
227
227
 
228
228
  private async finalizeTrace(): Promise<void> {
@@ -80,14 +80,14 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream {
80
80
  static loadFromEvents(events: SDK.TracingManager.EventPayload[], client: Client): TimelineLoader {
81
81
  const loader = new TimelineLoader(client);
82
82
 
83
- setTimeout(async () => {
83
+ window.setTimeout(async () => {
84
84
  const eventsPerChunk = 5000;
85
85
  client.loadingStarted();
86
86
  for (let i = 0; i < events.length; i += eventsPerChunk) {
87
87
  const chunk = events.slice(i, i + eventsPerChunk);
88
88
  (loader.tracingModel as SDK.TracingModel.TracingModel).addEvents(chunk);
89
89
  client.loadingProgress((i + chunk.length) / events.length);
90
- await new Promise(r => setTimeout(r)); // Yield event loop to paint.
90
+ await new Promise(r => window.setTimeout(r)); // Yield event loop to paint.
91
91
  }
92
92
  void loader.close();
93
93
  });
@@ -228,7 +228,7 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream {
228
228
  return;
229
229
  }
230
230
  this.client.processingStarted();
231
- setTimeout(() => this.finalizeTrace(), 0);
231
+ window.setTimeout(() => this.finalizeTrace(), 0);
232
232
  }
233
233
 
234
234
  private finalizeTrace(): void {
@@ -1148,7 +1148,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
1148
1148
  return;
1149
1149
  }
1150
1150
  const controller = this.controller;
1151
- await new Promise(r => setTimeout(r, this.millisecondsToRecordAfterLoadEvent));
1151
+ await new Promise(r => window.setTimeout(r, this.millisecondsToRecordAfterLoadEvent));
1152
1152
 
1153
1153
  // Check if we're still in the same recording session.
1154
1154
  if (controller !== this.controller || this.state !== State.Recording) {
@@ -404,7 +404,7 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
404
404
  }
405
405
 
406
406
  // TODO(crbug.com/1112528): Add back-end events for credential creation and removal to avoid polling.
407
- setTimeout(this.#updateCredentials.bind(this, authenticatorId), TIMEOUT);
407
+ window.setTimeout(this.#updateCredentials.bind(this, authenticatorId), TIMEOUT);
408
408
  }
409
409
 
410
410
  #maybeAddEmptyNode(dataGrid: DataGrid.DataGrid.DataGridImpl<DataGridNode>): void {