chrome-devtools-frontend 1.0.946351 → 1.0.948359
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 -15
- package/config/gni/devtools_grd_files.gni +9 -15
- 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/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +1 -22
- package/front_end/core/i18n/locales/en-US.json +38 -29
- package/front_end/core/i18n/locales/en-XL.json +38 -29
- 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/devtools_compatibility.js +1 -1
- 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_main → node_app}/NodeConnectionsPanel.ts +1 -1
- package/front_end/entrypoints/{node_main → node_app}/NodeMain.ts +2 -4
- package/front_end/entrypoints/{node_main → node_app}/nodeConnectionsPanel.css +0 -0
- package/front_end/entrypoints/node_app/node_app.ts +79 -0
- 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/ColorSwatchPopoverIcon.ts +0 -11
- package/front_end/panels/elements/ElementsPanel.ts +9 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +0 -1
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
- package/front_end/panels/emulation/DeviceModeToolbar.ts +0 -16
- 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 +29 -5
- 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 +3 -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.d.ts +1486 -1423
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
- package/front_end/third_party/codemirror.next/package.json +10 -9
- 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 +15 -11
- 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/InspectorView.ts +10 -0
- 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/inspector_overlay/main.ts +2 -12
- 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/node_app/node_app-meta.ts +0 -43
- package/front_end/entrypoints/node_app/node_app.js +0 -16
- package/front_end/entrypoints/node_app/node_app.json +0 -3
- package/front_end/entrypoints/node_main/node_main-meta.ts +0 -48
- package/front_end/entrypoints/node_main/node_main.ts +0 -11
- 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
|
@@ -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 = [];
|
|
@@ -1616,7 +1616,6 @@ export class StylePropertiesSection {
|
|
|
1616
1616
|
|
|
1617
1617
|
private onFontEditorButtonClicked(): void {
|
|
1618
1618
|
if (this.fontEditorSectionManager && this.fontEditorButton) {
|
|
1619
|
-
Host.userMetrics.cssEditorOpened('fontEditor');
|
|
1620
1619
|
this.fontEditorSectionManager.showPopover(this.fontEditorButton.element, this.parentPane);
|
|
1621
1620
|
}
|
|
1622
1621
|
}
|
|
@@ -276,7 +276,7 @@ export class ElementsBreadcrumbs extends HTMLElement {
|
|
|
276
276
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
277
277
|
// clang-format off
|
|
278
278
|
LitHtml.render(LitHtml.html`
|
|
279
|
-
<nav class="crumbs" aria-label
|
|
279
|
+
<nav class="crumbs" aria-label=${i18nString(UIStrings.breadcrumbs)}>
|
|
280
280
|
${this.renderOverflowButton('left', this.userScrollPosition === 'start')}
|
|
281
281
|
|
|
282
282
|
<div class="crumbs-window" @scroll=${this.onCrumbsWindowScroll}>
|
|
@@ -225,10 +225,6 @@ export class DeviceModeToolbar {
|
|
|
225
225
|
showMediaInspectorSetting: Common.Settings.Setting<boolean>,
|
|
226
226
|
showRulersSetting: Common.Settings.Setting<boolean>) {
|
|
227
227
|
this.model = model;
|
|
228
|
-
const device = model.device();
|
|
229
|
-
if (device) {
|
|
230
|
-
this.recordDeviceChange(device, null);
|
|
231
|
-
}
|
|
232
228
|
this.showMediaInspectorSetting = showMediaInspectorSetting;
|
|
233
229
|
this.showRulersSetting = showRulersSetting;
|
|
234
230
|
|
|
@@ -302,16 +298,6 @@ export class DeviceModeToolbar {
|
|
|
302
298
|
}
|
|
303
299
|
}
|
|
304
300
|
|
|
305
|
-
private recordDeviceChange(
|
|
306
|
-
device: EmulationModel.EmulatedDevices.EmulatedDevice,
|
|
307
|
-
oldDevice: EmulationModel.EmulatedDevices.EmulatedDevice|null): void {
|
|
308
|
-
if (device !== oldDevice && device && device.isDualScreen) {
|
|
309
|
-
// When we start emulating a device, whether we start a new emulation session, or switch to
|
|
310
|
-
// a new device, if the device is dual screen, we count this once.
|
|
311
|
-
Host.userMetrics.dualScreenDeviceEmulated(Host.UserMetrics.DualScreenDeviceEmulated.DualScreenDeviceSelected);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
301
|
private createEmptyToolbarElement(): Element {
|
|
316
302
|
const element = document.createElement('div');
|
|
317
303
|
element.classList.add('device-mode-empty-toolbar-element');
|
|
@@ -527,7 +513,6 @@ export class DeviceModeToolbar {
|
|
|
527
513
|
|
|
528
514
|
private emulateDevice(device: EmulationModel.EmulatedDevices.EmulatedDevice): void {
|
|
529
515
|
const scale = this.autoAdjustScaleSetting.get() ? undefined : this.model.scaleSetting().get();
|
|
530
|
-
this.recordDeviceChange(device, this.model.device());
|
|
531
516
|
this.model.emulate(
|
|
532
517
|
EmulationModel.DeviceModeModel.Type.Device, device, this.lastMode.get(device) || device.modes[0], scale);
|
|
533
518
|
}
|
|
@@ -615,7 +600,6 @@ export class DeviceModeToolbar {
|
|
|
615
600
|
return;
|
|
616
601
|
}
|
|
617
602
|
|
|
618
|
-
Host.userMetrics.dualScreenDeviceEmulated(Host.UserMetrics.DualScreenDeviceEmulated.SpanButtonClicked);
|
|
619
603
|
const scale = this.autoAdjustScaleSetting.get() ? undefined : this.model.scaleSetting().get();
|
|
620
604
|
const mode = this.model.mode();
|
|
621
605
|
if (!mode) {
|
|
@@ -174,11 +174,16 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
174
174
|
this.appendColumnTitle(header, i18nString(UIStrings.allowCredentialsValueFromHeader));
|
|
175
175
|
break;
|
|
176
176
|
case IssuesManager.CorsIssue.IssueCode.InsecurePrivateNetwork:
|
|
177
|
-
case IssuesManager.CorsIssue.IssueCode.InsecurePrivateNetworkPreflight:
|
|
178
177
|
this.appendColumnTitle(header, i18nString(UIStrings.resourceAddressSpace));
|
|
179
178
|
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
180
179
|
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
181
180
|
break;
|
|
181
|
+
case IssuesManager.CorsIssue.IssueCode.PreflightAllowPrivateNetworkError:
|
|
182
|
+
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
183
|
+
this.appendColumnTitle(header, i18nString(UIStrings.invalidValue));
|
|
184
|
+
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
185
|
+
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
186
|
+
break;
|
|
182
187
|
case IssuesManager.CorsIssue.IssueCode.MethodDisallowedByPreflightResponse:
|
|
183
188
|
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
184
189
|
this.appendColumnTitle(header, i18nString(UIStrings.disallowedRequestMethod));
|
|
@@ -249,6 +254,9 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
249
254
|
case Protocol.Network.CorsError.InvalidAllowCredentials:
|
|
250
255
|
case Protocol.Network.CorsError.PreflightInvalidAllowCredentials:
|
|
251
256
|
return 'Access-Control-Allow-Credentials';
|
|
257
|
+
case Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork:
|
|
258
|
+
case Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork:
|
|
259
|
+
return 'Access-Control-Allow-Private-Network';
|
|
252
260
|
case Protocol.Network.CorsError.RedirectContainsCredentials:
|
|
253
261
|
case Protocol.Network.CorsError.PreflightDisallowedRedirect:
|
|
254
262
|
return 'Location';
|
|
@@ -360,13 +368,21 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
360
368
|
this.appendIssueDetailCell(element, details.corsErrorStatus.failedParameter, 'code-example');
|
|
361
369
|
break;
|
|
362
370
|
case IssuesManager.CorsIssue.IssueCode.InsecurePrivateNetwork:
|
|
363
|
-
case IssuesManager.CorsIssue.IssueCode.InsecurePrivateNetworkPreflight:
|
|
364
371
|
element.appendChild(this.createRequestCell(details.request, opts));
|
|
365
372
|
this.appendStatus(element, details.isWarning);
|
|
366
373
|
this.appendIssueDetailCell(element, details.resourceIPAddressSpace ?? '');
|
|
367
374
|
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
368
375
|
this.appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
369
376
|
break;
|
|
377
|
+
case IssuesManager.CorsIssue.IssueCode.PreflightAllowPrivateNetworkError: {
|
|
378
|
+
element.appendChild(this.createRequestCell(details.request, opts));
|
|
379
|
+
this.appendStatus(element, details.isWarning);
|
|
380
|
+
element.appendChild(this.createRequestCell(details.request, {...opts, linkToPreflight: true, highlightHeader}));
|
|
381
|
+
this.appendIssueDetailCell(element, details.corsErrorStatus.failedParameter, 'code-example');
|
|
382
|
+
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
383
|
+
this.appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
370
386
|
case IssuesManager.CorsIssue.IssueCode.MethodDisallowedByPreflightResponse:
|
|
371
387
|
element.appendChild(this.createRequestCell(details.request, opts));
|
|
372
388
|
this.appendStatus(element, details.isWarning);
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
7
|
|
|
9
8
|
import type * as Lighthouse from './lighthouse.js';
|
|
@@ -22,8 +21,6 @@ let loadedLighthouseModule: (typeof Lighthouse|undefined);
|
|
|
22
21
|
|
|
23
22
|
async function loadLighthouseModule(): Promise<typeof Lighthouse> {
|
|
24
23
|
if (!loadedLighthouseModule) {
|
|
25
|
-
// Side-effect import resources in module.json
|
|
26
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/lighthouse');
|
|
27
24
|
loadedLighthouseModule = await import('./lighthouse.js');
|
|
28
25
|
}
|
|
29
26
|
return loadedLighthouseModule;
|
|
@@ -16,6 +16,7 @@ import {RequestTimeRangeNameToColor} from './NetworkOverview.js';
|
|
|
16
16
|
import type {Label, NetworkTimeCalculator} from './NetworkTimeCalculator.js';
|
|
17
17
|
import type {RequestTimeRange} from './RequestTimingView.js';
|
|
18
18
|
import {RequestTimeRangeNames, RequestTimingView} from './RequestTimingView.js';
|
|
19
|
+
import networkingTimingTableStyles from './networkTimingTable.css.js';
|
|
19
20
|
|
|
20
21
|
const BAR_SPACING = 1;
|
|
21
22
|
|
|
@@ -271,6 +272,7 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
|
|
|
271
272
|
show: (popover: UI.GlassPane.GlassPane): Promise<true> => {
|
|
272
273
|
const content =
|
|
273
274
|
RequestTimingView.createTimingTable((request as SDK.NetworkRequest.NetworkRequest), this.calculator);
|
|
275
|
+
popover.registerCSSFiles([networkingTimingTableStyles]);
|
|
274
276
|
popover.contentElement.appendChild(content);
|
|
275
277
|
return Promise.resolve(true);
|
|
276
278
|
},
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
import * as Common from '../../core/common/common.js';
|
|
32
32
|
import * as Host from '../../core/host/host.js';
|
|
33
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
33
34
|
import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
|
|
34
35
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
35
36
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -217,7 +218,8 @@ export class CPUProfileFlameChart extends
|
|
|
217
218
|
}
|
|
218
219
|
|
|
219
220
|
performSearch(searchConfig: UI.SearchableView.SearchConfig, _shouldJump: boolean, jumpBackwards?: boolean): void {
|
|
220
|
-
const matcher =
|
|
221
|
+
const matcher =
|
|
222
|
+
Platform.StringUtilities.createPlainTextSearchRegex(searchConfig.query, searchConfig.caseSensitive ? '' : 'i');
|
|
221
223
|
|
|
222
224
|
const selectedEntryIndex: number = this.searchResultIndex !== -1 ? this.searchResults[this.searchResultIndex] : -1;
|
|
223
225
|
this.searchResults = [];
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
31
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
31
32
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
32
33
|
|
|
33
34
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
@@ -528,7 +529,7 @@ export class ProfileDataGridTree implements UI.SearchableView.Searchable {
|
|
|
528
529
|
equalTo = true;
|
|
529
530
|
}
|
|
530
531
|
|
|
531
|
-
const matcher = createPlainTextSearchRegex(query, 'i');
|
|
532
|
+
const matcher = Platform.StringUtilities.createPlainTextSearchRegex(query, 'i');
|
|
532
533
|
|
|
533
534
|
function matchesQuery(profileDataGridNode: ProfileDataGridNode): boolean {
|
|
534
535
|
profileDataGridNode.searchMatchedSelfColumn = false;
|
|
@@ -432,18 +432,38 @@ export class SearchView extends UI.Widget.VBox {
|
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
+
/**
|
|
436
|
+
* Handles keydown event on panel itself for handling expand/collapse all shortcut
|
|
437
|
+
*
|
|
438
|
+
* We use `event.code` instead of `event.key` here to check whether the shortcut is triggered.
|
|
439
|
+
* The reason is, `event.key` is dependent on the modification keys, locale and keyboard layout.
|
|
440
|
+
* Usually it is useful when we care about the character that needs to be printed.
|
|
441
|
+
*
|
|
442
|
+
* However, our aim in here is to assign a shortcut to the physical key combination on the keyboard
|
|
443
|
+
* not on the character that the key combination prints.
|
|
444
|
+
*
|
|
445
|
+
* For example, `Cmd + [` shortcut in global shortcuts map to focusing on previous panel.
|
|
446
|
+
* In Turkish - Q keyboard layout, the key combination that triggers the shortcut prints `ğ`
|
|
447
|
+
* character. Whereas in Turkish - Q Legacy keyboard layout, the shortcut that triggers focusing
|
|
448
|
+
* on previous panel prints `[` character. So, if we use `event.key` and check
|
|
449
|
+
* whether it is `[`, we break the shortcut in Turkish - Q keyboard layout.
|
|
450
|
+
*
|
|
451
|
+
* @param event KeyboardEvent
|
|
452
|
+
*/
|
|
435
453
|
private onKeyDownOnPanel(event: KeyboardEvent): void {
|
|
436
454
|
const isMac = Host.Platform.isMac();
|
|
437
455
|
// "Command + Alt + ]" for Mac
|
|
438
|
-
const shouldShowAllForMac =
|
|
456
|
+
const shouldShowAllForMac =
|
|
457
|
+
isMac && event.metaKey && !event.ctrlKey && event.altKey && event.code === 'BracketRight';
|
|
439
458
|
// "Ctrl + Shift + }" for other platforms
|
|
440
459
|
const shouldShowAllForOtherPlatforms =
|
|
441
|
-
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.
|
|
460
|
+
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.code === 'BracketRight';
|
|
442
461
|
// "Command + Alt + [" for Mac
|
|
443
|
-
const shouldCollapseAllForMac =
|
|
462
|
+
const shouldCollapseAllForMac =
|
|
463
|
+
isMac && event.metaKey && !event.ctrlKey && event.altKey && event.code === 'BracketLeft';
|
|
444
464
|
// "Command + Alt + {" for other platforms
|
|
445
465
|
const shouldCollapseAllForOtherPlatforms =
|
|
446
|
-
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.
|
|
466
|
+
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.code === 'BracketLeft';
|
|
447
467
|
|
|
448
468
|
if (shouldShowAllForMac || shouldShowAllForOtherPlatforms) {
|
|
449
469
|
this.searchResultsPane?.showAllMatches();
|
|
@@ -92,7 +92,7 @@ function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.Sync
|
|
|
92
92
|
// clang-format off
|
|
93
93
|
return LitHtml.html`
|
|
94
94
|
<span class="warning">
|
|
95
|
-
${i18nString(UIStrings.syncDisabled)} <a href
|
|
95
|
+
${i18nString(UIStrings.syncDisabled)} <a href=${link} class="link" target="_blank"
|
|
96
96
|
@click=${(e: Event): void => openSettingsTab(link, e)}
|
|
97
97
|
@keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
|
|
98
98
|
</span>`;
|
|
@@ -104,7 +104,7 @@ function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.Sync
|
|
|
104
104
|
// clang-format off
|
|
105
105
|
return LitHtml.html`
|
|
106
106
|
<span class="warning">
|
|
107
|
-
${i18nString(UIStrings.preferencesSyncDisabled)} <a href
|
|
107
|
+
${i18nString(UIStrings.preferencesSyncDisabled)} <a href=${link} class="link" target="_blank"
|
|
108
108
|
@click=${(e: Event): void => openSettingsTab(link, e)}
|
|
109
109
|
@keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
|
|
110
110
|
</span>`;
|
|
@@ -356,9 +356,9 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
356
356
|
<input
|
|
357
357
|
class="input-field"
|
|
358
358
|
type="text"
|
|
359
|
-
@input
|
|
360
|
-
.value
|
|
361
|
-
placeholder
|
|
359
|
+
@input=${handleInputChange}
|
|
360
|
+
.value=${value}
|
|
361
|
+
placeholder=${placeholder}
|
|
362
362
|
/>
|
|
363
363
|
</label>
|
|
364
364
|
`;
|
|
@@ -376,22 +376,22 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
376
376
|
};
|
|
377
377
|
return LitHtml.html`
|
|
378
378
|
<span class="full-row label">${i18nString(UIStrings.platformLabel)}</span>
|
|
379
|
-
<div class="full-row brand-row" aria-label
|
|
379
|
+
<div class="full-row brand-row" aria-label=${i18nString(UIStrings.platformProperties)} role="group">
|
|
380
380
|
<input
|
|
381
381
|
class="input-field half-row"
|
|
382
382
|
type="text"
|
|
383
|
-
@input
|
|
384
|
-
.value
|
|
385
|
-
placeholder
|
|
386
|
-
aria-label
|
|
383
|
+
@input=${handlePlatformNameChange}
|
|
384
|
+
.value=${platform}
|
|
385
|
+
placeholder=${i18nString(UIStrings.platformPlaceholder)}
|
|
386
|
+
aria-label=${i18nString(UIStrings.platformLabel)}
|
|
387
387
|
/>
|
|
388
388
|
<input
|
|
389
389
|
class="input-field half-row"
|
|
390
390
|
type="text"
|
|
391
|
-
@input
|
|
392
|
-
.value
|
|
393
|
-
placeholder
|
|
394
|
-
aria-label
|
|
391
|
+
@input=${handlePlatformVersionChange}
|
|
392
|
+
.value=${platformVersion}
|
|
393
|
+
placeholder=${i18nString(UIStrings.platformVersion)}
|
|
394
|
+
aria-label=${i18nString(UIStrings.platformVersion)}
|
|
395
395
|
/>
|
|
396
396
|
</div>
|
|
397
397
|
`;
|
|
@@ -409,20 +409,20 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
409
409
|
};
|
|
410
410
|
const mobileCheckboxInput = this.showMobileCheckbox ? LitHtml.html`
|
|
411
411
|
<label class="mobile-checkbox-container">
|
|
412
|
-
<input type="checkbox" @input
|
|
412
|
+
<input type="checkbox" @input=${handleMobileChange} .checked=${mobile} />
|
|
413
413
|
${i18nString(UIStrings.mobileCheckboxLabel)}
|
|
414
414
|
</label>
|
|
415
415
|
` :
|
|
416
416
|
LitHtml.html``;
|
|
417
417
|
return LitHtml.html`
|
|
418
418
|
<span class="full-row label">${i18nString(UIStrings.deviceModel)}</span>
|
|
419
|
-
<div class="full-row brand-row" aria-label
|
|
419
|
+
<div class="full-row brand-row" aria-label=${i18nString(UIStrings.deviceProperties)} role="group">
|
|
420
420
|
<input
|
|
421
421
|
class="input-field ${this.showMobileCheckbox ? 'device-model-input' : 'full-row'}"
|
|
422
422
|
type="text"
|
|
423
|
-
@input
|
|
424
|
-
.value
|
|
425
|
-
placeholder
|
|
423
|
+
@input=${handleDeviceModelChange}
|
|
424
|
+
.value=${model}
|
|
425
|
+
placeholder=${i18nString(UIStrings.deviceModel)}
|
|
426
426
|
/>
|
|
427
427
|
${mobileCheckboxInput}
|
|
428
428
|
</div>
|
|
@@ -459,41 +459,41 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
459
459
|
this.handleBrandInputChange(value, index, 'brandVersion');
|
|
460
460
|
};
|
|
461
461
|
return LitHtml.html`
|
|
462
|
-
<div class="full-row brand-row" aria-label
|
|
462
|
+
<div class="full-row brand-row" aria-label=${i18nString(UIStrings.brandProperties)} role="group">
|
|
463
463
|
<input
|
|
464
464
|
class="input-field brand-name-input"
|
|
465
465
|
type="text"
|
|
466
|
-
@input
|
|
467
|
-
.value
|
|
466
|
+
@input=${handleBrandBrowserChange}
|
|
467
|
+
.value=${brand}
|
|
468
468
|
id="brand-${index + 1}-input"
|
|
469
|
-
placeholder
|
|
470
|
-
aria-label
|
|
469
|
+
placeholder=${i18nString(UIStrings.brandName)}
|
|
470
|
+
aria-label=${i18nString(UIStrings.brandNameAriaLabel, {
|
|
471
471
|
PH1: index + 1,
|
|
472
|
-
})}
|
|
472
|
+
})}
|
|
473
473
|
/>
|
|
474
474
|
<input
|
|
475
475
|
class="input-field"
|
|
476
476
|
type="text"
|
|
477
|
-
@input
|
|
478
|
-
.value
|
|
479
|
-
placeholder
|
|
480
|
-
aria-label
|
|
477
|
+
@input=${handleBrandVersionChange}
|
|
478
|
+
.value=${version}
|
|
479
|
+
placeholder=${i18nString(UIStrings.version)}
|
|
480
|
+
aria-label=${i18nString(UIStrings.brandVersionAriaLabel, {
|
|
481
481
|
PH1: index + 1,
|
|
482
|
-
})}
|
|
482
|
+
})}
|
|
483
483
|
/>
|
|
484
484
|
<${IconButton.Icon.Icon.litTagName}
|
|
485
485
|
.data=${
|
|
486
486
|
{color: 'var(--client-hints-form-icon-color)', iconName: 'trash_bin_icon', width: '10px', height: '14px'} as
|
|
487
487
|
IconButton.Icon.IconData}
|
|
488
|
-
title
|
|
488
|
+
title=${i18nString(UIStrings.deleteTooltip)}
|
|
489
489
|
class="delete-icon"
|
|
490
490
|
tabindex="0"
|
|
491
491
|
role="button"
|
|
492
|
-
@click
|
|
493
|
-
@keypress
|
|
494
|
-
aria-label
|
|
492
|
+
@click=${handleDeleteClick}
|
|
493
|
+
@keypress=${handleKeyPress}
|
|
494
|
+
aria-label=${i18nString(UIStrings.brandDeleteAriaLabel, {
|
|
495
495
|
PH1: index + 1,
|
|
496
|
-
})}
|
|
496
|
+
})}
|
|
497
497
|
>
|
|
498
498
|
</${IconButton.Icon.Icon.litTagName}>
|
|
499
499
|
</div>
|
|
@@ -507,9 +507,9 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
507
507
|
role="button"
|
|
508
508
|
tabindex="0"
|
|
509
509
|
id="add-brand-button"
|
|
510
|
-
aria-label
|
|
511
|
-
@click
|
|
512
|
-
@keypress
|
|
510
|
+
aria-label=${i18nString(UIStrings.addBrand)}
|
|
511
|
+
@click=${this.handleAddBrandClick}
|
|
512
|
+
@keypress=${this.handleAddBrandKeyPress}
|
|
513
513
|
>
|
|
514
514
|
<${IconButton.Icon.Icon.litTagName}
|
|
515
515
|
aria-hidden="true"
|
|
@@ -547,16 +547,16 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
547
547
|
<div
|
|
548
548
|
class="tree-title"
|
|
549
549
|
role="button"
|
|
550
|
-
@click
|
|
550
|
+
@click=${this.handleTreeClick}
|
|
551
551
|
tabindex="0"
|
|
552
|
-
@keydown
|
|
553
|
-
aria-expanded
|
|
552
|
+
@keydown=${this.handleTreeExpand}
|
|
553
|
+
aria-expanded=${this.isFormOpened}
|
|
554
554
|
aria-controls="form-container"
|
|
555
|
-
@disabled
|
|
556
|
-
aria-disabled
|
|
555
|
+
@disabled=${this.isFormDisabled}
|
|
556
|
+
aria-disabled=${this.isFormDisabled}
|
|
557
557
|
>
|
|
558
558
|
<${IconButton.Icon.Icon.litTagName}
|
|
559
|
-
class
|
|
559
|
+
class=${this.isFormOpened ? '' : 'rotate-icon'}
|
|
560
560
|
.data=${
|
|
561
561
|
{color: 'var(--client-hints-form-icon-color)', iconName: 'chromeSelect', width: '20px'} as
|
|
562
562
|
IconButton.Icon.IconData}
|
|
@@ -568,8 +568,8 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
568
568
|
href="https://web.dev/user-agent-client-hints/"
|
|
569
569
|
target="_blank"
|
|
570
570
|
class="info-link"
|
|
571
|
-
@keypress
|
|
572
|
-
aria-label
|
|
571
|
+
@keypress=${this.handleLinkPress}
|
|
572
|
+
aria-label=${i18nString(UIStrings.userAgentClientHintsInfo)}
|
|
573
573
|
>
|
|
574
574
|
<${IconButton.Icon.Icon.litTagName}
|
|
575
575
|
.data=${
|
|
@@ -582,7 +582,7 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
582
582
|
<form
|
|
583
583
|
id="form-container"
|
|
584
584
|
class="form-container ${this.isFormOpened ? '' : 'hide-container'}"
|
|
585
|
-
@submit
|
|
585
|
+
@submit=${this.handleSubmit}
|
|
586
586
|
>
|
|
587
587
|
${brandSection}
|
|
588
588
|
${fullBrowserInput}
|
|
@@ -591,7 +591,7 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
591
591
|
${deviceModelSection}
|
|
592
592
|
${submitButton}
|
|
593
593
|
</form>
|
|
594
|
-
<div aria-live="polite" aria-label
|
|
594
|
+
<div aria-live="polite" aria-label=${this.brandsModifiedAriaMessage}></div>
|
|
595
595
|
</section>
|
|
596
596
|
`;
|
|
597
597
|
// clang-format off
|
|
@@ -13,6 +13,9 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
13
13
|
|
|
14
14
|
import {Plugin} from './Plugin.js';
|
|
15
15
|
|
|
16
|
+
// Plugin to add CSS completion, shortcuts, and color/curve swatches
|
|
17
|
+
// to editors with CSS content.
|
|
18
|
+
|
|
16
19
|
const UIStrings = {
|
|
17
20
|
/**
|
|
18
21
|
*@description Swatch icon element title in CSSPlugin of the Sources panel
|
|
@@ -14,6 +14,8 @@ import * as Coverage from '../coverage/coverage.js';
|
|
|
14
14
|
|
|
15
15
|
import {Plugin} from './Plugin.js';
|
|
16
16
|
|
|
17
|
+
// Plugin that shows a gutter with coverage information when available.
|
|
18
|
+
|
|
17
19
|
const UIStrings = {
|
|
18
20
|
/**
|
|
19
21
|
*@description Text for Coverage Status Bar Item in Sources Panel
|
|
@@ -158,24 +158,37 @@ type BreakpointDescription = {
|
|
|
158
158
|
|
|
159
159
|
export class DebuggerPlugin extends Plugin {
|
|
160
160
|
private editor: TextEditor.TextEditor.TextEditor|undefined = undefined;
|
|
161
|
+
// Set if the debugger is stopped on a breakpoint in this file
|
|
161
162
|
private executionLocation: Workspace.UISourceCode.UILocation|null = null;
|
|
163
|
+
// Track state of the control key because holding it makes debugger
|
|
164
|
+
// target locations show up in the editor
|
|
162
165
|
private controlDown: boolean = false;
|
|
163
|
-
private sourceMapInfobar: UI.Infobar.Infobar|null = null;
|
|
164
166
|
private controlTimeout: number|undefined = undefined;
|
|
167
|
+
private sourceMapInfobar: UI.Infobar.Infobar|null = null;
|
|
165
168
|
private readonly scriptsPanel: SourcesPanel;
|
|
166
169
|
private readonly breakpointManager: Bindings.BreakpointManager.BreakpointManager;
|
|
170
|
+
// Manages pop-overs shown when the debugger is active and the user
|
|
171
|
+
// hovers over an expression
|
|
167
172
|
private readonly popoverHelper: UI.PopoverHelper.PopoverHelper;
|
|
168
173
|
private scriptFileForDebuggerModel:
|
|
169
174
|
Map<SDK.DebuggerModel.DebuggerModel, Bindings.ResourceScriptMapping.ResourceScriptFile>;
|
|
170
175
|
// The current set of breakpoints for this file. The locations in
|
|
171
|
-
// here are
|
|
172
|
-
//
|
|
176
|
+
// here are kept in sync with their editor position. When a file's
|
|
177
|
+
// content is edited and later saved, these are used as a source of
|
|
178
|
+
// truth for re-creating the breakpoints.
|
|
173
179
|
private breakpoints: BreakpointDescription[] = [];
|
|
174
180
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
175
181
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
176
182
|
private continueToLocations: {from: number, to: number, async: boolean, click: () => void}[]|null = null;
|
|
177
183
|
private readonly liveLocationPool: Bindings.LiveLocation.LiveLocationPool;
|
|
184
|
+
// When the editor content is changed by the user, this becomes
|
|
185
|
+
// true. When the plugin is muted, breakpoints show up as disabled
|
|
186
|
+
// and can't be manipulated. It is cleared again when the content is
|
|
187
|
+
// saved.
|
|
178
188
|
private muted: boolean;
|
|
189
|
+
// If the plugin is initialized in muted state, we cannot correlated
|
|
190
|
+
// breakpoint position in the breakpoint manager with editor
|
|
191
|
+
// locations, so breakpoint manipulation is permanently disabled.
|
|
179
192
|
private initializedMuted: boolean;
|
|
180
193
|
private ignoreListInfobar: UI.Infobar.Infobar|null;
|
|
181
194
|
private prettyPrintInfobar!: UI.Infobar.Infobar|null;
|
|
@@ -236,6 +249,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
236
249
|
}
|
|
237
250
|
|
|
238
251
|
editorExtension(): CodeMirror.Extension {
|
|
252
|
+
// Kludge to hook editor keyboard events into the ShortcutRegistry
|
|
253
|
+
// system.
|
|
239
254
|
const handlers = this.shortcutHandlers();
|
|
240
255
|
|
|
241
256
|
return [
|
|
@@ -309,6 +324,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
309
324
|
}
|
|
310
325
|
|
|
311
326
|
editorInitialized(editor: TextEditor.TextEditor.TextEditor): void {
|
|
327
|
+
// Start asynchronous actions that require access to the editor
|
|
328
|
+
// instance
|
|
312
329
|
this.editor = editor;
|
|
313
330
|
computeNonBreakableLines(editor.state, this.uiSourceCode).then(linePositions => {
|
|
314
331
|
if (linePositions.length) {
|
|
@@ -685,6 +702,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
685
702
|
|
|
686
703
|
private onEditorUpdate(update: CodeMirror.ViewUpdate): void {
|
|
687
704
|
if (!update.changes.empty) {
|
|
705
|
+
// If the document changed, adjust known breakpoint positions
|
|
706
|
+
// for that change
|
|
688
707
|
for (const breakpointDesc of this.breakpoints) {
|
|
689
708
|
breakpointDesc.position = update.changes.mapPos(breakpointDesc.position);
|
|
690
709
|
}
|
|
@@ -811,6 +830,7 @@ export class DebuggerPlugin extends Plugin {
|
|
|
811
830
|
dialog.focusEditor();
|
|
812
831
|
}
|
|
813
832
|
|
|
833
|
+
// Create decorations to indicate the current debugging position
|
|
814
834
|
private computeExecutionDecorations(editorState: CodeMirror.EditorState, lineNumber: number, columnNumber: number):
|
|
815
835
|
CodeMirror.DecorationSet {
|
|
816
836
|
const {doc} = editorState;
|
|
@@ -957,6 +977,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
957
977
|
return namesPerLine;
|
|
958
978
|
}
|
|
959
979
|
|
|
980
|
+
// Highlight the locations the debugger can continue to (when
|
|
981
|
+
// Control is held)
|
|
960
982
|
private async showContinueToLocations(): Promise<void> {
|
|
961
983
|
this.popoverHelper.hidePopover();
|
|
962
984
|
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
|
@@ -1098,6 +1120,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1098
1120
|
return this.breakpoints.filter(b => b.position >= line.from && b.position <= line.to).map(b => b.breakpoint);
|
|
1099
1121
|
}
|
|
1100
1122
|
|
|
1123
|
+
// Compute the decorations for existing breakpoints (both on the
|
|
1124
|
+
// gutter and inline in the code)
|
|
1101
1125
|
private async computeBreakpointDecoration(state: CodeMirror.EditorState, breakpoints: BreakpointDescription[]):
|
|
1102
1126
|
Promise<BreakpointDecoration> {
|
|
1103
1127
|
const decorations: CodeMirror.Range<CodeMirror.Decoration>[] = [];
|
|
@@ -1302,7 +1326,7 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1302
1326
|
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DidMergeToVM, this.didMergeToVM, this);
|
|
1303
1327
|
oldScriptFile.removeEventListener(
|
|
1304
1328
|
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DidDivergeFromVM, this.didDivergeFromVM, this);
|
|
1305
|
-
if (this.muted && !this.uiSourceCode.isDirty() && this.consistentScripts) {
|
|
1329
|
+
if (this.muted && !this.uiSourceCode.isDirty() && this.consistentScripts()) {
|
|
1306
1330
|
this.setMuted(false);
|
|
1307
1331
|
}
|
|
1308
1332
|
}
|
|
@@ -1520,7 +1544,7 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1520
1544
|
}
|
|
1521
1545
|
}
|
|
1522
1546
|
|
|
1523
|
-
// Infobar panel state
|
|
1547
|
+
// Infobar panel state, used to show additional panels below the editor.
|
|
1524
1548
|
|
|
1525
1549
|
const addInfobar = CodeMirror.StateEffect.define<UI.Infobar.Infobar>();
|
|
1526
1550
|
const removeInfobar = CodeMirror.StateEffect.define<UI.Infobar.Infobar>();
|
|
@@ -12,6 +12,9 @@ import * as Snippets from '../snippets/snippets.js';
|
|
|
12
12
|
|
|
13
13
|
import {Plugin} from './Plugin.js';
|
|
14
14
|
|
|
15
|
+
// Plugin that tries to compile the editor content and highlights
|
|
16
|
+
// compilation errors.
|
|
17
|
+
|
|
15
18
|
export class JavaScriptCompilerPlugin extends Plugin {
|
|
16
19
|
private compiling: boolean = false;
|
|
17
20
|
private recompileScheduled: boolean = false;
|
|
@@ -11,6 +11,9 @@ import type * as TextEditor from '../../ui/components/text_editor/text_editor.js
|
|
|
11
11
|
|
|
12
12
|
import {Plugin} from './Plugin.js';
|
|
13
13
|
|
|
14
|
+
// Defines plugins that show profiling information in the editor
|
|
15
|
+
// gutter when available.
|
|
16
|
+
|
|
14
17
|
const UIStrings = {
|
|
15
18
|
/**
|
|
16
19
|
*@description The milisecond unit
|