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
package/.eslintignore CHANGED
@@ -5,7 +5,6 @@
5
5
  // clang-format check also ignores that file
6
6
  front_end/.eslintrc.js
7
7
  front_end/diff/diff_match_patch.js
8
- front_end/protocol_externs.js
9
8
  front_end/javascript_metadata/NativeFunctions.js
10
9
  front_end/third_party/
11
10
  test/e2e/**/*.js
package/AUTHORS CHANGED
@@ -25,6 +25,7 @@ Derek Li <the.derekli@gmail.com>
25
25
  Edward Trist <edwardtrist@gmail.com>
26
26
  Ergün Erdoğmuş <erdogmusergun@gmail.com>
27
27
  Eric Rannaud <eric.rannaud@gmail.com>
28
+ Feng Lu <lufengd3@gmail.com>
28
29
  Gabriel Luong <gabriel.luong@gmail.com>
29
30
  Gautham Banasandra <gautham.bangalore@gmail.com>
30
31
  Jake Mulhern <mulherje@gmail.com>
@@ -1,6 +1,5 @@
1
1
  file://config/owner/ENG_REVIEW_OWNERS
2
2
 
3
- aerotwist@chromium.org
4
3
  alexrudenko@chromium.org
5
4
  andoli@chromium.org
6
5
  bmeurer@chromium.org
@@ -1,4 +1,3 @@
1
- aerotwist@chromium.org
2
1
  jacktfranklin@chromium.org
3
2
  liviurau@chromium.org
4
3
  machenbach@chromium.org
@@ -69,6 +69,13 @@ export namespace Chrome {
69
69
 
70
70
  create(title: string, iconPath: string, pagePath: string, callback?: (panel: ExtensionPanel) => unknown): void;
71
71
  openResource(url: string, lineNumber: number, columnNumber?: number, callback?: () => unknown): void;
72
+
73
+ /**
74
+ * Fired when the theme changes in DevTools.
75
+ *
76
+ * @param callback The handler callback to register and be invoked on theme changes.
77
+ */
78
+ setThemeChangeHandler(callback?: (themeName: string) => unknown): void;
72
79
  }
73
80
 
