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.
- package/.eslintignore +0 -1
- package/AUTHORS +1 -0
- package/config/owner/COMMON_OWNERS +0 -1
- package/config/owner/INFRA_OWNERS +0 -1
- package/extension-api/ExtensionAPI.d.ts +7 -0
- package/front_end/Images/generate-css-vars.js +12 -13
- package/front_end/Tests.js +14 -0
- package/front_end/core/common/Debouncer.ts +1 -1
- package/front_end/core/common/Settings.ts +33 -0
- package/front_end/core/host/InspectorFrontendHost.ts +7 -3
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/host/UserMetrics.ts +2 -2
- package/front_end/core/i18n/i18nImpl.ts +1 -1
- package/front_end/core/i18n/locales/af.json +399 -354
- package/front_end/core/i18n/locales/am.json +399 -354
- package/front_end/core/i18n/locales/ar.json +399 -354
- package/front_end/core/i18n/locales/as.json +399 -354
- package/front_end/core/i18n/locales/az.json +399 -354
- package/front_end/core/i18n/locales/be.json +399 -354
- package/front_end/core/i18n/locales/bg.json +399 -354
- package/front_end/core/i18n/locales/bn.json +399 -354
- package/front_end/core/i18n/locales/bs.json +400 -355
- package/front_end/core/i18n/locales/ca.json +399 -354
- package/front_end/core/i18n/locales/cs.json +399 -354
- package/front_end/core/i18n/locales/cy.json +399 -354
- package/front_end/core/i18n/locales/da.json +399 -354
- package/front_end/core/i18n/locales/de.json +399 -354
- package/front_end/core/i18n/locales/el.json +399 -354
- package/front_end/core/i18n/locales/en-GB.json +420 -375
- package/front_end/core/i18n/locales/es-419.json +399 -354
- package/front_end/core/i18n/locales/es.json +399 -354
- package/front_end/core/i18n/locales/et.json +399 -354
- package/front_end/core/i18n/locales/eu.json +403 -358
- package/front_end/core/i18n/locales/fa.json +399 -354
- package/front_end/core/i18n/locales/fi.json +399 -354
- package/front_end/core/i18n/locales/fil.json +399 -354
- package/front_end/core/i18n/locales/fr-CA.json +399 -354
- package/front_end/core/i18n/locales/fr.json +399 -354
- package/front_end/core/i18n/locales/gl.json +399 -354
- package/front_end/core/i18n/locales/gu.json +399 -354
- package/front_end/core/i18n/locales/he.json +399 -354
- package/front_end/core/i18n/locales/hi.json +399 -354
- package/front_end/core/i18n/locales/hr.json +399 -354
- package/front_end/core/i18n/locales/hu.json +399 -354
- package/front_end/core/i18n/locales/hy.json +399 -354
- package/front_end/core/i18n/locales/id.json +399 -354
- package/front_end/core/i18n/locales/is.json +399 -354
- package/front_end/core/i18n/locales/it.json +399 -354
- package/front_end/core/i18n/locales/ja.json +399 -354
- package/front_end/core/i18n/locales/ka.json +399 -354
- package/front_end/core/i18n/locales/kk.json +400 -355
- package/front_end/core/i18n/locales/km.json +399 -354
- package/front_end/core/i18n/locales/kn.json +399 -354
- package/front_end/core/i18n/locales/ko.json +399 -354
- package/front_end/core/i18n/locales/ky.json +399 -354
- package/front_end/core/i18n/locales/lo.json +399 -354
- package/front_end/core/i18n/locales/lt.json +399 -354
- package/front_end/core/i18n/locales/lv.json +399 -354
- package/front_end/core/i18n/locales/mk.json +399 -354
- package/front_end/core/i18n/locales/ml.json +399 -354
- package/front_end/core/i18n/locales/mn.json +399 -354
- package/front_end/core/i18n/locales/mr.json +399 -354
- package/front_end/core/i18n/locales/ms.json +399 -354
- package/front_end/core/i18n/locales/my.json +399 -354
- package/front_end/core/i18n/locales/ne.json +399 -354
- package/front_end/core/i18n/locales/nl.json +399 -354
- package/front_end/core/i18n/locales/no.json +399 -354
- package/front_end/core/i18n/locales/or.json +399 -354
- package/front_end/core/i18n/locales/pa.json +410 -365
- package/front_end/core/i18n/locales/pl.json +399 -354
- package/front_end/core/i18n/locales/pt-PT.json +399 -354
- package/front_end/core/i18n/locales/pt.json +399 -354
- package/front_end/core/i18n/locales/ro.json +399 -354
- package/front_end/core/i18n/locales/ru.json +399 -354
- package/front_end/core/i18n/locales/si.json +399 -354
- package/front_end/core/i18n/locales/sk.json +399 -354
- package/front_end/core/i18n/locales/sl.json +399 -354
- package/front_end/core/i18n/locales/sq.json +399 -354
- package/front_end/core/i18n/locales/sr-Latn.json +399 -354
- package/front_end/core/i18n/locales/sr.json +399 -354
- package/front_end/core/i18n/locales/sv.json +399 -354
- package/front_end/core/i18n/locales/sw.json +399 -354
- package/front_end/core/i18n/locales/ta.json +405 -360
- package/front_end/core/i18n/locales/te.json +399 -354
- package/front_end/core/i18n/locales/th.json +399 -354
- package/front_end/core/i18n/locales/tr.json +399 -354
- package/front_end/core/i18n/locales/uk.json +399 -354
- package/front_end/core/i18n/locales/ur.json +399 -354
- package/front_end/core/i18n/locales/uz.json +399 -354
- package/front_end/core/i18n/locales/vi.json +399 -354
- package/front_end/core/i18n/locales/zh-HK.json +399 -354
- package/front_end/core/i18n/locales/zh-TW.json +399 -354
- package/front_end/core/i18n/locales/zh.json +399 -354
- package/front_end/core/i18n/locales/zu.json +399 -354
- package/front_end/core/platform/generate-dcheck.js +2 -2
- package/front_end/core/protocol_client/InspectorBackend.ts +3 -3
- package/front_end/core/sdk/Connections.ts +1 -1
- package/front_end/core/sdk/IsolateManager.ts +1 -1
- package/front_end/core/sdk/PageResourceLoader.ts +4 -2
- package/front_end/core/sdk/ProfileTreeModel.ts +1 -1
- package/front_end/devtools_compatibility.js +9 -0
- package/front_end/entrypoints/main/MainImpl.ts +7 -2
- package/front_end/entrypoints/main/main-meta.ts +24 -24
- package/front_end/generated/SupportedCSSProperties.js +2 -2
- package/front_end/models/extensions/ExtensionAPI.ts +33 -5
- package/front_end/models/extensions/ExtensionServer.ts +28 -0
- package/front_end/models/logs/LogManager.ts +1 -1
- package/front_end/models/persistence/Automapping.ts +32 -4
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
- package/front_end/models/persistence/PersistenceImpl.ts +33 -13
- package/front_end/models/persistence/WorkspaceSettingsTab.ts +0 -1
- package/front_end/models/persistence/workspaceSettingsTab.css +3 -7
- package/front_end/models/workspace/UISourceCode.ts +1 -1
- package/front_end/panels/application/StorageView.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/elements/AccessibilityTreeView.ts +2 -2
- package/front_end/panels/elements/ComputedStyleModel.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +34 -29
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
- package/front_end/panels/elements/elementsPanel.css +10 -4
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/profiler/HeapTimelineOverview.ts +2 -2
- package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +2 -2
- package/front_end/panels/settings/SettingsScreen.ts +1 -1
- package/front_end/panels/settings/settingsScreen.css +11 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
- package/front_end/panels/sources/sources-meta.ts +14 -11
- package/front_end/panels/timeline/TimelineController.ts +2 -2
- package/front_end/panels/timeline/TimelineLoader.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +1 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +76 -12
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +13 -13
- package/front_end/ui/components/buttons/Button.ts +5 -1
- package/front_end/ui/components/buttons/button.css +10 -1
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +2 -2
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +1 -1
- package/front_end/ui/components/text_editor/javascript.ts +1 -1
- package/front_end/ui/legacy/SearchableView.ts +1 -1
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TextPrompt.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +1 -1
- package/front_end/ui/legacy/filter.css +1 -0
- package/front_end/ui/legacy/toolbar.css +2 -0
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +8 -6
- package/scripts/build/generate_html_entrypoint.js +2 -1
- package/scripts/build/ninja/copy-file.js +2 -1
- package/scripts/build/ninja/copy-files.js +2 -1
- package/scripts/build/ninja/generate-declaration.js +2 -1
- package/scripts/build/ninja/node.gni +4 -1
- package/scripts/build/ninja/write-if-changed.js +27 -0
package/.eslintignore
CHANGED
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>
|
@@ -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).
|
22
|
-
const
|
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
|
-
|
35
|
+
writeIfChanged(path.join(targetGenDir, 'Images.prebundle.js'), newContents);
|
36
36
|
|
37
|
-
const tsconfigContent = `
|
38
|
-
{
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
]
|
37
|
+
const tsconfigContent = `{
|
38
|
+
"compilerOptions": {
|
39
|
+
"composite": true
|
40
|
+
},
|
41
|
+
"files": [
|
42
|
+
"Images.js"
|
43
|
+
]
|
45
44
|
}
|
46
45
|
`;
|
47
46
|
|
48
|
-
|
47
|
+
writeIfChanged(path.join(targetGenDir, `${targetName}-tsconfig.json`), tsconfigContent);
|
package/front_end/Tests.js
CHANGED
@@ -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
|
}
|