chrome-devtools-frontend 1.0.946920 → 1.0.948445
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/.eslintrc.js +1 -0
- package/config/gni/all_devtools_files.gni +1 -13
- package/config/gni/devtools_grd_files.gni +6 -9
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/.eslintrc.js +6 -1
- package/front_end/Images/src/circled_backslash_icon.svg +3 -0
- package/front_end/core/host/InspectorFrontendHost.ts +0 -3
- package/front_end/core/host/UserMetrics.ts +1 -1
- package/front_end/core/i18n/locales/en-US.json +17 -14
- package/front_end/core/i18n/locales/en-XL.json +17 -14
- package/front_end/core/platform/platform.ts +0 -2
- package/front_end/core/platform/string-utilities.ts +14 -1
- package/front_end/core/platform/utilities.ts +0 -29
- package/front_end/core/root/Runtime.ts +4 -211
- package/front_end/core/sdk/AccessibilityModel.ts +0 -2
- package/front_end/core/sdk/CSSProperty.ts +0 -2
- package/front_end/core/sdk/CSSRule.ts +0 -2
- package/front_end/core/sdk/Cookie.ts +0 -25
- package/front_end/core/sdk/EmulationModel.ts +0 -2
- package/front_end/core/sdk/HeapProfilerModel.ts +0 -2
- package/front_end/core/sdk/NetworkManager.ts +0 -3
- package/front_end/core/sdk/Resource.ts +0 -3
- package/front_end/core/sdk/ResourceTreeModel.ts +0 -3
- package/front_end/core/sdk/ServiceWorkerManager.ts +0 -2
- package/front_end/core/sdk/sdk-legacy.ts +0 -3
- package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
- package/front_end/entrypoints/inspector/{inspector.js → inspector.ts} +0 -3
- package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
- package/front_end/entrypoints/main/MainImpl.ts +0 -1
- package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +0 -2
- package/front_end/entrypoints/node_app/node_app.ts +1 -3
- package/front_end/entrypoints/shell/{shell.js → shell.ts} +0 -2
- package/front_end/entrypoints/worker_app/{worker_app.js → worker_app.ts} +3 -2
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +12 -0
- package/front_end/legacy/legacy-defs.d.ts +0 -4
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
- package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -11
- package/front_end/models/bindings/SASSSourceMapping.ts +0 -1
- package/front_end/models/emulation/DeviceModeModel.ts +0 -2
- package/front_end/models/issues_manager/CorsIssue.ts +17 -9
- package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
- package/front_end/panels/animation/AnimationTimeline.ts +0 -2
- package/front_end/panels/animation/AnimationUI.ts +0 -2
- package/front_end/panels/application/BackForwardCacheStrings.ts +2 -5
- package/front_end/panels/application/BackForwardCacheView.ts +150 -58
- package/front_end/panels/application/ResourcesPanel.ts +0 -42
- package/front_end/panels/application/application-legacy.ts +0 -3
- package/front_end/panels/application/application-meta.ts +0 -13
- package/front_end/panels/application/backForwardCacheView.css +44 -6
- package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
- package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
- package/front_end/panels/application/components/StackTrace.ts +1 -1
- package/front_end/panels/coverage/CoverageView.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewModel.ts +0 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +0 -7
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +0 -2
- package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
- package/front_end/panels/elements/ElementsPanel.ts +9 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
- package/front_end/panels/issues/CorsIssueDetailsView.ts +18 -2
- package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -3
- package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
- package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
- package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
- package/front_end/panels/search/SearchView.ts +24 -4
- package/front_end/panels/settings/components/SyncSection.ts +2 -2
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +46 -46
- package/front_end/panels/sources/CSSPlugin.ts +3 -0
- package/front_end/panels/sources/CoveragePlugin.ts +2 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +28 -4
- package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +3 -0
- package/front_end/panels/sources/ProfilePlugin.ts +3 -0
- package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +2 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/json.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -2
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
- package/front_end/third_party/codemirror.next/package.json +1 -0
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +168 -164
- package/front_end/third_party/lighthouse/locales/ar-XB.json +0 -3
- package/front_end/third_party/lighthouse/locales/ar.json +0 -3
- package/front_end/third_party/lighthouse/locales/bg.json +17 -20
- package/front_end/third_party/lighthouse/locales/ca.json +0 -3
- package/front_end/third_party/lighthouse/locales/cs.json +0 -3
- package/front_end/third_party/lighthouse/locales/da.json +16 -19
- package/front_end/third_party/lighthouse/locales/de.json +0 -3
- package/front_end/third_party/lighthouse/locales/el.json +0 -3
- package/front_end/third_party/lighthouse/locales/en-GB.json +19 -22
- package/front_end/third_party/lighthouse/locales/en-US.json +33 -3
- package/front_end/third_party/lighthouse/locales/en-XA.json +0 -3
- package/front_end/third_party/lighthouse/locales/en-XL.json +33 -3
- package/front_end/third_party/lighthouse/locales/es-419.json +17 -20
- package/front_end/third_party/lighthouse/locales/es.json +0 -3
- package/front_end/third_party/lighthouse/locales/fi.json +16 -19
- package/front_end/third_party/lighthouse/locales/fil.json +33 -36
- package/front_end/third_party/lighthouse/locales/fr.json +16 -19
- package/front_end/third_party/lighthouse/locales/he.json +16 -19
- package/front_end/third_party/lighthouse/locales/hi.json +0 -3
- package/front_end/third_party/lighthouse/locales/hr.json +16 -19
- package/front_end/third_party/lighthouse/locales/hu.json +16 -19
- package/front_end/third_party/lighthouse/locales/id.json +16 -19
- package/front_end/third_party/lighthouse/locales/it.json +37 -40
- package/front_end/third_party/lighthouse/locales/ja.json +16 -19
- package/front_end/third_party/lighthouse/locales/ko.json +16 -19
- package/front_end/third_party/lighthouse/locales/lt.json +17 -20
- package/front_end/third_party/lighthouse/locales/lv.json +0 -3
- package/front_end/third_party/lighthouse/locales/nl.json +16 -19
- package/front_end/third_party/lighthouse/locales/no.json +17 -20
- package/front_end/third_party/lighthouse/locales/pl.json +16 -19
- package/front_end/third_party/lighthouse/locales/pt-PT.json +37 -40
- package/front_end/third_party/lighthouse/locales/pt.json +16 -19
- package/front_end/third_party/lighthouse/locales/ro.json +0 -3
- package/front_end/third_party/lighthouse/locales/ru.json +16 -19
- package/front_end/third_party/lighthouse/locales/sk.json +0 -3
- package/front_end/third_party/lighthouse/locales/sl.json +0 -3
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +16 -19
- package/front_end/third_party/lighthouse/locales/sr.json +16 -19
- package/front_end/third_party/lighthouse/locales/sv.json +17 -20
- package/front_end/third_party/lighthouse/locales/ta.json +0 -3
- package/front_end/third_party/lighthouse/locales/te.json +0 -3
- package/front_end/third_party/lighthouse/locales/th.json +0 -3
- package/front_end/third_party/lighthouse/locales/tr.json +0 -3
- package/front_end/third_party/lighthouse/locales/uk.json +17 -20
- package/front_end/third_party/lighthouse/locales/vi.json +0 -3
- package/front_end/third_party/lighthouse/locales/zh-HK.json +0 -3
- package/front_end/third_party/lighthouse/locales/zh-TW.json +0 -3
- package/front_end/third_party/lighthouse/locales/zh.json +0 -3
- package/front_end/third_party/lighthouse/report/bundle.d.ts +63 -61
- package/front_end/third_party/lighthouse/report/bundle.js +36 -7
- package/front_end/third_party/lighthouse/report-assets/report-generator.js +205 -192
- package/front_end/ui/components/diff_view/DiffView.ts +4 -4
- package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
- package/front_end/ui/components/helpers/helpers.ts +0 -2
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
- package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
- package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
- package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
- package/front_end/ui/components/report_view/ReportView.ts +22 -0
- package/front_end/ui/components/report_view/reportSection.css +20 -0
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
- package/front_end/ui/components/text_editor/config.ts +9 -7
- package/front_end/ui/components/text_editor/javascript.ts +8 -4
- package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/SearchableView.ts +2 -1
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/XWidget.ts +0 -5
- package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +40 -32
- package/front_end/ui/legacy/themeColors.css +1 -1
- package/front_end/ui/legacy/utils/append-style.ts +2 -13
- package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
- package/package.json +2 -4
- package/scripts/build/build_inspector_overlay.py +15 -1
- package/scripts/build/rjsmin.py +84 -115
- package/scripts/eslint_rules/lib/l10n_filename_matches.js +4 -4
- package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +101 -0
- package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
- package/scripts/eslint_rules/tests/.eslintrc.js +14 -0
- package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +4 -0
- package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
- package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
- package/front_end/entrypoints/devtools_app/devtools_app.js +0 -11
- package/front_end/entrypoints/devtools_app/devtools_app.json +0 -5
- package/front_end/entrypoints/inspector/inspector.json +0 -4
- package/front_end/entrypoints/js_app/js_app.js +0 -12
- package/front_end/entrypoints/js_app/js_app.json +0 -3
- package/front_end/entrypoints/ndb_app/ndb_app.json +0 -4
- package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
- package/front_end/entrypoints/startup/startup.ts +0 -9
- package/front_end/entrypoints/worker_app/worker_app.json +0 -3
- package/front_end/panels/lighthouse/module.json +0 -6
- package/front_end/third_party/lighthouse/report-assets/report.d.ts +0 -1
- package/front_end/third_party/lighthouse/report-assets/report.js +0 -233
- package/front_end/third_party/lighthouse/report-assets/standalone-template.html +0 -38
- package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
- package/scripts/build/build_release_applications.py +0 -216
- package/scripts/build/modular_build.py +0 -184
- package/scripts/check_gn.js +0 -119
- package/scripts/json_validator/module.schema.json +0 -19
- package/scripts/json_validator/validate_module_json.js +0 -44
|
@@ -31,25 +31,22 @@ const UIStrings = {
|
|
|
31
31
|
/**
|
|
32
32
|
* @description Entry name text in the back/forward cache view of the Application panel
|
|
33
33
|
*/
|
|
34
|
-
url: 'URL',
|
|
35
|
-
/**
|
|
36
|
-
* @description Entry name text in the back/forward cache view of the Application panel
|
|
37
|
-
*/
|
|
38
|
-
bfcacheStatus: 'Back/forward cache Status',
|
|
34
|
+
url: 'URL:',
|
|
39
35
|
/**
|
|
40
36
|
* @description Status text for the status of the back/forward cache status
|
|
41
37
|
*/
|
|
42
|
-
unknown: '
|
|
38
|
+
unknown: 'Unknown Status',
|
|
43
39
|
/**
|
|
44
40
|
* @description Status text for the status of the back/forward cache status indicating that
|
|
45
41
|
* the back/forward cache was not used and a normal navigation occured instead.
|
|
46
42
|
*/
|
|
47
|
-
normalNavigation:
|
|
43
|
+
normalNavigation:
|
|
44
|
+
'Not served from back/forward cache: to trigger back/forward cache, use Chrome\'s back/forward buttons, or use the test button below to automatically navigate away and back.',
|
|
48
45
|
/**
|
|
49
46
|
* @description Status text for the status of the back/forward cache status indicating that
|
|
50
47
|
* the back/forward cache was used to restore the page instead of reloading it.
|
|
51
48
|
*/
|
|
52
|
-
restoredFromBFCache: '
|
|
49
|
+
restoredFromBFCache: 'Successfully served from back/forward cache.',
|
|
53
50
|
/**
|
|
54
51
|
* @description Label for a list of reasons which prevent the page from being eligible for
|
|
55
52
|
* back/forward cache. These reasons are actionable i.e. they can be cleaned up to make the
|
|
@@ -81,9 +78,17 @@ const UIStrings = {
|
|
|
81
78
|
*/
|
|
82
79
|
supportPending: 'Pending Support',
|
|
83
80
|
/**
|
|
84
|
-
* @description
|
|
81
|
+
* @description Label for the button to test whether BFCache is available for the page
|
|
82
|
+
*/
|
|
83
|
+
runTest: 'Test back/forward cache',
|
|
84
|
+
/**
|
|
85
|
+
* @description Label for the disabled button while the test is running
|
|
85
86
|
*/
|
|
86
|
-
|
|
87
|
+
runningTest: 'Running test',
|
|
88
|
+
/**
|
|
89
|
+
* @description Link Text about explanation of back/forward cache
|
|
90
|
+
*/
|
|
91
|
+
learnMore: 'Learn more: back/forward cache eligibility',
|
|
87
92
|
/**
|
|
88
93
|
* @description Explanation for 'pending support' items which prevent the page from being eligible
|
|
89
94
|
* for back/forward cache.
|
|
@@ -94,6 +99,11 @@ const UIStrings = {
|
|
|
94
99
|
const str_ = i18n.i18n.registerUIStrings('panels/application/BackForwardCacheView.ts', UIStrings);
|
|
95
100
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
96
101
|
|
|
102
|
+
const enum ScreenStatusType {
|
|
103
|
+
Running = 'Running',
|
|
104
|
+
Result = 'Result',
|
|
105
|
+
}
|
|
106
|
+
|
|
97
107
|
export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
98
108
|
constructor() {
|
|
99
109
|
super(true, 1000);
|
|
@@ -102,8 +112,11 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
102
112
|
this.getMainResourceTreeModel()?.addEventListener(
|
|
103
113
|
SDK.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated, this.onBackForwardCacheUpdate, this);
|
|
104
114
|
this.update();
|
|
115
|
+
this.screenStatus = ScreenStatusType.Result;
|
|
105
116
|
}
|
|
106
117
|
|
|
118
|
+
private screenStatus: ScreenStatusType;
|
|
119
|
+
|
|
107
120
|
wasShown(): void {
|
|
108
121
|
super.wasShown();
|
|
109
122
|
this.registerCSSFiles([backForwardCacheViewStyles]);
|
|
@@ -117,7 +130,7 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
117
130
|
const data = {reportTitle: i18nString(UIStrings.backForwardCacheTitle)};
|
|
118
131
|
const html = LitHtml.html`
|
|
119
132
|
<${ReportView.ReportView.Report.litTagName} .data=${data as ReportView.ReportView.ReportData}>
|
|
120
|
-
|
|
133
|
+
${this.renderMainFrameInformation(this.getMainFrame())}
|
|
121
134
|
</${ReportView.ReportView.Report.litTagName}>
|
|
122
135
|
`;
|
|
123
136
|
LitHtml.render(html, this.contentElement, {host: this});
|
|
@@ -132,10 +145,20 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
132
145
|
return this.getMainResourceTreeModel()?.mainFrame || null;
|
|
133
146
|
}
|
|
134
147
|
|
|
148
|
+
private renderBackForwardCacheTestResult(): void {
|
|
149
|
+
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
150
|
+
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
151
|
+
this.renderBackForwardCacheTestResult, this);
|
|
152
|
+
this.screenStatus = ScreenStatusType.Result;
|
|
153
|
+
this.update();
|
|
154
|
+
}
|
|
155
|
+
|
|
135
156
|
private async goBackOneHistoryEntry(): Promise<void> {
|
|
136
157
|
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
137
158
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
138
159
|
this.goBackOneHistoryEntry, this);
|
|
160
|
+
this.screenStatus = ScreenStatusType.Running;
|
|
161
|
+
this.update();
|
|
139
162
|
const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
|
|
140
163
|
if (!mainTarget) {
|
|
141
164
|
return;
|
|
@@ -148,6 +171,9 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
148
171
|
if (!historyResults) {
|
|
149
172
|
return;
|
|
150
173
|
}
|
|
174
|
+
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
175
|
+
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
176
|
+
this.renderBackForwardCacheTestResult, this);
|
|
151
177
|
resourceTreeModel.navigateToHistoryEntry(historyResults.entries[historyResults.currentIndex - 1]);
|
|
152
178
|
}
|
|
153
179
|
|
|
@@ -176,41 +202,97 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
176
202
|
|
|
177
203
|
private renderMainFrameInformation(mainFrame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitHtml.TemplateResult {
|
|
178
204
|
if (!mainFrame) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
205
|
+
// clang-format off
|
|
206
|
+
return LitHtml.html`
|
|
207
|
+
<${ReportView.ReportView.ReportKey.litTagName}>
|
|
208
|
+
${i18nString(UIStrings.mainFrame)}
|
|
209
|
+
</${ReportView.ReportView.ReportKey.litTagName}>
|
|
210
|
+
<${ReportView.ReportView.ReportValue.litTagName}>
|
|
211
|
+
${i18nString(UIStrings.unavailable)}
|
|
212
|
+
</${ReportView.ReportView.ReportValue.litTagName}>
|
|
213
|
+
`;
|
|
214
|
+
// clang-format on
|
|
184
215
|
}
|
|
216
|
+
const isDisabled = this.screenStatus === ScreenStatusType.Running;
|
|
217
|
+
// clang-format off
|
|
185
218
|
return LitHtml.html`
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
219
|
+
${this.renderBackForwardCacheStatus(mainFrame.backForwardCacheDetails.restoredFromCache)}
|
|
220
|
+
<div class='url'>
|
|
221
|
+
<div class='url-key'>
|
|
222
|
+
${i18nString(UIStrings.url)}
|
|
223
|
+
</div>
|
|
224
|
+
<div class='url-value'>
|
|
225
|
+
${mainFrame.url}
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
229
|
+
<${Buttons.Button.Button.litTagName}
|
|
230
|
+
.disabled=${isDisabled}
|
|
231
|
+
.spinner=${isDisabled}
|
|
232
|
+
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
233
|
+
@click=${this.navigateAwayAndBack}>
|
|
234
|
+
${isDisabled ? LitHtml.html`
|
|
235
|
+
${i18nString(UIStrings.runningTest)}`:`
|
|
190
236
|
${i18nString(UIStrings.runTest)}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<${ReportView.ReportView.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
${this.maybeRenderExplanations(mainFrame.backForwardCacheDetails.explanations)}
|
|
237
|
+
`}
|
|
238
|
+
</${Buttons.Button.Button.litTagName}>
|
|
239
|
+
</${ReportView.ReportView.ReportSection.litTagName}>
|
|
240
|
+
<${ReportView.ReportView.ReportSectionDivider.litTagName}>
|
|
241
|
+
</${ReportView.ReportView.ReportSectionDivider.litTagName}>
|
|
242
|
+
${this.maybeRenderExplanations(mainFrame.backForwardCacheDetails.explanations)}
|
|
243
|
+
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
244
|
+
<x-link href="https://web.dev/bfcache/" class="link">
|
|
245
|
+
${i18nString(UIStrings.learnMore)}
|
|
246
|
+
</x-link>
|
|
247
|
+
</${ReportView.ReportView.ReportSection.litTagName}>
|
|
203
248
|
`;
|
|
249
|
+
// clang-format on
|
|
204
250
|
}
|
|
205
251
|
|
|
206
|
-
private renderBackForwardCacheStatus(status: boolean|undefined):
|
|
252
|
+
private renderBackForwardCacheStatus(status: boolean|undefined): LitHtml.TemplateResult {
|
|
207
253
|
switch (status) {
|
|
208
254
|
case true:
|
|
209
|
-
|
|
255
|
+
// clang-format off
|
|
256
|
+
return LitHtml.html`
|
|
257
|
+
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
258
|
+
<div class='status'>
|
|
259
|
+
<${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
|
|
260
|
+
iconName: 'ic_checkmark_16x16',
|
|
261
|
+
color: 'green',
|
|
262
|
+
width: '16px',
|
|
263
|
+
height: '16px',
|
|
264
|
+
} as IconButton.Icon.IconData}>
|
|
265
|
+
</${IconButton.Icon.Icon.litTagName}>
|
|
266
|
+
</div>
|
|
267
|
+
${i18nString(UIStrings.restoredFromBFCache)}
|
|
268
|
+
</${ReportView.ReportView.ReportSection.litTagName}>
|
|
269
|
+
`;
|
|
270
|
+
// clang-format on
|
|
210
271
|
case false:
|
|
211
|
-
|
|
272
|
+
// clang-format off
|
|
273
|
+
return LitHtml.html`
|
|
274
|
+
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
275
|
+
<div class='status'>
|
|
276
|
+
<${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
|
|
277
|
+
iconName: 'circled_backslash_icon',
|
|
278
|
+
color: 'var(--color-text-secondary)',
|
|
279
|
+
width: '16px',
|
|
280
|
+
height: '16px',
|
|
281
|
+
} as IconButton.Icon.IconData}>
|
|
282
|
+
</${IconButton.Icon.Icon.litTagName}>
|
|
283
|
+
</div>
|
|
284
|
+
${i18nString(UIStrings.normalNavigation)}
|
|
285
|
+
</${ReportView.ReportView.ReportSection.litTagName}>
|
|
286
|
+
`;
|
|
287
|
+
// clang-format on
|
|
212
288
|
}
|
|
213
|
-
|
|
289
|
+
// clang-format off
|
|
290
|
+
return LitHtml.html`
|
|
291
|
+
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
292
|
+
${i18nString(UIStrings.unknown)}
|
|
293
|
+
</${ReportView.ReportView.ReportSection.litTagName}>
|
|
294
|
+
`;
|
|
295
|
+
// clang-format on
|
|
214
296
|
}
|
|
215
297
|
|
|
216
298
|
private maybeRenderExplanations(explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[]):
|
|
@@ -243,36 +325,46 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
243
325
|
// clang-format off
|
|
244
326
|
return LitHtml.html`
|
|
245
327
|
${explanations.length > 0 ? LitHtml.html`
|
|
246
|
-
<${ReportView.ReportView.
|
|
328
|
+
<${ReportView.ReportView.ReportSectionHeader.litTagName}>
|
|
247
329
|
${category}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
</${ReportView.ReportView.
|
|
330
|
+
<div class='help-outline-icon'>
|
|
331
|
+
<${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
|
|
332
|
+
iconName: 'help_outline',
|
|
333
|
+
color: 'var(--color-text-secondary)',
|
|
334
|
+
width: '16px',
|
|
335
|
+
height: '16px',
|
|
336
|
+
} as IconButton.Icon.IconData} title=${explainerText}>
|
|
337
|
+
</${IconButton.Icon.Icon.litTagName}>
|
|
338
|
+
</div>
|
|
339
|
+
</${ReportView.ReportView.ReportSectionHeader.litTagName}>
|
|
340
|
+
${explanations.map(explanation => this.renderReason(explanation))}
|
|
258
341
|
` : LitHtml.nothing}
|
|
259
342
|
`;
|
|
260
343
|
// clang-format on
|
|
261
344
|
}
|
|
262
345
|
|
|
263
346
|
private renderReason(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult {
|
|
347
|
+
// clang-format off
|
|
264
348
|
return LitHtml.html`
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
349
|
+
<${ReportView.ReportView.ReportSection.litTagName}>
|
|
350
|
+
${(explanation.reason in NotRestoredReasonDescription) ?
|
|
351
|
+
LitHtml.html`
|
|
352
|
+
<div class='circled-exclamation-icon'>
|
|
353
|
+
<${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
|
|
354
|
+
iconName: 'circled_exclamation_icon',
|
|
355
|
+
color: 'orange',
|
|
356
|
+
width: '16px',
|
|
357
|
+
height: '16px',
|
|
358
|
+
} as IconButton.Icon.IconData}>
|
|
359
|
+
</${IconButton.Icon.Icon.litTagName}>
|
|
360
|
+
</div>
|
|
361
|
+
${NotRestoredReasonDescription[explanation.reason].name()}` :
|
|
362
|
+
LitHtml.nothing}
|
|
363
|
+
</${ReportView.ReportView.ReportSection.litTagName}>
|
|
364
|
+
<div class='gray-text'>
|
|
365
|
+
${explanation.reason}
|
|
366
|
+
</div>
|
|
276
367
|
`;
|
|
368
|
+
// clang-format on
|
|
277
369
|
}
|
|
278
370
|
}
|
|
@@ -9,7 +9,6 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
9
9
|
|
|
10
10
|
import resourcesPanelStyles from './resourcesPanel.css.js';
|
|
11
11
|
|
|
12
|
-
import type {CookieTreeElement} from './ApplicationPanelSidebar.js';
|
|
13
12
|
import {ApplicationPanelSidebar, StorageCategoryView} from './ApplicationPanelSidebar.js';
|
|
14
13
|
import {CookieItemsView} from './CookieItemsView.js';
|
|
15
14
|
import {DatabaseQueryView} from './DatabaseQueryView.js';
|
|
@@ -215,47 +214,6 @@ export class ResourceRevealer implements Common.Revealer.Revealer {
|
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
216
|
|
|
218
|
-
let cookieReferenceRevealerInstance: CookieReferenceRevealer;
|
|
219
|
-
|
|
220
|
-
export class CookieReferenceRevealer implements Common.Revealer.Revealer {
|
|
221
|
-
static instance(opts: {
|
|
222
|
-
forceNew: boolean|null,
|
|
223
|
-
} = {forceNew: null}): CookieReferenceRevealer {
|
|
224
|
-
const {forceNew} = opts;
|
|
225
|
-
if (!cookieReferenceRevealerInstance || forceNew) {
|
|
226
|
-
cookieReferenceRevealerInstance = new CookieReferenceRevealer();
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return cookieReferenceRevealerInstance;
|
|
230
|
-
}
|
|
231
|
-
async reveal(cookie: Object): Promise<void> {
|
|
232
|
-
if (!(cookie instanceof SDK.Cookie.CookieReference)) {
|
|
233
|
-
throw new Error('Internal error: not a cookie reference');
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const sidebar = await ResourcesPanel.showAndGetSidebar();
|
|
237
|
-
await sidebar.cookieListTreeElement.select();
|
|
238
|
-
|
|
239
|
-
const contextUrl = cookie.contextUrl();
|
|
240
|
-
if (contextUrl && await this.revealByDomain(sidebar, contextUrl)) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
// Fallback: try to reveal the cookie using its domain as context, which may not work, because the
|
|
244
|
-
// Application Panel shows cookies grouped by context, see crbug.com/1060563.
|
|
245
|
-
this.revealByDomain(sidebar, cookie.domain());
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
private async revealByDomain(sidebar: ApplicationPanelSidebar, domain: string): Promise<boolean> {
|
|
249
|
-
const item = sidebar.cookieListTreeElement.children().find(
|
|
250
|
-
c => /** @type {!CookieTreeElement} */ (c as CookieTreeElement).cookieDomain().endsWith(domain));
|
|
251
|
-
if (item) {
|
|
252
|
-
await item.revealAndSelect();
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
return false;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
217
|
let frameDetailsRevealerInstance: FrameDetailsRevealer;
|
|
260
218
|
|
|
261
219
|
export class FrameDetailsRevealer implements Common.Revealer.Revealer {
|
|
@@ -95,9 +95,6 @@ Resources.ResourcesPanel = ResourcesModule.ResourcesPanel.ResourcesPanel;
|
|
|
95
95
|
/** @constructor */
|
|
96
96
|
Resources.ResourcesPanel.ResourceRevealer = ResourcesModule.ResourcesPanel.ResourceRevealer;
|
|
97
97
|
|
|
98
|
-
/** @constructor */
|
|
99
|
-
Resources.ResourcesPanel.CookieReferenceRevealer = ResourcesModule.ResourcesPanel.CookieReferenceRevealer;
|
|
100
|
-
|
|
101
98
|
/** @constructor */
|
|
102
99
|
Resources.ResourcesPanel.FrameDetailsRevealer = ResourcesModule.ResourcesPanel.FrameDetailsRevealer;
|
|
103
100
|
|
|
@@ -139,19 +139,6 @@ Common.Revealer.registerRevealer({
|
|
|
139
139
|
},
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
-
Common.Revealer.registerRevealer({
|
|
143
|
-
contextTypes() {
|
|
144
|
-
return [
|
|
145
|
-
SDK.Cookie.CookieReference,
|
|
146
|
-
];
|
|
147
|
-
},
|
|
148
|
-
destination: Common.Revealer.RevealerDestination.APPLICATION_PANEL,
|
|
149
|
-
async loadRevealer() {
|
|
150
|
-
const Resources = await loadResourcesModule();
|
|
151
|
-
return Resources.ResourcesPanel.CookieReferenceRevealer.instance();
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
|
|
155
142
|
Common.Revealer.registerRevealer({
|
|
156
143
|
contextTypes() {
|
|
157
144
|
return [
|
|
@@ -3,12 +3,50 @@
|
|
|
3
3
|
* Use of this source code is governed by a BSD-style license that can be
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
|
-
.not-restored-reason-list {
|
|
7
|
-
margin: 0;
|
|
8
|
-
list-style-type: none;
|
|
9
|
-
padding-inline-start: 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
.inline-icon {
|
|
13
7
|
vertical-align: sub;
|
|
14
8
|
}
|
|
9
|
+
|
|
10
|
+
.gray-text {
|
|
11
|
+
color: var(--color-text-secondary);
|
|
12
|
+
margin: 0 0 15px 56px;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
align-items: center;
|
|
16
|
+
flex: auto;
|
|
17
|
+
overflow-wrap: break-word;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.help-outline-icon {
|
|
22
|
+
margin: 0 2px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.circled-exclamation-icon {
|
|
26
|
+
margin-right: 10px;
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.status {
|
|
31
|
+
margin-right: 15px;
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.url {
|
|
36
|
+
grid-column-start: span 2;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
margin: 0 30px;
|
|
40
|
+
line-height: 28px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.url-key {
|
|
44
|
+
color: var(--color-text-secondary);
|
|
45
|
+
min-width: auto;
|
|
46
|
+
overflow-wrap: break-word;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.url-value {
|
|
50
|
+
padding: 0 6px;
|
|
51
|
+
overflow-wrap: break-word;
|
|
52
|
+
}
|
|
@@ -318,7 +318,7 @@ export class FrameDetailsReportView extends HTMLElement {
|
|
|
318
318
|
return LitHtml.html`
|
|
319
319
|
<${ReportView.ReportView.ReportSectionHeader.litTagName}>
|
|
320
320
|
${i18n.i18n.lockedString('Origin Trials')}
|
|
321
|
-
<${IconButton.IconButton.IconButton.litTagName} class="inline-button" .data
|
|
321
|
+
<${IconButton.IconButton.IconButton.litTagName} class="inline-button" .data=${{
|
|
322
322
|
clickHandler: refreshOriginTrials,
|
|
323
323
|
groups: [
|
|
324
324
|
{
|
|
@@ -326,7 +326,7 @@ export class FrameDetailsReportView extends HTMLElement {
|
|
|
326
326
|
text: 'Refresh',
|
|
327
327
|
} as IconButton.IconButton.IconWithTextData,
|
|
328
328
|
],
|
|
329
|
-
} as IconButton.IconButton.IconButtonData}
|
|
329
|
+
} as IconButton.IconButton.IconButtonData}>
|
|
330
330
|
</${IconButton.IconButton.IconButton.litTagName}>
|
|
331
331
|
</${ReportView.ReportView.ReportSectionHeader.litTagName}>
|
|
332
332
|
${this.originTrialTreeView}
|
|
@@ -541,7 +541,7 @@ export class FrameDetailsReportView extends HTMLElement {
|
|
|
541
541
|
return LitHtml.nothing;
|
|
542
542
|
}
|
|
543
543
|
const typeStrings = this.getAdFrameTypeStrings(adFrameType);
|
|
544
|
-
const rows = [LitHtml.html`<div title
|
|
544
|
+
const rows = [LitHtml.html`<div title=${typeStrings.description}>${typeStrings.value}</div>`];
|
|
545
545
|
for (const explanation of this.frame.adFrameStatus()?.explanations || []) {
|
|
546
546
|
rows.push(LitHtml.html`<div>${this.getAdFrameExplanationString(explanation)}</div>`);
|
|
547
547
|
}
|
|
@@ -229,7 +229,7 @@ export class OriginTrialTokenRows extends HTMLElement {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
private renderTokenField = (fieldValue: string, hasError?: boolean): LitHtml.TemplateResult => LitHtml.html`
|
|
232
|
-
<div class
|
|
232
|
+
<div class=${LitHtml.Directives.ifDefined(hasError ? 'error-text' : undefined)}>
|
|
233
233
|
${fieldValue}
|
|
234
234
|
</div>`;
|
|
235
235
|
|
|
@@ -334,10 +334,10 @@ export class OriginTrialTreeView extends HTMLElement {
|
|
|
334
334
|
|
|
335
335
|
LitHtml.render(
|
|
336
336
|
LitHtml.html`
|
|
337
|
-
<${TreeOutline.TreeOutline.TreeOutline.litTagName} .data
|
|
337
|
+
<${TreeOutline.TreeOutline.TreeOutline.litTagName} .data=${{
|
|
338
338
|
tree: trials.map(constructOriginTrialTree),
|
|
339
339
|
defaultRenderer,
|
|
340
|
-
} as TreeOutline.TreeOutline.TreeOutlineData<OriginTrialTreeNodeData>}
|
|
340
|
+
} as TreeOutline.TreeOutline.TreeOutlineData<OriginTrialTreeNodeData>}>
|
|
341
341
|
</${TreeOutline.TreeOutline.TreeOutline.litTagName}>
|
|
342
342
|
`,
|
|
343
343
|
this.shadow, {host: this});
|
|
@@ -64,7 +64,7 @@ export class StackTraceRow extends HTMLElement {
|
|
|
64
64
|
LitHtml.render(
|
|
65
65
|
LitHtml.html`
|
|
66
66
|
<div class="stack-trace-row">
|
|
67
|
-
<div class="stack-trace-function-name text-ellipsis" title
|
|
67
|
+
<div class="stack-trace-function-name text-ellipsis" title=${this.stackTraceRowItem.functionName}>
|
|
68
68
|
${this.stackTraceRowItem.functionName}
|
|
69
69
|
</div>
|
|
70
70
|
<div class="stack-trace-source-location">
|
|
@@ -470,7 +470,7 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
472
472
|
const text = this.filterInput.value();
|
|
473
|
-
this.textFilterRegExp = text ? createPlainTextSearchRegex(text, 'i') : null;
|
|
473
|
+
this.textFilterRegExp = text ? Platform.StringUtilities.createPlainTextSearchRegex(text, 'i') : null;
|
|
474
474
|
this.listView.updateFilterAndHighlight(this.textFilterRegExp);
|
|
475
475
|
this.updateStats();
|
|
476
476
|
}
|
|
@@ -44,7 +44,6 @@ export interface GlobalStyleStats {
|
|
|
44
44
|
export class CSSOverviewModel extends SDK.SDKModel.SDKModel<void> {
|
|
45
45
|
readonly #runtimeAgent: ProtocolProxyApi.RuntimeApi;
|
|
46
46
|
readonly #cssAgent: ProtocolProxyApi.CSSApi;
|
|
47
|
-
readonly #domAgent: ProtocolProxyApi.DOMApi;
|
|
48
47
|
readonly #domSnapshotAgent: ProtocolProxyApi.DOMSnapshotApi;
|
|
49
48
|
readonly #overlayAgent: ProtocolProxyApi.OverlayApi;
|
|
50
49
|
|
|
@@ -53,7 +52,6 @@ export class CSSOverviewModel extends SDK.SDKModel.SDKModel<void> {
|
|
|
53
52
|
|
|
54
53
|
this.#runtimeAgent = target.runtimeAgent();
|
|
55
54
|
this.#cssAgent = target.cssAgent();
|
|
56
|
-
this.#domAgent = target.domAgent();
|
|
57
55
|
this.#domSnapshotAgent = target.domsnapshotAgent();
|
|
58
56
|
this.#overlayAgent = target.overlayAgent();
|
|
59
57
|
}
|
|
@@ -36,7 +36,6 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
36
36
|
#mediaQueries!: Map<string, Protocol.CSS.CSSMedia[]>;
|
|
37
37
|
#unusedDeclarations!: Map<string, UnusedDeclaration[]>;
|
|
38
38
|
#elementCount!: number;
|
|
39
|
-
#cancelled?: boolean;
|
|
40
39
|
#globalStyleStats!: GlobalStyleStats;
|
|
41
40
|
#textColorContrastIssues!: Map<string, ContrastIssue[]>;
|
|
42
41
|
|
|
@@ -58,7 +57,6 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
58
57
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CaptureCssOverviewClicked);
|
|
59
58
|
this.startOverview();
|
|
60
59
|
}, this);
|
|
61
|
-
this.#controller.addEventListener(Events.RequestOverviewCancel, this.cancelOverview, this);
|
|
62
60
|
this.#controller.addEventListener(Events.OverviewCompleted, this.overviewCompleted, this);
|
|
63
61
|
this.#controller.addEventListener(Events.Reset, this.reset, this);
|
|
64
62
|
this.#controller.addEventListener(Events.RequestNodeHighlight, this.requestNodeHighlight, this);
|
|
@@ -102,7 +100,6 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
102
100
|
this.#mediaQueries = new Map();
|
|
103
101
|
this.#unusedDeclarations = new Map();
|
|
104
102
|
this.#elementCount = 0;
|
|
105
|
-
this.#cancelled = false;
|
|
106
103
|
this.#globalStyleStats = {
|
|
107
104
|
styleRules: 0,
|
|
108
105
|
inlineStyles: 0,
|
|
@@ -223,10 +220,6 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
223
220
|
return item[0].value;
|
|
224
221
|
}
|
|
225
222
|
|
|
226
|
-
private cancelOverview(): void {
|
|
227
|
-
this.#cancelled = true;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
223
|
private overviewCompleted(): void {
|
|
231
224
|
this.renderOverviewCompletedView();
|
|
232
225
|
}
|
|
@@ -19,13 +19,11 @@ const UIStrings = {
|
|
|
19
19
|
const str_ = i18n.i18n.registerUIStrings('panels/css_overview/CSSOverviewProcessingView.ts', UIStrings);
|
|
20
20
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
21
21
|
export class CSSOverviewProcessingView extends UI.Widget.Widget {
|
|
22
|
-
readonly #formatter: Intl.NumberFormat;
|
|
23
22
|
readonly #controller: OverviewController;
|
|
24
23
|
fragment?: UI.Fragment.Fragment;
|
|
25
24
|
constructor(controller: OverviewController) {
|
|
26
25
|
super();
|
|
27
26
|
|
|
28
|
-
this.#formatter = new Intl.NumberFormat('en-US');
|
|
29
27
|
this.#controller = controller;
|
|
30
28
|
this.render();
|
|
31
29
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
7
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
10
|
|
|
@@ -125,7 +126,7 @@ export class DeveloperResourcesView extends UI.Widget.VBox {
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
const text = this.filterInput.value();
|
|
128
|
-
this.textFilterRegExp = text ? createPlainTextSearchRegex(text, 'i') : null;
|
|
129
|
+
this.textFilterRegExp = text ? Platform.StringUtilities.createPlainTextSearchRegex(text, 'i') : null;
|
|
129
130
|
this.listView.updateFilterAndHighlight(this.textFilterRegExp);
|
|
130
131
|
this.updateStats();
|
|
131
132
|
}
|
|
@@ -291,8 +291,16 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
private showDOMTree(): void {
|
|
294
|
-
// TODO(meredithl): Scroll to inspected DOM node.
|
|
295
294
|
this.splitWidget.setMainWidget(this.searchableViewInternal);
|
|
295
|
+
const selectedNode = this.selectedDOMNode();
|
|
296
|
+
if (!selectedNode) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const treeElement = this.treeElementForNode(selectedNode);
|
|
300
|
+
if (!treeElement) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
treeElement.select();
|
|
296
304
|
}
|
|
297
305
|
|
|
298
306
|
static instance(opts: {
|
|
@@ -1899,7 +1899,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1899
1899
|
this.hideSearchHighlight();
|
|
1900
1900
|
|
|
1901
1901
|
const text = this.listItemElement.textContent || '';
|
|
1902
|
-
const regexObject = createPlainTextSearchRegex(this.searchQuery, 'gi');
|
|
1902
|
+
const regexObject = Platform.StringUtilities.createPlainTextSearchRegex(this.searchQuery, 'gi');
|
|
1903
1903
|
|
|
1904
1904
|
let match = regexObject.exec(text);
|
|
1905
1905
|
const matchRanges = [];
|