74
81
  export interface Request {
@@ -1,8 +1,8 @@
1
1
  // Copyright 2020 The Chromium Authors. All rights reserved.
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- const fs = require('fs');
5
4
  const path = require('path');
5
+ const {writeIfChanged} = require('../../scripts/build/ninja/write-if-changed.js');
6
6
  const [, , buildTimestamp, targetGenDir, targetName, ...imageSources] = process.argv;
7
7
 
8
8
  /**
@@ -18,8 +18,8 @@ function generateCSSVariableDefinition(fileName) {
18
18
  fileName}', import.meta.url).toString() + '\\")');`;
19
19
  }
20
20
 
21
- const CURRENT_YEAR = new Date(Number(buildTimestamp) * 1000).getFullYear();
22
- const fileContent = `
21
+ const CURRENT_YEAR = new Date(Number(buildTimestamp) * 1000).getUTCFullYear();
22
+ const newContents = `
23
23
  // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
24
24
  // Use of this source code is governed by a BSD-style license that can be
25
25
  // found in the LICENSE file.
@@ -32,17 +32,16 @@ ${imageSources.map(generateCSSVariableDefinition).join('\n')}
32
32
  document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
33
33
  `;
34
34
 
35
- fs.writeFileSync(path.join(targetGenDir, 'Images.prebundle.js'), fileContent, {encoding: 'utf-8'});
35
+ writeIfChanged(path.join(targetGenDir, 'Images.prebundle.js'), newContents);
36
36
 
37
- const tsconfigContent = `
38
- {
39
- "compilerOptions": {
40
- "composite": true
41
- },
42
- "files": [
43
- "Images.js"
44
- ]
37
+ const tsconfigContent = `{
38
+ "compilerOptions": {
39
+ "composite": true
40
+ },
41
+ "files": [
42
+ "Images.js"
43
+ ]
45
44
  }
46
45
  `;
47
46
 
48
- fs.writeFileSync(path.join(targetGenDir, `${targetName}-tsconfig.json`), tsconfigContent, {encoding: 'utf-8'});
47
+ writeIfChanged(path.join(targetGenDir, `${targetName}-tsconfig.json`), tsconfigContent);
@@ -1572,6 +1572,20 @@
1572
1572
  `console.log(1) //# sourceMappingURL=chrome-extension://${extensionId}/source.map`, () => {});
1573
1573
  };
1574
1574
 
1575
+ TestSuite.prototype.testSourceMapsFromDevtools = function() {
1576
+ this.takeControl();
1577
+ const debuggerModel = self.SDK.targetManager.mainTarget().model(SDK.DebuggerModel);
1578
+ debuggerModel.sourceMapManager().addEventListener(
1579
+ SDK.SourceMapManager.Events.SourceMapWillAttach, this.releaseControl.bind(this));
1580
+
1581
+ this.evaluateInConsole_(
1582
+ 'console.log(1) //# sourceMappingURL=devtools://devtools/bundled/devtools_compatibility.js', () => {});
1583
+ };
1584
+
1585
+ TestSuite.prototype.testDoesNotCrashOnSourceMapsFromUnknownScheme = function() {
1586
+ this.evaluateInConsole_('console.log(1) //# sourceMappingURL=invalid-scheme://source.map', () => {});
1587
+ };
1588
+
1575
1589
  /**
1576
1590
  * Returns all loaded non anonymous uiSourceCodes.
1577
1591
  * @return {!Array.<!Workspace.UISourceCode>}
@@ -9,7 +9,7 @@ export const debounce = function(func: Function, delay: number): Function {
9
9
  let timer = 0;
10
10
  const debounced = (): void => {
11
11
  clearTimeout(timer);
12
- timer = setTimeout(() => func(), delay);
12
+ timer = window.setTimeout(() => func(), delay);
13
13
  };
14
14
  return debounced;
15
15
  };
@@ -197,6 +197,7 @@ export class Settings {
197
197
 
198
198
  export interface SettingsBackingStore {
199
199
  register(setting: string): void;
200
+ get(setting: string): Promise<string>;
200
201
  set(setting: string, value: string): void;
201
202
  remove(setting: string): void;
202
203
  clear(): void;
@@ -205,6 +206,7 @@ export interface SettingsBackingStore {
205
206
  export const NOOP_STORAGE: SettingsBackingStore = {
206
207
  register: () => {},
207
208
  set: () => {},
209
+ get: () => Promise.resolve(''),
208
210
  remove: () => {},
209
211
  clear: () => {},
210
212
  };
@@ -236,6 +238,17 @@ export class SettingsStorage {
236
238
  return this.object[name];
237
239
  }
238
240
 
241
+ async forceGet(originalName: string): Promise<string> {
242
+ const name = this.storagePrefix + originalName;
243
+ const value = await this.backingStore.get(name);
244
+ if (value && value !== this.object[name]) {
245
+ this.set(originalName, value);
246
+ } else if (!value) {
247
+ this.remove(originalName);
248
+ }
249
+ return value;
250
+ }
251
+
239
252
  remove(name: string): void {
240
253
  name = this.storagePrefix + name;
241
254
  delete this.object[name];
@@ -363,6 +376,26 @@ export class Setting<V> {
363
376
  return this.#value;
364
377
  }
365
378
 
379
+ async forceGet(): Promise<V> {
380
+ const name = this.name;
381
+ const oldValue = this.storage.get(name);
382
+ const value = await this.storage.forceGet(name);
383
+ this.#value = this.defaultValue;
384
+ if (value) {
385
+ try {
386
+ this.#value = this.#serializer.parse(value);
387
+ } catch (e) {
388
+ this.storage.remove(this.name);
389
+ }
390
+ }
391
+
392
+ if (oldValue !== value) {
393
+ this.eventSupport.dispatchEventToListeners(this.name, this.#value);
394
+ }
395
+
396
+ return this.#value;
397
+ }
398
+
366
399
  set(value: V): void {
367
400
  this.#hadUserAction = true;
368
401
  this.#value = value;
@@ -94,15 +94,15 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
94
94
  }
95
95
 
96
96
  setIsDocked(isDocked: boolean, callback: () => void): void {
97
- setTimeout(callback, 0);
97
+ window.setTimeout(callback, 0);
98
98
  }
99
99
 
100
100
  showSurvey(trigger: string, callback: (arg0: ShowSurveyResult) => void): void {
101
- setTimeout(() => callback({surveyShown: false}), 0);
101
+ window.setTimeout(() => callback({surveyShown: false}), 0);
102
102
  }
103
103
 
104
104
  canShowSurvey(trigger: string, callback: (arg0: CanShowSurveyResult) => void): void {
105
- setTimeout(() => callback({canShowSurvey: false}), 0);
105
+ window.setTimeout(() => callback({canShowSurvey: false}), 0);
106
106
  }
107
107
 
108
108
  /**
@@ -260,6 +260,10 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
260
260
  callback(prefs);
261
261
  }
262
262
 
263
+ getPreference(name: string, callback: (arg0: string) => void): void {
264
+ callback(window.localStorage[name]);
265
+ }
266
+
263
267
  setPreference(name: string, value: string): void {
264
268
  window.localStorage[name] = value;
265
269
  }
@@ -234,6 +234,8 @@ export interface InspectorFrontendHostAPI {
234
234
  [x: string]: string,
235
235
  }) => void): void;
236
236
 
237
+ getPreference(name: string, callback: (arg0: string) => void): void;
238
+
237
239
  setPreference(name: string, value: string): void;
238
240
 
239
241
  removePreference(name: string): void;
@@ -78,10 +78,10 @@ export class UserMetrics {
78
78
  }
79
79
 
80
80
  this.#firedLaunchHistogram = true;
81
- // Use rAF and setTimeout to ensure the marker is fired after layout and rendering.
81
+ // Use rAF and window.setTimeout to ensure the marker is fired after layout and rendering.
82
82
  // This will give the most accurate representation of the tool being ready for a user.
83
83
  requestAnimationFrame(() => {
84
- setTimeout(() => {
84
+ window.setTimeout(() => {
85
85
  // Mark the load time so that we can pinpoint it more easily in a trace.
86
86
  performance.mark(histogramName);
87
87
  // If the user has switched panel before we finished loading, ignore the histogram,
@@ -58,7 +58,7 @@ function getLocaleFetchUrl(locale: Intl.UnicodeBCP47LocaleIdentifier): string {
58
58
  export async function fetchAndRegisterLocaleData(locale: Intl.UnicodeBCP47LocaleIdentifier): Promise<void> {
59
59
  const localeDataTextPromise = fetch(getLocaleFetchUrl(locale)).then(result => result.json());
60
60
  const timeoutPromise =
61
- new Promise((resolve, reject) => setTimeout(() => reject(new Error('timed out fetching locale')), 5000));
61
+ new Promise((resolve, reject) => window.setTimeout(() => reject(new Error('timed out fetching locale')), 5000));
62
62
  const localeData = await Promise.race([timeoutPromise, localeDataTextPromise]);
63
63
  i18nInstance.registerLocaleData(locale, localeData);
64
64
  }