chrome-devtools-frontend 1.0.1021582 → 1.0.1022059
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 +14 -1
- package/extension-api/ExtensionAPI.d.ts +54 -4
- package/front_end/.eslintrc.js +3 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +18 -0
- package/front_end/core/i18n/locales/en-US.json +27 -0
- package/front_end/core/i18n/locales/en-XL.json +27 -0
- package/front_end/devtools_compatibility.js +1 -0
- package/front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js +4 -3
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +157 -117
- package/front_end/models/extensions/ExtensionAPI.ts +101 -13
- package/front_end/models/extensions/ExtensionServer.ts +63 -1
- package/front_end/models/extensions/LanguageExtensionEndpoint.ts +16 -3
- package/front_end/models/timeline_model/TimelineModel.ts +164 -7
- package/front_end/panels/application/AppManifestView.ts +13 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +67 -5
- package/front_end/panels/elements/ElementsTreeOutline.ts +41 -7
- package/front_end/panels/elements/TopLayerContainer.ts +9 -1
- package/front_end/panels/elements/components/AdornerManager.ts +7 -0
- package/front_end/panels/elements/elementsTreeOutline.css +4 -0
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/third_party/chromium/client-variations/client-variations.ts +1 -1
- package/front_end/third_party/diff/DiffWrapper.ts +2 -0
- package/front_end/third_party/i18n/i18n-impl.ts +5 -1
- package/front_end/third_party/i18n/i18n.ts +1 -1
- package/front_end/third_party/i18n/locales.ts +1 -1
- package/front_end/third_party/marked/marked.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer.ts +6 -6
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +23 -1
- package/front_end/ui/legacy/ReportView.ts +8 -0
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/custom_element_definitions_location.js +28 -13
- package/scripts/eslint_rules/lib/es_modules_import.js +5 -1
- package/scripts/eslint_rules/tests/custom_element_definitions_location_test.js +9 -2
- package/scripts/eslint_rules/tests/es_modules_import_test.js +5 -0
@@ -2,7 +2,7 @@
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
3
3
|
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
4
4
|
|
5
|
-
export const LOCALES:
|
5
|
+
export const LOCALES: readonly Intl.UnicodeBCP47LocaleIdentifier[] = [
|
6
6
|
'af',
|
7
7
|
'am',
|
8
8
|
'ar',
|
@@ -2,11 +2,11 @@
|
|
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
4
|
|
5
|
-
import { Browser } from
|
6
|
-
import { Connection } from
|
7
|
-
import { type ConnectionTransport } from
|
8
|
-
import { Frame } from
|
9
|
-
import { ElementHandle } from
|
10
|
-
import { Page } from
|
5
|
+
import { Browser } from './package/lib/esm/puppeteer/common/Browser.js';
|
6
|
+
import { Connection } from './package/lib/esm/puppeteer/common/Connection.js';
|
7
|
+
import { type ConnectionTransport } from './package/lib/esm/puppeteer/common/ConnectionTransport.js';
|
8
|
+
import { Frame } from './package/lib/esm/puppeteer/common/FrameManager.js';
|
9
|
+
import { ElementHandle } from './package/lib/esm/puppeteer/common/ElementHandle.js';
|
10
|
+
import { Page } from './package/lib/esm/puppeteer/common/Page.js';
|
11
11
|
|
12
12
|
export { Browser, Connection, ConnectionTransport, ElementHandle, Frame, Page };
|
@@ -79,7 +79,13 @@ async function getBufferFromObject(obj: SDK.RemoteObject.RemoteObject): Promise<
|
|
79
79
|
}
|
80
80
|
|
81
81
|
export function isDWARFMemoryObject(obj: SDK.RemoteObject.RemoteObject): boolean {
|
82
|
-
|
82
|
+
if (obj instanceof Bindings.DebuggerLanguagePlugins.ValueNode) {
|
83
|
+
return obj.inspectableAddress !== undefined;
|
84
|
+
}
|
85
|
+
if (obj instanceof Bindings.DebuggerLanguagePlugins.ExtensionRemoteObject) {
|
86
|
+
return obj.linearMemoryAddress !== undefined;
|
87
|
+
}
|
88
|
+
return false;
|
83
89
|
}
|
84
90
|
|
85
91
|
export function isMemoryObjectProperty(obj: SDK.RemoteObject.RemoteObject): boolean {
|
@@ -169,6 +175,22 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
|
|
169
175
|
|
170
176
|
static async retrieveDWARFMemoryObjectAndAddress(obj: SDK.RemoteObject.RemoteObject):
|
171
177
|
Promise<{obj: SDK.RemoteObject.RemoteObject, address: number}|undefined> {
|
178
|
+
if (obj instanceof Bindings.DebuggerLanguagePlugins.ExtensionRemoteObject) {
|
179
|
+
const valueNode = obj;
|
180
|
+
const address = valueNode.linearMemoryAddress || 0;
|
181
|
+
const callFrame = valueNode.callFrame;
|
182
|
+
const response = await obj.debuggerModel().agent.invoke_evaluateOnCallFrame({
|
183
|
+
callFrameId: callFrame.id,
|
184
|
+
expression: 'memories[0]',
|
185
|
+
});
|
186
|
+
const error = response.getError();
|
187
|
+
if (error) {
|
188
|
+
console.error(error);
|
189
|
+
Common.Console.Console.instance().error(i18nString(UIStrings.couldNotOpenLinearMemory));
|
190
|
+
}
|
191
|
+
const runtimeModel = obj.debuggerModel().runtimeModel();
|
192
|
+
return {obj: runtimeModel.createRemoteObject(response.result), address};
|
193
|
+
}
|
172
194
|
if (!(obj instanceof Bindings.DebuggerLanguagePlugins.ValueNode)) {
|
173
195
|
return;
|
174
196
|
}
|
@@ -36,6 +36,10 @@ export class ReportView extends VBox {
|
|
36
36
|
this.sectionList = this.contentBox.createChild('div', 'vbox');
|
37
37
|
}
|
38
38
|
|
39
|
+
getHeaderElement(): Element {
|
40
|
+
return this.headerElement;
|
41
|
+
}
|
42
|
+
|
39
43
|
setTitle(title: string): void {
|
40
44
|
if (this.titleElement.textContent === title) {
|
41
45
|
return;
|
@@ -122,6 +126,10 @@ export class Section extends VBox {
|
|
122
126
|
return this.titleElement.textContent || '';
|
123
127
|
}
|
124
128
|
|
129
|
+
getTitleElement(): Element {
|
130
|
+
return this.titleElement;
|
131
|
+
}
|
132
|
+
|
125
133
|
setTitle(title: string, tooltip?: string): void {
|
126
134
|
if (this.titleElement.textContent !== title) {
|
127
135
|
this.titleElement.textContent = title;
|
package/package.json
CHANGED
@@ -5,18 +5,6 @@
|
|
5
5
|
|
6
6
|
const path = require('path');
|
7
7
|
|
8
|
-
const FRONT_END_DIRECTORY = path.join(__dirname, '..', '..', '..', 'front_end');
|
9
|
-
const PANELS_DIRECTORY = path.join(FRONT_END_DIRECTORY, 'panels');
|
10
|
-
|
11
|
-
const ALLOWED_CUSTOM_ELEMENT_LOCATIONS = new Set([
|
12
|
-
path.join(FRONT_END_DIRECTORY, 'ui', 'components'),
|
13
|
-
|
14
|
-
// These should be moved to `ui/components` at some point
|
15
|
-
path.join(FRONT_END_DIRECTORY, 'ui', 'legacy', 'components', 'inline_editor'),
|
16
|
-
path.join(FRONT_END_DIRECTORY, 'ui', 'legacy', 'components', 'perf_ui', 'PieChart.ts'),
|
17
|
-
path.join(FRONT_END_DIRECTORY, 'ui', 'legacy', 'XElement.ts'),
|
18
|
-
]);
|
19
|
-
|
20
8
|
module.exports = {
|
21
9
|
meta: {
|
22
10
|
type: 'problem',
|
@@ -32,11 +20,38 @@ module.exports = {
|
|
32
20
|
'either place it in `ui/components/` or in a `components` sub-folder of a panel. ' +
|
33
21
|
'E.g. `panels/elements/components/`.'
|
34
22
|
},
|
35
|
-
schema: [
|
23
|
+
schema: [{
|
24
|
+
'type': 'object',
|
25
|
+
'properties': {
|
26
|
+
'rootFrontendDirectory': {
|
27
|
+
'type': 'string',
|
28
|
+
},
|
29
|
+
},
|
30
|
+
additionalProperties: false,
|
31
|
+
}]
|
36
32
|
},
|
37
33
|
create: function(context) {
|
38
34
|
const classDefiningFileName = path.resolve(context.getFilename());
|
39
35
|
|
36
|
+
let frontEndDirectory = '';
|
37
|
+
if (context.options?.[0]?.rootFrontendDirectory) {
|
38
|
+
frontEndDirectory = context.options[0].rootFrontendDirectory;
|
39
|
+
}
|
40
|
+
if (!frontEndDirectory) {
|
41
|
+
throw new Error('rootFrontEndDirectory must be provided to custom_elements_definitions_location.');
|
42
|
+
}
|
43
|
+
|
44
|
+
const PANELS_DIRECTORY = path.join(frontEndDirectory, 'panels');
|
45
|
+
|
46
|
+
const ALLOWED_CUSTOM_ELEMENT_LOCATIONS = new Set([
|
47
|
+
path.join(frontEndDirectory, 'ui', 'components'),
|
48
|
+
|
49
|
+
// These should be moved to `ui/components` at some point
|
50
|
+
path.join(frontEndDirectory, 'ui', 'legacy', 'components', 'inline_editor'),
|
51
|
+
path.join(frontEndDirectory, 'ui', 'legacy', 'components', 'perf_ui', 'PieChart.ts'),
|
52
|
+
path.join(frontEndDirectory, 'ui', 'legacy', 'XElement.ts'),
|
53
|
+
]);
|
54
|
+
|
40
55
|
return {
|
41
56
|
['ClassDeclaration[superClass.name=\'HTMLElement\']'](node) {
|
42
57
|
for (const allowedLocation of ALLOWED_CUSTOM_ELEMENT_LOCATIONS) {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
const path = require('path');
|
12
12
|
|
13
13
|
const FRONT_END_DIRECTORY = path.join(__dirname, '..', '..', '..', 'front_end');
|
14
|
+
const THIRD_PARTY_DIRECTORY = path.join(FRONT_END_DIRECTORY, 'third_party');
|
14
15
|
const INSPECTOR_OVERLAY_DIRECTORY = path.join(__dirname, '..', '..', '..', 'front_end', 'inspector_overlay');
|
15
16
|
const COMPONENT_DOCS_DIRECTORY = path.join(FRONT_END_DIRECTORY, 'ui', 'components', 'docs');
|
16
17
|
|
@@ -164,7 +165,10 @@ module.exports = {
|
|
164
165
|
});
|
165
166
|
}
|
166
167
|
|
167
|
-
|
168
|
+
// the Module import rules do not apply within:
|
169
|
+
// 1. inspector_overlay
|
170
|
+
// 2. front_end/third_party
|
171
|
+
if (importingFileName.startsWith(INSPECTOR_OVERLAY_DIRECTORY) || importingFileName.startsWith(THIRD_PARTY_DIRECTORY)) {
|
168
172
|
return;
|
169
173
|
}
|
170
174
|
|
@@ -4,6 +4,7 @@
|
|
4
4
|
'use strict';
|
5
5
|
|
6
6
|
const rule = require('../lib/custom_element_definitions_location.js');
|
7
|
+
const path = require('path');
|
7
8
|
const ruleTester = new (require('eslint').RuleTester)({
|
8
9
|
parserOptions: {ecmaVersion: 9, sourceType: 'module'},
|
9
10
|
parser: require.resolve('@typescript-eslint/parser'),
|
@@ -14,30 +15,36 @@ ruleTester.run('custom_element_definitions_location', rule, {
|
|
14
15
|
{
|
15
16
|
code: 'class Foo extends HTMLElement {}',
|
16
17
|
filename: 'front_end/ui/components/foo/Foo.ts',
|
18
|
+
options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
|
17
19
|
},
|
18
20
|
{
|
19
21
|
code: 'class Foo extends HTMLElement {}',
|
20
22
|
filename: 'front_end/panels/issues/components/Foo.ts',
|
23
|
+
options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
|
21
24
|
},
|
22
25
|
{
|
23
26
|
code: 'class Foo extends HTMLElement {}',
|
24
27
|
filename: 'front_end/panels/issues/components/nested/folder/Foo.ts',
|
28
|
+
options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
|
25
29
|
},
|
26
30
|
{
|
27
31
|
code: 'class Foo extends OtherClass {}',
|
28
32
|
filename: 'front_end/models/some/Model.ts',
|
33
|
+
options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
|
29
34
|
},
|
30
35
|
],
|
31
36
|
invalid: [
|
32
37
|
{
|
33
38
|
code: 'class Foo extends HTMLElement {}',
|
34
39
|
filename: 'front_end/panels/issues/IssuesPanel.ts',
|
35
|
-
errors: [{messageId: 'definitionInWrongFolder'}]
|
40
|
+
errors: [{messageId: 'definitionInWrongFolder'}],
|
41
|
+
options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
|
36
42
|
},
|
37
43
|
{
|
38
44
|
code: 'class Foo extends HTMLElement {}',
|
39
45
|
filename: 'front_end/models/bindings/Bindings.ts',
|
40
|
-
errors: [{messageId: 'definitionInWrongFolder'}]
|
46
|
+
errors: [{messageId: 'definitionInWrongFolder'}],
|
47
|
+
options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
|
41
48
|
},
|
42
49
|
]
|
43
50
|
});
|
@@ -127,6 +127,11 @@ ruleTester.run('es_modules_import', rule, {
|
|
127
127
|
{
|
128
128
|
code: 'import checkboxStyles from \'./checkbox.css.js\';',
|
129
129
|
filename: 'front_end/ui/components/input/input.ts',
|
130
|
+
},
|
131
|
+
{
|
132
|
+
// Valid even though it breaks the rules, because it's in front_end/third_party.
|
133
|
+
code: 'import { Browser } from "./package/lib/esm/puppeteer/common/Browser.js";',
|
134
|
+
filename: 'front_end/third_party/puppeteer/puppeteer.ts',
|
130
135
|
}
|
131
136
|
],
|
132
137
|
|