chrome-devtools-frontend 1.0.967610 → 1.0.969345
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/config/gni/devtools_grd_files.gni +20 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +6 -0
- package/front_end/core/i18n/locales/en-XL.json +6 -0
- package/front_end/core/root/Runtime.ts +1 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +1 -1
- package/front_end/devtools_compatibility.js +0 -36
- package/front_end/entrypoints/main/MainImpl.ts +4 -0
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +265 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestCanceled.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md +1 -0
- package/front_end/panels/application/InterestGroupStorageView.ts +21 -7
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -5
- package/front_end/panels/console/ErrorStackParser.ts +5 -3
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +6 -3
- package/front_end/panels/sources/CSSPlugin.ts +2 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +31 -0
- package/front_end/panels/sources/SourceMapNamesResolver.ts +15 -9
- package/front_end/third_party/codemirror.next/README.chromium +10 -0
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +2 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -2
- package/front_end/third_party/codemirror.next/chunk/python.js +2 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +574 -553
- package/front_end/third_party/codemirror.next/package.json +11 -11
- package/front_end/ui/components/settings/settingCheckbox.css +2 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +13 -34
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +0 -25
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -2
- package/package.json +1 -1
- package/scripts/build/devtools_plugin.js +32 -1
- package/scripts/build/esbuild.js +1 -24
- package/scripts/build/tests/plugins_test.js +60 -1
- package/scripts/devtools_paths.js +1 -29
@@ -5,9 +5,9 @@
|
|
5
5
|
"dependencies": {
|
6
6
|
"@codemirror/autocomplete": "0.19.12",
|
7
7
|
"@codemirror/closebrackets": "0.19.0",
|
8
|
-
"@codemirror/commands": "0.19.
|
8
|
+
"@codemirror/commands": "0.19.8",
|
9
9
|
"@codemirror/comment": "0.19.0",
|
10
|
-
"@codemirror/fold": "0.19.
|
10
|
+
"@codemirror/fold": "0.19.3",
|
11
11
|
"@codemirror/gutter": "0.19.9",
|
12
12
|
"@codemirror/highlight": "0.19.7",
|
13
13
|
"@codemirror/history": "0.19.2",
|
@@ -15,11 +15,11 @@
|
|
15
15
|
"@codemirror/lang-css": "0.19.3",
|
16
16
|
"@codemirror/lang-html": "0.19.4",
|
17
17
|
"@codemirror/lang-java": "0.19.1",
|
18
|
-
"@codemirror/lang-javascript": "0.19.
|
18
|
+
"@codemirror/lang-javascript": "0.19.7",
|
19
19
|
"@codemirror/lang-json": "0.19.1",
|
20
|
-
"@codemirror/lang-markdown": "0.19.
|
20
|
+
"@codemirror/lang-markdown": "0.19.6",
|
21
21
|
"@codemirror/lang-php": "0.19.1",
|
22
|
-
"@codemirror/lang-python": "0.19.
|
22
|
+
"@codemirror/lang-python": "0.19.4",
|
23
23
|
"@codemirror/lang-wast": "0.19.0",
|
24
24
|
"@codemirror/lang-xml": "0.19.2",
|
25
25
|
"@codemirror/language": "0.19.7",
|
@@ -27,14 +27,14 @@
|
|
27
27
|
"@codemirror/matchbrackets": "0.19.3",
|
28
28
|
"@codemirror/panel": "0.19.1",
|
29
29
|
"@codemirror/rangeset": "0.19.6",
|
30
|
-
"@codemirror/search": "0.19.
|
30
|
+
"@codemirror/search": "0.19.6",
|
31
31
|
"@codemirror/state": "0.19.6",
|
32
|
-
"@codemirror/stream-parser": "0.19.
|
33
|
-
"@codemirror/text": "0.19.
|
34
|
-
"@codemirror/tooltip": "0.19.
|
35
|
-
"@codemirror/view": "0.19.
|
32
|
+
"@codemirror/stream-parser": "0.19.5",
|
33
|
+
"@codemirror/text": "0.19.6",
|
34
|
+
"@codemirror/tooltip": "0.19.13",
|
35
|
+
"@codemirror/view": "0.19.42",
|
36
36
|
"@lezer/common": "0.15.11",
|
37
|
-
"@lezer/lr": "0.15.
|
37
|
+
"@lezer/lr": "0.15.8",
|
38
38
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
39
39
|
"rollup-plugin-dts": "^4.0.0",
|
40
40
|
"rollup-plugin-terser": "^7.0.2",
|
@@ -59,7 +59,7 @@ export class ObjectPopoverHelper {
|
|
59
59
|
Promise<ObjectPopoverHelper|null> {
|
60
60
|
const description = Platform.StringUtilities.trimEndWithMaxLength(result.description || '', MaxPopoverTextLength);
|
61
61
|
let popoverContentElement: HTMLSpanElement|HTMLDivElement|null = null;
|
62
|
-
if (result.type === 'object') {
|
62
|
+
if (result.type === 'function' || result.type === 'object') {
|
63
63
|
let linkifier: Components.Linkifier.Linkifier|null = null;
|
64
64
|
let resultHighlightedAsDOM = false;
|
65
65
|
if (result.subtype === 'node') {
|
@@ -74,9 +74,15 @@ export class ObjectPopoverHelper {
|
|
74
74
|
} else {
|
75
75
|
popoverContentElement = document.createElement('div');
|
76
76
|
popoverContentElement.classList.add('object-popover-content');
|
77
|
-
popover.registerCSSFiles([objectPopoverStyles]);
|
78
|
-
const titleElement = popoverContentElement.createChild('div', '
|
79
|
-
|
77
|
+
popover.registerCSSFiles([objectValueStyles, objectPopoverStyles]);
|
78
|
+
const titleElement = popoverContentElement.createChild('div', 'object-popover-title');
|
79
|
+
if (result.type === 'function') {
|
80
|
+
titleElement.classList.add('source-code');
|
81
|
+
titleElement.appendChild(ObjectPropertiesSection.valueElementForFunctionDescription(result.description));
|
82
|
+
} else {
|
83
|
+
titleElement.classList.add('monospace');
|
84
|
+
titleElement.createChild('span').textContent = description;
|
85
|
+
}
|
80
86
|
linkifier = new Components.Linkifier.Linkifier();
|
81
87
|
const section = new ObjectPropertiesSection(result, '', linkifier, true /* showOverflow */);
|
82
88
|
section.element.classList.add('object-popover-tree');
|
@@ -98,39 +104,12 @@ export class ObjectPopoverHelper {
|
|
98
104
|
|
99
105
|
if (result.type === 'string') {
|
100
106
|
UI.UIUtils.createTextChildren(valueElement, `"${description}"`);
|
101
|
-
} else
|
107
|
+
} else {
|
102
108
|
valueElement.textContent = description;
|
103
109
|
}
|
104
110
|
|
105
|
-
|
106
|
-
|
107
|
-
return new ObjectPopoverHelper(null, false);
|
108
|
-
}
|
109
|
-
|
110
|
-
void ObjectPropertiesSection.formatObjectAsFunction(result, valueElement, true);
|
111
|
-
const response = await result.debuggerModel().functionDetailsPromise(result);
|
112
|
-
if (!response) {
|
113
|
-
return null;
|
114
|
-
}
|
115
|
-
|
116
|
-
const container = document.createElement('div');
|
117
|
-
container.classList.add('object-popover-container');
|
118
|
-
const title = container.createChild('div', 'function-popover-title source-code');
|
119
|
-
const functionName = title.createChild('span', 'function-name');
|
120
|
-
functionName.textContent = UI.UIUtils.beautifyFunctionName(response.functionName);
|
121
|
-
|
122
|
-
const rawLocation = response.location;
|
123
|
-
const linkContainer = title.createChild('div', 'function-title-link-container');
|
124
|
-
const script = rawLocation && rawLocation.script();
|
125
|
-
const sourceURL = script && script.sourceURL;
|
126
|
-
let linkifier: Components.Linkifier.Linkifier|null = null;
|
127
|
-
if (sourceURL) {
|
128
|
-
linkifier = new Components.Linkifier.Linkifier(undefined, undefined, popover.positionContent.bind(popover));
|
129
|
-
linkContainer.appendChild(linkifier.linkifyRawLocation((rawLocation as SDK.DebuggerModel.Location), sourceURL));
|
130
|
-
}
|
131
|
-
container.appendChild(popoverContentElement);
|
132
|
-
popover.contentElement.appendChild(container);
|
133
|
-
return new ObjectPopoverHelper(linkifier, false);
|
111
|
+
popover.contentElement.appendChild(popoverContentElement);
|
112
|
+
return new ObjectPopoverHelper(null, false);
|
134
113
|
}
|
135
114
|
}
|
136
115
|
|
@@ -260,7 +260,7 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
260
260
|
return UI.Fragment.html`<span class="name">${name}</span>`;
|
261
261
|
}
|
262
262
|
|
263
|
-
static valueElementForFunctionDescription(description?: string
|
263
|
+
static valueElementForFunctionDescription(description?: string, includePreview?: boolean, defaultName?: string):
|
264
264
|
Element {
|
265
265
|
const valueElement = document.createElement('span');
|
266
266
|
valueElement.classList.add('object-value-function');
|
@@ -30,28 +30,3 @@
|
|
30
30
|
.object-popover-container {
|
31
31
|
display: inline-block;
|
32
32
|
}
|
33
|
-
|
34
|
-
.function-popover-title {
|
35
|
-
border-bottom: 1px solid var(--color-details-hairline);
|
36
|
-
margin-bottom: 3px;
|
37
|
-
padding-bottom: 2px;
|
38
|
-
display: flex;
|
39
|
-
justify-content: space-between;
|
40
|
-
align-items: center;
|
41
|
-
}
|
42
|
-
|
43
|
-
.function-popover-title .function-name {
|
44
|
-
font-weight: bold;
|
45
|
-
}
|
46
|
-
|
47
|
-
.function-title-link-container {
|
48
|
-
display: flex;
|
49
|
-
align-items: center;
|
50
|
-
position: relative;
|
51
|
-
margin-left: 10px;
|
52
|
-
}
|
53
|
-
|
54
|
-
.function-title-link-container .devtools-link {
|
55
|
-
white-space: nowrap;
|
56
|
-
overflow: hidden;
|
57
|
-
}
|
@@ -388,8 +388,8 @@ export class TimelineOverviewBase extends UI.Widget.VBox implements TimelineOver
|
|
388
388
|
reset(): void {
|
389
389
|
}
|
390
390
|
|
391
|
-
overviewInfoPromise(_x: number): Promise<Element|null> {
|
392
|
-
return
|
391
|
+
async overviewInfoPromise(_x: number): Promise<Element|null> {
|
392
|
+
return null;
|
393
393
|
}
|
394
394
|
|
395
395
|
setCalculator(calculator: TimelineOverviewCalculator): void {
|
@@ -578,8 +578,10 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
578
578
|
if (this.lineToScrollTo !== null) {
|
579
579
|
if (this.loaded && this.isShowing()) {
|
580
580
|
const {textEditor} = this;
|
581
|
-
|
582
|
-
|
581
|
+
// DevTools history items are 0-based, but CodeMirror is 1-based, so we have to increment the
|
582
|
+
// line we want to scroll to by 1.
|
583
|
+
const position = textEditor.toOffset({lineNumber: this.lineToScrollTo + 1, columnNumber: 0});
|
584
|
+
textEditor.dispatch({effects: CodeMirror.EditorView.scrollIntoView(position, {y: 'start'})});
|
583
585
|
this.lineToScrollTo = null;
|
584
586
|
}
|
585
587
|
}
|
package/package.json
CHANGED
@@ -111,4 +111,35 @@ function devtoolsPlugin(source, importer) {
|
|
111
111
|
};
|
112
112
|
}
|
113
113
|
|
114
|
-
|
114
|
+
function esbuildPlugin(outdir) {
|
115
|
+
return args => {
|
116
|
+
// args.importer is absolute path in esbuild.
|
117
|
+
const res = devtoolsPlugin(args.path, args.importer);
|
118
|
+
if (!res) {
|
119
|
+
return null;
|
120
|
+
}
|
121
|
+
|
122
|
+
if (res.external) {
|
123
|
+
// res.id can be both of absolutized local JavaScript path or node's
|
124
|
+
// builtin module (e.g. 'fs', 'path'), and only relativize the path in
|
125
|
+
// former case.
|
126
|
+
if (path.isAbsolute(res.id)) {
|
127
|
+
res.id = './' + path.relative(outdir, res.id);
|
128
|
+
}
|
129
|
+
|
130
|
+
return {
|
131
|
+
external: res.external,
|
132
|
+
path: res.id,
|
133
|
+
};
|
134
|
+
}
|
135
|
+
|
136
|
+
return {
|
137
|
+
path: res.id,
|
138
|
+
};
|
139
|
+
};
|
140
|
+
}
|
141
|
+
|
142
|
+
module.exports = {
|
143
|
+
devtoolsPlugin,
|
144
|
+
esbuildPlugin
|
145
|
+
};
|
package/scripts/build/esbuild.js
CHANGED
@@ -21,30 +21,7 @@ const plugin = {
|
|
21
21
|
name: 'devtools-plugin',
|
22
22
|
setup(build) {
|
23
23
|
// https://esbuild.github.io/plugins/#on-resolve
|
24
|
-
build.onResolve({filter: /.*/},
|
25
|
-
const res = devtools_plugin.devtoolsPlugin(args.path, args.importer);
|
26
|
-
if (!res) {
|
27
|
-
return null;
|
28
|
-
}
|
29
|
-
|
30
|
-
if (res.external) {
|
31
|
-
// res.id can be both of absolutized local JavaScript path or node's
|
32
|
-
// builtin module (e.g. 'fs', 'path'), and only relativize the path in
|
33
|
-
// former case.
|
34
|
-
if (path.isAbsolute(res.id)) {
|
35
|
-
res.id = './' + path.relative(outdir, res.id);
|
36
|
-
}
|
37
|
-
|
38
|
-
return {
|
39
|
-
external: res.external,
|
40
|
-
path: res.id,
|
41
|
-
};
|
42
|
-
}
|
43
|
-
|
44
|
-
return {
|
45
|
-
path: res.id,
|
46
|
-
};
|
47
|
-
});
|
24
|
+
build.onResolve({filter: /.*/}, devtools_plugin.esbuildPlugin(outdir));
|
48
25
|
},
|
49
26
|
};
|
50
27
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
const {assert} = require('chai');
|
6
6
|
const path = require('path');
|
7
7
|
|
8
|
-
const {devtoolsPlugin} = require('../devtools_plugin.js');
|
8
|
+
const {devtoolsPlugin, esbuildPlugin} = require('../devtools_plugin.js');
|
9
9
|
|
10
10
|
describe('devtools_plugin can compute paths with', () => {
|
11
11
|
it('same directory import', () => {
|
@@ -27,4 +27,63 @@ describe('devtools_plugin can compute paths with', () => {
|
|
27
27
|
it('importing generated files', () => {
|
28
28
|
assert.strictEqual(devtoolsPlugin('../../generated/Protocol.js', 'front_end/core/sdk/FirstFile.js'), null);
|
29
29
|
});
|
30
|
+
|
31
|
+
it('importing lighthouse files', () => {
|
32
|
+
assert.deepEqual(
|
33
|
+
devtoolsPlugin('./front_end/third_party/lighthouse/lighthouse-dt-bundle.js', 'front_end/core/sdk/FirstFile.js'),
|
34
|
+
{
|
35
|
+
id: path.join(
|
36
|
+
'front_end', 'core', 'sdk', 'front_end', 'third_party', 'lighthouse', 'lighthouse-dt-bundle.js'),
|
37
|
+
external: true,
|
38
|
+
});
|
39
|
+
});
|
40
|
+
});
|
41
|
+
|
42
|
+
describe('esbuild_plugin can compute paths with', () => {
|
43
|
+
const srcdir = __dirname;
|
44
|
+
const outdir = path.join(srcdir, 'out');
|
45
|
+
const plugin = esbuildPlugin(outdir);
|
46
|
+
it('same directory import', () => {
|
47
|
+
assert.deepEqual(
|
48
|
+
plugin({path: './AnotherFile.js', importer: path.join(srcdir, 'front_end/core/sdk/FirstFile.js')}),
|
49
|
+
{path: path.join(srcdir, 'front_end', 'core', 'sdk', 'AnotherFile.js')});
|
50
|
+
});
|
51
|
+
|
52
|
+
it('different directory import', () => {
|
53
|
+
assert.deepEqual(
|
54
|
+
plugin({path: '../common/common.js', importer: path.join(srcdir, 'front_end/core/sdk/FirstFile.js')}),
|
55
|
+
{path: './' + path.join('..', 'front_end', 'core', 'common', 'common.js'), external: true});
|
56
|
+
});
|
57
|
+
|
58
|
+
it('node built-in modules', () => {
|
59
|
+
assert.deepEqual(
|
60
|
+
plugin({path: 'fs', importer: path.join(srcdir, 'scripts/some-script.js')}), {path: 'fs', external: true});
|
61
|
+
});
|
62
|
+
|
63
|
+
it('codemirror modules', () => {
|
64
|
+
assert.deepEqual(
|
65
|
+
plugin({path: '../../lib/codemirror', importer: path.join(srcdir, 'scripts/some-script.js')}),
|
66
|
+
{path: '../../lib/codemirror', external: true});
|
67
|
+
});
|
68
|
+
|
69
|
+
it('importing generated files', () => {
|
70
|
+
assert.strictEqual(
|
71
|
+
plugin({path: '../../generated/Protocol.js', importer: path.join(srcdir, 'front_end/core/sdk/FirstFile.js')}),
|
72
|
+
null);
|
73
|
+
});
|
74
|
+
|
75
|
+
it('importing lighthouse files', () => {
|
76
|
+
assert.deepEqual(
|
77
|
+
plugin({
|
78
|
+
path: './front_end/third_party/lighthouse/lighthouse-dt-bundle.js',
|
79
|
+
importer: path.join(srcdir, 'front_end/core/sdk/FirstFile.js')
|
80
|
+
}),
|
81
|
+
{
|
82
|
+
path: './' +
|
83
|
+
path.join(
|
84
|
+
'..', 'front_end', 'core', 'sdk', 'front_end', 'third_party', 'lighthouse',
|
85
|
+
'lighthouse-dt-bundle.js'),
|
86
|
+
external: true,
|
87
|
+
});
|
88
|
+
});
|
30
89
|
});
|
@@ -34,16 +34,6 @@ const os = require('os');
|
|
34
34
|
*/
|
35
35
|
const PATH_TO_EXECUTED_FILE = process.argv[1];
|
36
36
|
|
37
|
-
function pathIsMostTopLevelPath(filePath) {
|
38
|
-
/**
|
39
|
-
* On Linux/Mac, if we do path.dirname(X) as many times as possible, it will
|
40
|
-
* eventually equal `/`. On Windows, it will end up equalling C:\, and
|
41
|
-
* path.dirname('C:\') === 'C:\', so we use that to figure out if we've made
|
42
|
-
* it as far up the tree as we can.
|
43
|
-
*/
|
44
|
-
return filePath === path.sep || path.dirname(filePath) === filePath;
|
45
|
-
}
|
46
|
-
|
47
37
|
const _lookUpCaches = new Map(
|
48
38
|
[['chromium', null]],
|
49
39
|
);
|
@@ -73,25 +63,7 @@ function isInChromiumDirectory() {
|
|
73
63
|
* If it's standalone, it will be /path/to/devtools-frontend
|
74
64
|
*/
|
75
65
|
function devtoolsRootPath() {
|
76
|
-
|
77
|
-
let devtoolsRootFolder = nodeScriptFileThatIsBeingExecuted;
|
78
|
-
while (path.basename(devtoolsRootFolder) !== 'devtools-frontend') {
|
79
|
-
devtoolsRootFolder = path.dirname(devtoolsRootFolder);
|
80
|
-
// We reached the end and can't find devtools-frontend.
|
81
|
-
if (pathIsMostTopLevelPath(devtoolsRootFolder)) {
|
82
|
-
throw new Error(
|
83
|
-
'Could not find devtools-frontend in path. If you have cloned the repository to a different directory name, it will not work.');
|
84
|
-
}
|
85
|
-
}
|
86
|
-
// In Chromium the path to the source code for devtools-frontend is:
|
87
|
-
// third_party/devtools-frontend/src
|
88
|
-
const {isInChromium} = isInChromiumDirectory();
|
89
|
-
if (isInChromium) {
|
90
|
-
return path.join(devtoolsRootFolder, 'src');
|
91
|
-
}
|
92
|
-
|
93
|
-
// But if you're in a standalone repo it's just the devtools-frontend folder.
|
94
|
-
return devtoolsRootFolder;
|
66
|
+
return path.dirname(__dirname);
|
95
67
|
}
|
96
68
|
|
97
69
|
/**
|