chrome-devtools-frontend 1.0.952784 → 1.0.953776
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 +4 -0
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/.eslintrc.js +1 -0
- package/front_end/Images/src/info-icon.svg +1 -0
- package/front_end/core/common/ParsedURL.ts +31 -0
- package/front_end/core/host/UserMetrics.ts +515 -481
- package/front_end/core/i18n/i18nImpl.ts +8 -30
- package/front_end/core/i18n/locales/af.json +158 -176
- package/front_end/core/i18n/locales/am.json +163 -181
- package/front_end/core/i18n/locales/ar.json +162 -180
- package/front_end/core/i18n/locales/as.json +163 -181
- package/front_end/core/i18n/locales/az.json +161 -179
- package/front_end/core/i18n/locales/be.json +160 -178
- package/front_end/core/i18n/locales/bg.json +159 -177
- package/front_end/core/i18n/locales/bn.json +166 -184
- package/front_end/core/i18n/locales/bs.json +161 -179
- package/front_end/core/i18n/locales/ca.json +159 -177
- package/front_end/core/i18n/locales/cs.json +159 -177
- package/front_end/core/i18n/locales/cy.json +164 -182
- package/front_end/core/i18n/locales/da.json +158 -176
- package/front_end/core/i18n/locales/de.json +160 -178
- package/front_end/core/i18n/locales/el.json +158 -176
- package/front_end/core/i18n/locales/en-GB.json +158 -176
- package/front_end/core/i18n/locales/en-US.json +48 -0
- package/front_end/core/i18n/locales/en-XL.json +48 -0
- package/front_end/core/i18n/locales/es-419.json +160 -178
- package/front_end/core/i18n/locales/es.json +156 -174
- package/front_end/core/i18n/locales/et.json +161 -179
- package/front_end/core/i18n/locales/eu.json +159 -177
- package/front_end/core/i18n/locales/fa.json +166 -184
- package/front_end/core/i18n/locales/fi.json +161 -179
- package/front_end/core/i18n/locales/fil.json +162 -180
- package/front_end/core/i18n/locales/fr-CA.json +159 -177
- package/front_end/core/i18n/locales/fr.json +158 -176
- package/front_end/core/i18n/locales/gl.json +160 -178
- package/front_end/core/i18n/locales/gu.json +179 -197
- package/front_end/core/i18n/locales/he.json +160 -178
- package/front_end/core/i18n/locales/hi.json +166 -184
- package/front_end/core/i18n/locales/hr.json +161 -179
- package/front_end/core/i18n/locales/hu.json +161 -179
- package/front_end/core/i18n/locales/hy.json +157 -175
- package/front_end/core/i18n/locales/id.json +160 -178
- package/front_end/core/i18n/locales/is.json +163 -181
- package/front_end/core/i18n/locales/it.json +162 -180
- package/front_end/core/i18n/locales/ja.json +160 -178
- package/front_end/core/i18n/locales/ka.json +161 -179
- package/front_end/core/i18n/locales/kk.json +164 -182
- package/front_end/core/i18n/locales/km.json +160 -178
- package/front_end/core/i18n/locales/kn.json +162 -180
- package/front_end/core/i18n/locales/ko.json +162 -180
- package/front_end/core/i18n/locales/ky.json +160 -178
- package/front_end/core/i18n/locales/lo.json +159 -177
- package/front_end/core/i18n/locales/lt.json +159 -177
- package/front_end/core/i18n/locales/lv.json +162 -180
- package/front_end/core/i18n/locales/mk.json +162 -180
- package/front_end/core/i18n/locales/ml.json +160 -178
- package/front_end/core/i18n/locales/mn.json +164 -182
- package/front_end/core/i18n/locales/mr.json +163 -181
- package/front_end/core/i18n/locales/ms.json +163 -181
- package/front_end/core/i18n/locales/my.json +164 -182
- package/front_end/core/i18n/locales/ne.json +160 -178
- package/front_end/core/i18n/locales/nl.json +160 -178
- package/front_end/core/i18n/locales/no.json +281 -299
- package/front_end/core/i18n/locales/or.json +165 -183
- package/front_end/core/i18n/locales/pa.json +159 -177
- package/front_end/core/i18n/locales/pl.json +163 -181
- package/front_end/core/i18n/locales/pt-PT.json +160 -178
- package/front_end/core/i18n/locales/pt.json +159 -177
- package/front_end/core/i18n/locales/ro.json +161 -179
- package/front_end/core/i18n/locales/ru.json +159 -177
- package/front_end/core/i18n/locales/si.json +161 -179
- package/front_end/core/i18n/locales/sk.json +158 -176
- package/front_end/core/i18n/locales/sl.json +160 -178
- package/front_end/core/i18n/locales/sq.json +279 -297
- package/front_end/core/i18n/locales/sr-Latn.json +160 -178
- package/front_end/core/i18n/locales/sr.json +160 -178
- package/front_end/core/i18n/locales/sv.json +159 -177
- package/front_end/core/i18n/locales/sw.json +164 -182
- package/front_end/core/i18n/locales/ta.json +160 -178
- package/front_end/core/i18n/locales/te.json +165 -183
- package/front_end/core/i18n/locales/th.json +158 -176
- package/front_end/core/i18n/locales/tr.json +162 -180
- package/front_end/core/i18n/locales/uk.json +160 -178
- package/front_end/core/i18n/locales/ur.json +160 -178
- package/front_end/core/i18n/locales/uz.json +160 -178
- package/front_end/core/i18n/locales/vi.json +162 -180
- package/front_end/core/i18n/locales/zh-HK.json +160 -178
- package/front_end/core/i18n/locales/zh-TW.json +161 -179
- package/front_end/core/i18n/locales/zh.json +162 -180
- package/front_end/core/i18n/locales/zu.json +164 -182
- package/front_end/core/sdk/ChildTargetManager.ts +1 -0
- package/front_end/core/sdk/PageResourceLoader.ts +1 -2
- package/front_end/panels/application/components/BackForwardCacheStrings.ts +93 -15
- package/front_end/panels/application/components/EndpointsGrid.ts +1 -1
- package/front_end/panels/elements/components/elementsBreadcrumbs.css +2 -0
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +2 -0
- package/front_end/panels/network/NetworkDataGridNode.ts +0 -2
- package/front_end/panels/network/components/WebBundleInfoView.ts +1 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +188 -185
- package/front_end/third_party/lighthouse/locales/en-US.json +1 -1
- package/front_end/third_party/lighthouse/locales/en-XL.json +1 -1
- package/front_end/third_party/lighthouse/report/bundle.js +3 -3
- package/front_end/third_party/lighthouse/report-assets/report-generator.js +1 -1
- package/front_end/third_party/puppeteer/package/README.md +11 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +20 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +13 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +20 -11
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +13 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/ui/components/docs/component_docs.ts +4 -4
- package/front_end/ui/components/docs/component_docs_styles.css +51 -0
- package/front_end/ui/components/input/checkbox.css +11 -0
- package/front_end/ui/components/input/input.ts +3 -3
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +2 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +2 -1
- package/front_end/ui/components/settings/settingCheckbox.css +0 -5
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +10 -3
- package/front_end/ui/legacy/UIUtils.ts +0 -12
- package/front_end/ui/legacy/themeColors.css +1 -0
- package/inspector_overlay/main.ts +2 -16
- package/package.json +1 -1
- package/scripts/check_experiments.js +3 -6
- package/scripts/component_server/server.js +4 -12
- package/scripts/eslint_rules/lib/check_enumerated_histograms.js +32 -0
- package/scripts/eslint_rules/lib/lit_html_host_this.js +1 -10
- package/scripts/eslint_rules/lib/utils.js +20 -1
- package/scripts/eslint_rules/tests/check_enumerated_histograms_test.js +32 -0
- package/scripts/eslint_rules/tests/utils_test.js +30 -0
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ const parseOptions = {
|
|
|
15
15
|
range: true,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const USER_METRICS_ENUM_ENDPOINT = '
|
|
18
|
+
const USER_METRICS_ENUM_ENDPOINT = 'MaxValue';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Determines if a node is a class declaration.
|
|
@@ -162,8 +162,7 @@ function getMainImplExperimentList(mainImplFile, experimentNames) {
|
|
|
162
162
|
* Determines if AST Node is the DevtoolsExperiments Enum declaration
|
|
163
163
|
*/
|
|
164
164
|
function isExperimentEnumDeclaration(node) {
|
|
165
|
-
return node.type === 'ExportNamedDeclaration' && node
|
|
166
|
-
node.declaration.declarations[0].id.name === 'DevtoolsExperiments';
|
|
165
|
+
return node.type === 'ExportNamedDeclaration' && node?.declaration?.id?.name === 'DevtoolsExperiments';
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
/**
|
|
@@ -173,9 +172,7 @@ function getUserMetricExperimentList(userMetricsFile) {
|
|
|
173
172
|
const userMetricsAST = espree.parse(userMetricsFile, {ecmaVersion: 11, sourceType: 'module', range: true});
|
|
174
173
|
for (const node of userMetricsAST.body) {
|
|
175
174
|
if (isExperimentEnumDeclaration(node)) {
|
|
176
|
-
return node.declaration.
|
|
177
|
-
return property.key.value;
|
|
178
|
-
});
|
|
175
|
+
return node.declaration.members.map(member => member.id.value);
|
|
179
176
|
}
|
|
180
177
|
}
|
|
181
178
|
return null;
|
|
@@ -150,20 +150,12 @@ function createServerIndexFile(componentNames) {
|
|
|
150
150
|
<meta charset="UTF-8" />
|
|
151
151
|
<meta name="viewport" content="width=device-width" />
|
|
152
152
|
<title>DevTools components</title>
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
color: blue;
|
|
156
|
-
text-transform: capitalize;
|
|
157
|
-
text-decoration: none;
|
|
158
|
-
}
|
|
159
|
-
a:hover {
|
|
160
|
-
text-decoration: underline;
|
|
161
|
-
}
|
|
162
|
-
</style>
|
|
153
|
+
<link rel="stylesheet" href="/front_end/ui/legacy/themeColors.css" />
|
|
154
|
+
<link rel="stylesheet" href="/front_end/ui/components/docs/component_docs_styles.css" />
|
|
163
155
|
</head>
|
|
164
|
-
<body>
|
|
156
|
+
<body id="index-page">
|
|
165
157
|
<h1>DevTools components</h1>
|
|
166
|
-
<ul>
|
|
158
|
+
<ul class="components-list">
|
|
167
159
|
${componentNames.map(name => {
|
|
168
160
|
const niceName = name.replace(/_/g, ' ');
|
|
169
161
|
return `<li><a href='/front_end/ui/components/docs/${name}'>${niceName}</a></li>`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
meta: {
|
|
8
|
+
type: 'problem',
|
|
9
|
+
docs: {
|
|
10
|
+
description: 'check arguments when recording enumerated histograms',
|
|
11
|
+
category: 'Possible Errors',
|
|
12
|
+
},
|
|
13
|
+
fixable: 'code',
|
|
14
|
+
schema: [] // no options
|
|
15
|
+
},
|
|
16
|
+
create: function(context) {
|
|
17
|
+
return {
|
|
18
|
+
CallExpression(node) {
|
|
19
|
+
if (node?.callee?.object?.name === 'InspectorFrontendHostInstance' &&
|
|
20
|
+
node.callee.property.name === 'recordEnumeratedHistogram') {
|
|
21
|
+
if (node?.arguments[2]?.property?.name !== 'MaxValue') {
|
|
22
|
+
context.report({
|
|
23
|
+
node: node,
|
|
24
|
+
message:
|
|
25
|
+
'When calling \'recordEnumeratedHistogram\' the third argument should be of the form \'SomeEnum.MaxValue\'.'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -3,16 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
if (callExpressionNode.callee.type !== 'MemberExpression') {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// TODO: would miss cases where the render function is destructured. Should
|
|
12
|
-
// we support that case, or enforce that it's not done?
|
|
13
|
-
const {callee} = callExpressionNode;
|
|
14
|
-
return callee.object?.name === 'LitHtml' && callee.property?.name === 'render';
|
|
15
|
-
}
|
|
6
|
+
const {isLitHtmlRenderCall} = require('./utils.js');
|
|
16
7
|
|
|
17
8
|
module.exports = {
|
|
18
9
|
meta: {
|
|
@@ -26,4 +26,23 @@ function isLitHtmlTemplateCall(taggedTemplateExpressionNode) {
|
|
|
26
26
|
return isLitHtmlDotHtmlCall || isDestructuredHtmlCall;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* @param callExpressionNode - a CallExpression node from the AST of the parsed code.
|
|
31
|
+
* @returns {boolean} - `true` if the code matches LitHtml.render() or render(), and false otherwise.
|
|
32
|
+
*/
|
|
33
|
+
function isLitHtmlRenderCall(callExpressionNode) {
|
|
34
|
+
if (callExpressionNode.type !== 'CallExpression') {
|
|
35
|
+
throw new Error('Node of type other than CallExpresson passed to isLitHtmlRenderCall.');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const {callee} = callExpressionNode;
|
|
39
|
+
const isDestructuredRenderCall = callee.type === 'Identifier' && callee.name === 'render';
|
|
40
|
+
const isLitHtmlDotRenderCall = callee.object?.name === 'LitHtml' && callee.property?.name === 'render';
|
|
41
|
+
|
|
42
|
+
return isDestructuredRenderCall || isLitHtmlDotRenderCall;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = {
|
|
46
|
+
isLitHtmlTemplateCall,
|
|
47
|
+
isLitHtmlRenderCall
|
|
48
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
const rule = require('../lib/check_enumerated_histograms.js');
|
|
7
|
+
const ruleTester = new (require('eslint').RuleTester)({
|
|
8
|
+
parserOptions: {ecmaVersion: 9, sourceType: 'module'},
|
|
9
|
+
parser: require.resolve('@typescript-eslint/parser'),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
ruleTester.run('check_enumerated_histograms', rule, {
|
|
13
|
+
valid: [
|
|
14
|
+
{
|
|
15
|
+
code: 'InspectorFrontendHostInstance.recordEnumeratedHistogram(\'someparam\', 1, foo.MaxValue);',
|
|
16
|
+
filename: 'front_end/components/test.ts',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
code:
|
|
20
|
+
'InspectorFrontendHostInstance.recordEnumeratedHistogram(EnumeratedHistogram.IssueCreated, issueCreated, IssueCreated.MaxValue);',
|
|
21
|
+
filename: 'front_end/components/test.ts'
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
invalid: [{
|
|
25
|
+
code: 'InspectorFrontendHostInstance.recordEnumeratedHistogram(\'someparam\', 1, 5);',
|
|
26
|
+
filename: 'front_end/components/test.ts',
|
|
27
|
+
errors: [{
|
|
28
|
+
message:
|
|
29
|
+
'When calling \'recordEnumeratedHistogram\' the third argument should be of the form \'SomeEnum.MaxValue\'.'
|
|
30
|
+
}],
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
@@ -37,4 +37,34 @@ describe('eslint utils', () => {
|
|
|
37
37
|
assert.strictEqual(result, false);
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
+
|
|
41
|
+
describe('isLitHtmlRenderCall', () => {
|
|
42
|
+
it('returns true if the code is LitHtml.render()', () => {
|
|
43
|
+
const code = 'LitHtml.render(LitHtml.html``, this.#shadow)';
|
|
44
|
+
const parsed = parser.parse(code);
|
|
45
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
46
|
+
assert.strictEqual(result, true);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('returns true if the code is render()', () => {
|
|
50
|
+
const code = 'render(html``, this.#shadow)';
|
|
51
|
+
const parsed = parser.parse(code);
|
|
52
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
53
|
+
assert.strictEqual(result, true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('returns false if the code is not render()', () => {
|
|
57
|
+
const code = 'notRender(html``, this.#shadow)';
|
|
58
|
+
const parsed = parser.parse(code);
|
|
59
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
60
|
+
assert.strictEqual(result, false);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('returns false if the code is LitHtml.notRender()', () => {
|
|
64
|
+
const code = 'LitHtml.notRender(html``, this.#shadow)';
|
|
65
|
+
const parsed = parser.parse(code);
|
|
66
|
+
const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
|
|
67
|
+
assert.strictEqual(result, false);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
40
70
|
});
|