chrome-devtools-frontend 1.0.951410 → 1.0.952713
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 +3 -0
- package/extension-api/ExtensionAPI.d.ts +1 -1
- package/front_end/.eslintrc.js +6 -0
- package/front_end/Tests.js +10 -0
- package/front_end/core/common/App.ts +0 -3
- package/front_end/core/common/AppProvider.ts +0 -3
- package/front_end/core/common/JavaScriptMetaData.ts +0 -3
- package/front_end/core/common/QueryParamHandler.ts +0 -3
- package/front_end/core/common/Runnable.ts +0 -3
- package/front_end/core/common/SimpleHistoryManager.ts +0 -3
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/core/root/Runtime.ts +4 -12
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -12
- package/front_end/core/sdk/PageResourceLoader.ts +2 -1
- package/front_end/core/sdk/TracingManager.ts +0 -3
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +39 -39
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +54 -54
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +20 -20
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +54 -54
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +145 -144
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +40 -40
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +64 -69
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +203 -203
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +109 -108
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +17 -17
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +30 -30
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +25 -25
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +52 -55
- package/front_end/entrypoints/main/MainImpl.ts +49 -49
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +43 -43
- package/front_end/entrypoints/node_app/NodeMain.ts +38 -38
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +16 -0
- package/front_end/legacy/legacy-defs.d.ts +0 -21
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -3
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -3
- package/front_end/models/bindings/FileUtils.ts +0 -3
- package/front_end/models/extensions/ExtensionAPI.ts +2 -1
- package/front_end/models/extensions/ExtensionTraceProvider.ts +0 -3
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +1 -1
- package/front_end/models/issues_manager/ClientHintIssue.ts +95 -0
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
- package/front_end/models/issues_manager/CorsIssue.ts +9 -9
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
- package/front_end/models/issues_manager/GenericIssue.ts +5 -5
- package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
- package/front_end/models/issues_manager/Issue.ts +10 -10
- package/front_end/models/issues_manager/IssueResolver.ts +11 -10
- package/front_end/models/issues_manager/IssuesManager.ts +61 -56
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
- package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
- package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
- package/front_end/models/issues_manager/SameSiteCookieIssue.ts +16 -16
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
- package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
- package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/timeline_model/TimelineModel.ts +1 -1
- package/front_end/panels/application/components/BackForwardCacheView.ts +33 -33
- package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
- package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
- package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
- package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
- package/front_end/panels/application/components/ReportsGrid.ts +30 -30
- package/front_end/panels/application/components/StackTrace.ts +48 -47
- package/front_end/panels/application/components/TrustTokensView.ts +31 -31
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -25
- package/front_end/panels/console/consoleView.css +5 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
- package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
- package/front_end/panels/elements/ElementsTreeElement.ts +2 -6
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
- package/front_end/panels/elements/components/AdornerManager.ts +21 -21
- package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
- package/front_end/panels/elements/components/CSSQuery.ts +16 -16
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
- package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
- package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
- package/front_end/panels/elements/components/LayoutPane.ts +47 -47
- package/front_end/panels/elements/components/NodeText.ts +18 -18
- package/front_end/panels/elements/components/QueryContainer.ts +40 -40
- package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
- package/front_end/panels/event_listeners/EventListenersUtils.ts +2 -1
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
- package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
- package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
- package/front_end/panels/issues/AffectedElementsView.ts +4 -4
- package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
- package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
- package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
- package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
- package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
- package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
- package/front_end/panels/issues/CSPViolationsView.ts +17 -17
- package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
- package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
- package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
- package/front_end/panels/issues/IssueAggregator.ts +95 -95
- package/front_end/panels/issues/IssueKindView.ts +14 -14
- package/front_end/panels/issues/IssueView.ts +98 -98
- package/front_end/panels/issues/IssuesPane.ts +102 -102
- package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
- package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
- package/front_end/panels/media/PlayerListView.ts +160 -97
- package/front_end/panels/media/PlayerMessagesView.ts +1 -0
- package/front_end/panels/media/playerListView.css +58 -0
- package/front_end/panels/network/NetworkLogView.ts +2 -6
- package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
- package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
- package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +92 -37
- package/front_end/panels/performance_monitor/performanceMonitor.css +32 -0
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/search/SearchConfig.ts +0 -6
- package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -0
- package/front_end/panels/settings/components/SyncSection.ts +14 -14
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/sources/NavigatorView.ts +3 -9
- package/front_end/panels/sources/SourceMapNamesResolver.ts +3 -3
- package/front_end/panels/sources/SourcesPanel.ts +1 -3
- package/front_end/panels/sources/SourcesView.ts +0 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +0 -3
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelineLoader.ts +0 -3
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
- package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
- package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
- package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
- package/front_end/third_party/codemirror.next/bundle.ts +3 -3
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +10 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +2 -1
- package/front_end/third_party/codemirror.next/package.json +3 -3
- package/front_end/third_party/diff/DiffWrapper.ts +7 -0
- package/front_end/ui/components/adorners/Adorner.ts +2 -2
- package/front_end/ui/components/buttons/Button.ts +9 -9
- package/front_end/ui/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
- package/front_end/ui/components/data_grid/DataGridUtils.ts +3 -0
- package/front_end/ui/components/diff_view/DiffView.ts +6 -6
- package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
- package/front_end/ui/components/icon_button/Icon.ts +4 -4
- package/front_end/ui/components/icon_button/IconButton.ts +4 -4
- package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
- package/front_end/ui/components/report_view/ReportView.ts +16 -16
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
- package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
- package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
- package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -1
- package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
- package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
- package/front_end/ui/legacy/ContextFlavorListener.ts +0 -4
- package/front_end/ui/legacy/SearchableView.ts +13 -4
- package/front_end/ui/legacy/SuggestBox.ts +0 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -3
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +13 -12
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -2
- package/front_end/ui/legacy/themeColors.css +2 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +34 -7
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
- package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
- package/scripts/migration/class-fields/migrate.js +2 -3
- package/scripts/migration/class-fields/migrate.sh +1 -3
- package/scripts/migration/class-fields/package.json +1 -1
- package/config/gni/all_devtools_files.gni +0 -255
- package/scripts/build/devtools_file_hashes.py +0 -82
- package/scripts/devtools_run/devtools_run_cli +0 -49
- package/scripts/devtools_run/package.json +0 -13
- package/scripts/unzip.py +0 -20
- package/scripts/visualize_deps/jquery_svg.html +0 -57
- package/scripts/visualize_deps/run_visualize.js +0 -119
|
@@ -38,8 +38,8 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
38
38
|
let nodeConnectionsPanelInstance: NodeConnectionsPanel;
|
|
39
39
|
|
|
40
40
|
export class NodeConnectionsPanel extends UI.Panel.Panel {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
#config!: Adb.Config;
|
|
42
|
+
readonly #networkDiscoveryView: NodeConnectionsView;
|
|
43
43
|
private constructor() {
|
|
44
44
|
super('node-connection');
|
|
45
45
|
|
|
@@ -51,7 +51,7 @@ export class NodeConnectionsPanel extends UI.Panel.Panel {
|
|
|
51
51
|
image.src = 'https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg';
|
|
52
52
|
|
|
53
53
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(
|
|
54
|
-
Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this
|
|
54
|
+
Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.#devicesDiscoveryConfigChanged, this);
|
|
55
55
|
|
|
56
56
|
this.contentElement.tabIndex = 0;
|
|
57
57
|
this.setDefaultFocusedElement(this.contentElement);
|
|
@@ -60,11 +60,11 @@ export class NodeConnectionsPanel extends UI.Panel.Panel {
|
|
|
60
60
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesUpdatesEnabled(false);
|
|
61
61
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesUpdatesEnabled(true);
|
|
62
62
|
|
|
63
|
-
this
|
|
64
|
-
this
|
|
65
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesDiscoveryConfig(this
|
|
63
|
+
this.#networkDiscoveryView = new NodeConnectionsView(config => {
|
|
64
|
+
this.#config.networkDiscoveryConfig = config;
|
|
65
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesDiscoveryConfig(this.#config);
|
|
66
66
|
});
|
|
67
|
-
this
|
|
67
|
+
this.#networkDiscoveryView.show(container);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
static instance(opts: {
|
|
@@ -78,9 +78,9 @@ export class NodeConnectionsPanel extends UI.Panel.Panel {
|
|
|
78
78
|
return nodeConnectionsPanelInstance;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
this
|
|
83
|
-
this
|
|
81
|
+
#devicesDiscoveryConfigChanged({data: config}: Common.EventTarget.EventTargetEvent<Adb.Config>): void {
|
|
82
|
+
this.#config = config;
|
|
83
|
+
this.#networkDiscoveryView.discoveryConfigChanged(this.#config.networkDiscoveryConfig);
|
|
84
84
|
}
|
|
85
85
|
wasShown(): void {
|
|
86
86
|
super.wasShown();
|
|
@@ -89,15 +89,15 @@ export class NodeConnectionsPanel extends UI.Panel.Panel {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget.Delegate<Adb.PortForwardingRule> {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
readonly #callback: (arg0: Adb.NetworkDiscoveryConfig) => void;
|
|
93
|
+
readonly #list: UI.ListWidget.ListWidget<Adb.PortForwardingRule>;
|
|
94
|
+
#editor: UI.ListWidget.Editor<Adb.PortForwardingRule>|null;
|
|
95
|
+
#networkDiscoveryConfig: {
|
|
96
96
|
address: string,
|
|
97
97
|
}[];
|
|
98
98
|
constructor(callback: (arg0: Adb.NetworkDiscoveryConfig) => void) {
|
|
99
99
|
super();
|
|
100
|
-
this
|
|
100
|
+
this.#callback = callback;
|
|
101
101
|
this.element.classList.add('network-discovery-view');
|
|
102
102
|
|
|
103
103
|
const networkDiscoveryFooter = this.element.createChild('div', 'network-discovery-footer');
|
|
@@ -106,42 +106,42 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
|
|
|
106
106
|
networkDiscoveryFooter.appendChild(
|
|
107
107
|
i18n.i18n.getFormatLocalizedString(str_, UIStrings.specifyNetworkEndpointAnd, {PH1: documentationLink}));
|
|
108
108
|
|
|
109
|
-
this
|
|
109
|
+
this.#list = new UI.ListWidget.ListWidget(this);
|
|
110
110
|
|
|
111
|
-
this
|
|
111
|
+
this.#list.element.classList.add('network-discovery-list');
|
|
112
112
|
const placeholder = document.createElement('div');
|
|
113
113
|
placeholder.classList.add('network-discovery-list-empty');
|
|
114
114
|
placeholder.textContent = i18nString(UIStrings.noConnectionsSpecified);
|
|
115
|
-
this
|
|
116
|
-
this
|
|
117
|
-
this
|
|
115
|
+
this.#list.setEmptyPlaceholder(placeholder);
|
|
116
|
+
this.#list.show(this.element);
|
|
117
|
+
this.#editor = null;
|
|
118
118
|
|
|
119
119
|
const addButton = UI.UIUtils.createTextButton(
|
|
120
|
-
i18nString(UIStrings.addConnection), this
|
|
121
|
-
true /* primary */);
|
|
120
|
+
i18nString(UIStrings.addConnection), this.#addNetworkTargetButtonClicked.bind(this),
|
|
121
|
+
'add-network-target-button', true /* primary */);
|
|
122
122
|
this.element.appendChild(addButton);
|
|
123
123
|
|
|
124
|
-
this
|
|
124
|
+
this.#networkDiscoveryConfig = [];
|
|
125
125
|
|
|
126
126
|
this.element.classList.add('node-frontend');
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
const config = this
|
|
131
|
-
this
|
|
129
|
+
#update(): void {
|
|
130
|
+
const config = this.#networkDiscoveryConfig.map(item => item.address);
|
|
131
|
+
this.#callback.call(null, config);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
this
|
|
134
|
+
#addNetworkTargetButtonClicked(): void {
|
|
135
|
+
this.#list.addNewItem(this.#networkDiscoveryConfig.length, {address: '', port: ''});
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
discoveryConfigChanged(networkDiscoveryConfig: Adb.NetworkDiscoveryConfig): void {
|
|
139
|
-
this
|
|
140
|
-
this
|
|
139
|
+
this.#networkDiscoveryConfig = [];
|
|
140
|
+
this.#list.clear();
|
|
141
141
|
for (const address of networkDiscoveryConfig) {
|
|
142
142
|
const item = {address: address, port: ''};
|
|
143
|
-
this
|
|
144
|
-
this
|
|
143
|
+
this.#networkDiscoveryConfig.push(item);
|
|
144
|
+
this.#list.appendItem(item, true);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -153,32 +153,32 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
removeItemRequested(rule: Adb.PortForwardingRule, index: number): void {
|
|
156
|
-
this
|
|
157
|
-
this
|
|
158
|
-
this
|
|
156
|
+
this.#networkDiscoveryConfig.splice(index, 1);
|
|
157
|
+
this.#list.removeItem(index);
|
|
158
|
+
this.#update();
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
commitEdit(rule: Adb.PortForwardingRule, editor: UI.ListWidget.Editor<Adb.PortForwardingRule>, isNew: boolean): void {
|
|
162
162
|
rule.address = editor.control('address').value.trim();
|
|
163
163
|
if (isNew) {
|
|
164
|
-
this
|
|
164
|
+
this.#networkDiscoveryConfig.push(rule);
|
|
165
165
|
}
|
|
166
|
-
this
|
|
166
|
+
this.#update();
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
beginEdit(rule: Adb.PortForwardingRule): UI.ListWidget.Editor<Adb.PortForwardingRule> {
|
|
170
|
-
const editor = this
|
|
170
|
+
const editor = this.#createEditor();
|
|
171
171
|
editor.control('address').value = rule.address;
|
|
172
172
|
return editor;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
if (this
|
|
177
|
-
return this
|
|
175
|
+
#createEditor(): UI.ListWidget.Editor<Adb.PortForwardingRule> {
|
|
176
|
+
if (this.#editor) {
|
|
177
|
+
return this.#editor;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
const editor = new UI.ListWidget.Editor<Adb.PortForwardingRule>();
|
|
181
|
-
this
|
|
181
|
+
this.#editor = editor;
|
|
182
182
|
const content = editor.contentElement();
|
|
183
183
|
const fields = content.createChild('div', 'network-discovery-edit-row');
|
|
184
184
|
const input =
|
|
@@ -204,6 +204,6 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
|
|
|
204
204
|
}
|
|
205
205
|
wasShown(): void {
|
|
206
206
|
super.wasShown();
|
|
207
|
-
this
|
|
207
|
+
this.#list.registerCSSFiles([nodeConnectionsPanelStyles]);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -46,29 +46,29 @@ export class NodeMainImpl implements Common.Runnable.Runnable {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implements ProtocolProxyApi.TargetDispatcher {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
readonly #targetManager: SDK.TargetManager.TargetManager;
|
|
50
|
+
readonly #parentTarget: SDK.Target.Target;
|
|
51
|
+
readonly #targetAgent: ProtocolProxyApi.TargetApi;
|
|
52
|
+
readonly #childTargets: Map<Protocol.Target.SessionID, SDK.Target.Target>;
|
|
53
|
+
readonly #childConnections: Map<string, NodeConnection>;
|
|
54
54
|
constructor(parentTarget: SDK.Target.Target) {
|
|
55
55
|
super(parentTarget);
|
|
56
|
-
this
|
|
57
|
-
this
|
|
58
|
-
this
|
|
59
|
-
this
|
|
60
|
-
this
|
|
56
|
+
this.#targetManager = parentTarget.targetManager();
|
|
57
|
+
this.#parentTarget = parentTarget;
|
|
58
|
+
this.#targetAgent = parentTarget.targetAgent();
|
|
59
|
+
this.#childTargets = new Map();
|
|
60
|
+
this.#childConnections = new Map();
|
|
61
61
|
|
|
62
62
|
parentTarget.registerTargetDispatcher(this);
|
|
63
|
-
this
|
|
63
|
+
this.#targetAgent.invoke_setDiscoverTargets({discover: true});
|
|
64
64
|
|
|
65
65
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(
|
|
66
|
-
Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this
|
|
66
|
+
Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.#devicesDiscoveryConfigChanged, this);
|
|
67
67
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesUpdatesEnabled(false);
|
|
68
68
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesUpdatesEnabled(true);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
#devicesDiscoveryConfigChanged({data: config}: Common.EventTarget.EventTargetEvent<Adb.Config>): void {
|
|
72
72
|
const locations = [];
|
|
73
73
|
for (const address of config.networkDiscoveryConfig) {
|
|
74
74
|
const parts = address.split(':');
|
|
@@ -77,21 +77,21 @@ export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implemen
|
|
|
77
77
|
locations.push({host: parts[0], port: port});
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
this
|
|
80
|
+
this.#targetAgent.invoke_setRemoteLocations({locations});
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
dispose(): void {
|
|
84
84
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.removeEventListener(
|
|
85
|
-
Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this
|
|
85
|
+
Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.#devicesDiscoveryConfigChanged, this);
|
|
86
86
|
|
|
87
|
-
for (const sessionId of this
|
|
87
|
+
for (const sessionId of this.#childTargets.keys()) {
|
|
88
88
|
this.detachedFromTarget({sessionId});
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
targetCreated({targetInfo}: Protocol.Target.TargetCreatedEvent): void {
|
|
93
93
|
if (targetInfo.type === 'node' && !targetInfo.attached) {
|
|
94
|
-
this
|
|
94
|
+
this.#targetAgent.invoke_attachToTarget({targetId: targetInfo.targetId, flatten: false});
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -103,25 +103,25 @@ export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implemen
|
|
|
103
103
|
|
|
104
104
|
attachedToTarget({sessionId, targetInfo}: Protocol.Target.AttachedToTargetEvent): void {
|
|
105
105
|
const name = i18nString(UIStrings.nodejsS, {PH1: targetInfo.url});
|
|
106
|
-
const connection = new NodeConnection(this
|
|
107
|
-
this
|
|
108
|
-
const target = this
|
|
109
|
-
targetInfo.targetId, name, SDK.Target.Type.Node, this
|
|
110
|
-
this
|
|
106
|
+
const connection = new NodeConnection(this.#targetAgent, sessionId);
|
|
107
|
+
this.#childConnections.set(sessionId, connection);
|
|
108
|
+
const target = this.#targetManager.createTarget(
|
|
109
|
+
targetInfo.targetId, name, SDK.Target.Type.Node, this.#parentTarget, undefined, undefined, connection);
|
|
110
|
+
this.#childTargets.set(sessionId, target);
|
|
111
111
|
target.runtimeAgent().invoke_runIfWaitingForDebugger();
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
detachedFromTarget({sessionId}: Protocol.Target.DetachedFromTargetEvent): void {
|
|
115
|
-
const childTarget = this
|
|
115
|
+
const childTarget = this.#childTargets.get(sessionId);
|
|
116
116
|
if (childTarget) {
|
|
117
117
|
childTarget.dispose('target terminated');
|
|
118
118
|
}
|
|
119
|
-
this
|
|
120
|
-
this
|
|
119
|
+
this.#childTargets.delete(sessionId);
|
|
120
|
+
this.#childConnections.delete(sessionId);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
receivedMessageFromTarget({sessionId, message}: Protocol.Target.ReceivedMessageFromTargetEvent): void {
|
|
124
|
-
const connection = this
|
|
124
|
+
const connection = this.#childConnections.get(sessionId);
|
|
125
125
|
const onMessage = connection ? connection.onMessage : null;
|
|
126
126
|
if (onMessage) {
|
|
127
127
|
onMessage.call(null, message);
|
|
@@ -133,15 +133,15 @@ export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implemen
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
export class NodeConnection implements ProtocolClient.InspectorBackend.Connection {
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
readonly #targetAgent: ProtocolProxyApi.TargetApi;
|
|
137
|
+
readonly #sessionId: Protocol.Target.SessionID;
|
|
138
138
|
onMessage: ((arg0: (Object|string)) => void)|null;
|
|
139
|
-
|
|
139
|
+
#onDisconnect: ((arg0: string) => void)|null;
|
|
140
140
|
constructor(targetAgent: ProtocolProxyApi.TargetApi, sessionId: Protocol.Target.SessionID) {
|
|
141
|
-
this
|
|
142
|
-
this
|
|
141
|
+
this.#targetAgent = targetAgent;
|
|
142
|
+
this.#sessionId = sessionId;
|
|
143
143
|
this.onMessage = null;
|
|
144
|
-
this
|
|
144
|
+
this.#onDisconnect = null;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
setOnMessage(onMessage: (arg0: (Object|string)) => void): void {
|
|
@@ -149,20 +149,20 @@ export class NodeConnection implements ProtocolClient.InspectorBackend.Connectio
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
setOnDisconnect(onDisconnect: (arg0: string) => void): void {
|
|
152
|
-
this
|
|
152
|
+
this.#onDisconnect = onDisconnect;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
sendRawMessage(message: string): void {
|
|
156
|
-
this
|
|
156
|
+
this.#targetAgent.invoke_sendMessageToTarget({message, sessionId: this.#sessionId});
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
async disconnect(): Promise<void> {
|
|
160
|
-
if (this
|
|
161
|
-
this
|
|
160
|
+
if (this.#onDisconnect) {
|
|
161
|
+
this.#onDisconnect.call(null, 'force disconnect');
|
|
162
162
|
}
|
|
163
|
-
this
|
|
163
|
+
this.#onDisconnect = null;
|
|
164
164
|
this.onMessage = null;
|
|
165
|
-
await this
|
|
165
|
+
await this.#targetAgent.invoke_detachFromTarget({sessionId: this.#sessionId});
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -279,6 +279,9 @@ export function registerCommands(inspectorBackend) {
|
|
|
279
279
|
});
|
|
280
280
|
inspectorBackend.registerEnum(
|
|
281
281
|
'Audits.GenericIssueErrorType', {CrossOriginPortalPostMessageError: 'CrossOriginPortalPostMessageError'});
|
|
282
|
+
inspectorBackend.registerEnum(
|
|
283
|
+
'Audits.ClientHintIssueReason',
|
|
284
|
+
{MetaTagAllowListInvalidOrigin: 'MetaTagAllowListInvalidOrigin', MetaTagModifiedHTML: 'MetaTagModifiedHTML'});
|
|
282
285
|
inspectorBackend.registerEnum('Audits.InspectorIssueCode', {
|
|
283
286
|
SameSiteCookieIssue: 'SameSiteCookieIssue',
|
|
284
287
|
MixedContentIssue: 'MixedContentIssue',
|
|
@@ -294,7 +297,8 @@ export function registerCommands(inspectorBackend) {
|
|
|
294
297
|
NavigatorUserAgentIssue: 'NavigatorUserAgentIssue',
|
|
295
298
|
WasmCrossOriginModuleSharingIssue: 'WasmCrossOriginModuleSharingIssue',
|
|
296
299
|
GenericIssue: 'GenericIssue',
|
|
297
|
-
DeprecationIssue: 'DeprecationIssue'
|
|
300
|
+
DeprecationIssue: 'DeprecationIssue',
|
|
301
|
+
ClientHintIssue: 'ClientHintIssue'
|
|
298
302
|
});
|
|
299
303
|
inspectorBackend.registerEvent('Audits.issueAdded', ['issue']);
|
|
300
304
|
inspectorBackend.registerEnum('Audits.GetEncodedResponseRequestEncoding', {Webp: 'webp', Jpeg: 'jpeg', Png: 'png'});
|
|
@@ -1049,6 +1049,20 @@ declare namespace Protocol {
|
|
|
1049
1049
|
message?: string;
|
|
1050
1050
|
}
|
|
1051
1051
|
|
|
1052
|
+
export const enum ClientHintIssueReason {
|
|
1053
|
+
MetaTagAllowListInvalidOrigin = 'MetaTagAllowListInvalidOrigin',
|
|
1054
|
+
MetaTagModifiedHTML = 'MetaTagModifiedHTML',
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* This issue tracks client hints related issues. It's used to deprecate old
|
|
1059
|
+
* features, encourage the use of new ones, and provide general guidance.
|
|
1060
|
+
*/
|
|
1061
|
+
export interface ClientHintIssueDetails {
|
|
1062
|
+
sourceCodeLocation: SourceCodeLocation;
|
|
1063
|
+
clientHintIssueReason: ClientHintIssueReason;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1052
1066
|
/**
|
|
1053
1067
|
* A unique identifier for the type of issue. Each type may use one of the
|
|
1054
1068
|
* optional fields in InspectorIssueDetails to convey more specific
|
|
@@ -1070,6 +1084,7 @@ declare namespace Protocol {
|
|
|
1070
1084
|
WasmCrossOriginModuleSharingIssue = 'WasmCrossOriginModuleSharingIssue',
|
|
1071
1085
|
GenericIssue = 'GenericIssue',
|
|
1072
1086
|
DeprecationIssue = 'DeprecationIssue',
|
|
1087
|
+
ClientHintIssue = 'ClientHintIssue',
|
|
1073
1088
|
}
|
|
1074
1089
|
|
|
1075
1090
|
/**
|
|
@@ -1093,6 +1108,7 @@ declare namespace Protocol {
|
|
|
1093
1108
|
wasmCrossOriginModuleSharingIssue?: WasmCrossOriginModuleSharingIssueDetails;
|
|
1094
1109
|
genericIssueDetails?: GenericIssueDetails;
|
|
1095
1110
|
deprecationIssueDetails?: DeprecationIssueDetails;
|
|
1111
|
+
clientHintIssueDetails?: ClientHintIssueDetails;
|
|
1096
1112
|
}
|
|
1097
1113
|
|
|
1098
1114
|
/**
|
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
interface Window {
|
|
6
|
-
UI: {themeSupport: unknown}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface RegExp {
|
|
10
|
-
__fromRegExpQuery: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
5
|
declare class AnchorBox {
|
|
14
6
|
x: number;
|
|
15
7
|
y: number;
|
|
@@ -123,19 +115,6 @@ declare function isEnterOrSpaceKey(event: Event): boolean;
|
|
|
123
115
|
declare function isEscKey(event: Event): boolean;
|
|
124
116
|
declare function onInvokeElement(element: Element, callback: (event: Event) => void): void;
|
|
125
117
|
|
|
126
|
-
interface ServicePort {
|
|
127
|
-
setHandlers(messageHandler: (arg: string) => void, closeHandler: () => void): void;
|
|
128
|
-
|
|
129
|
-
send(message: string): Promise<boolean>;
|
|
130
|
-
|
|
131
|
-
close(): Promise<boolean>;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
declare class diff_match_patch {
|
|
135
|
-
diff_main(text1: string, text2: string): Array<{0: number, 1: string}>;
|
|
136
|
-
diff_cleanupSemantic(diff: Array<{0: number, 1: string}>): void;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
118
|
// The following types exist in Chrome but were removed for various reasons
|
|
140
119
|
// from the TypeScript DOM library.
|
|
141
120
|
//
|
|
@@ -152,9 +152,6 @@ export class CSSWorkspaceBinding implements SDK.TargetManager.SDKModelObserver<S
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
/**
|
|
156
|
-
* @interface
|
|
157
|
-
*/
|
|
158
155
|
export interface SourceMapping {
|
|
159
156
|
rawLocationToUILocation(rawLocation: SDK.CSSModel.CSSLocation): Workspace.UISourceCode.UILocation|null;
|
|
160
157
|
|
|
@@ -561,9 +561,6 @@ export interface RawLocationRange {
|
|
|
561
561
|
end: SDK.DebuggerModel.Location;
|
|
562
562
|
}
|
|
563
563
|
|
|
564
|
-
/**
|
|
565
|
-
* @interface
|
|
566
|
-
*/
|
|
567
564
|
export interface DebuggerSourceMapping {
|
|
568
565
|
rawLocationToUILocation(rawLocation: SDK.DebuggerModel.Location): Workspace.UISourceCode.UILocation|null;
|
|
569
566
|
|
|
@@ -304,8 +304,9 @@ namespace APIImpl {
|
|
|
304
304
|
// We cannot use the stronger `unknown` type in place of `any` in the following type definition. The type is used as
|
|
305
305
|
// the right-hand side of `extends` in a few places, which doesn't narrow `unknown`. Without narrowing, overload
|
|
306
306
|
// resolution and meaningful type inference of arguments break, for example.
|
|
307
|
+
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
307
308
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
308
|
-
export type Callable = (...args: any) =>
|
|
309
|
+
export type Callable = (...args: any) => void;
|
|
309
310
|
|
|
310
311
|
export interface EventSink<ListenerT extends Callable> extends PublicAPI.Chrome.DevTools.EventSink<ListenerT> {
|
|
311
312
|
_type: string;
|
|
@@ -42,9 +42,6 @@ export class ExtensionTraceProvider {
|
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
43
43
|
let _lastSessionId = 0;
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* @interface
|
|
47
|
-
*/
|
|
48
45
|
export interface TracingSession {
|
|
49
46
|
complete(url: string, timeOffsetMicroseconds: number): void;
|
|
50
47
|
}
|
|
@@ -280,7 +280,7 @@ export class SearchConfig {
|
|
|
280
280
|
this.jumpBackward = jumpBackward;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
toSearchRegex(_global?: boolean): RegExp {
|
|
283
|
+
toSearchRegex(_global?: boolean): {regex: RegExp, fromQuery: boolean} {
|
|
284
284
|
throw new Error('Unsupported operation on search config');
|
|
285
285
|
}
|
|
286
286
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
|
|
5
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
|
7
|
+
import * as Protocol from '../../generated/protocol.js';
|
|
8
|
+
|
|
9
|
+
import {Issue, IssueCategory, IssueKind} from './Issue.js';
|
|
10
|
+
import type {MarkdownIssueDescription, LazyMarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
|
11
|
+
import {resolveLazyDescription} from './MarkdownIssueDescription.js';
|
|
12
|
+
|
|
13
|
+
const UIStrings = {
|
|
14
|
+
/**
|
|
15
|
+
*@description Title for Client Hint specification url link
|
|
16
|
+
*/
|
|
17
|
+
clientHintsInfrastructure: 'Client Hints Infrastructure',
|
|
18
|
+
};
|
|
19
|
+
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/ClientHintIssue.ts', UIStrings);
|
|
20
|
+
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
21
|
+
|
|
22
|
+
export class ClientHintIssue extends Issue {
|
|
23
|
+
private issueDetails: Protocol.Audits.ClientHintIssueDetails;
|
|
24
|
+
|
|
25
|
+
constructor(issueDetails: Protocol.Audits.ClientHintIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
|
26
|
+
super(
|
|
27
|
+
{
|
|
28
|
+
code: Protocol.Audits.InspectorIssueCode.ClientHintIssue,
|
|
29
|
+
umaCode: [Protocol.Audits.InspectorIssueCode.ClientHintIssue, issueDetails.clientHintIssueReason].join('::'),
|
|
30
|
+
},
|
|
31
|
+
issuesModel);
|
|
32
|
+
this.issueDetails = issueDetails;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getCategory(): IssueCategory {
|
|
36
|
+
return IssueCategory.Other;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
details(): Protocol.Audits.ClientHintIssueDetails {
|
|
40
|
+
return this.issueDetails;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getDescription(): MarkdownIssueDescription|null {
|
|
44
|
+
const description = issueDescriptions.get(this.issueDetails.clientHintIssueReason);
|
|
45
|
+
if (!description) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return resolveLazyDescription(description);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
sources(): Iterable<Protocol.Audits.SourceCodeLocation> {
|
|
52
|
+
return [this.issueDetails.sourceCodeLocation];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
primaryKey(): string {
|
|
56
|
+
return JSON.stringify(this.issueDetails);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
getKind(): IssueKind {
|
|
60
|
+
return IssueKind.BreakingChange;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
|
|
64
|
+
ClientHintIssue[] {
|
|
65
|
+
const details = inspectorIssue.details.clientHintIssueDetails;
|
|
66
|
+
if (!details) {
|
|
67
|
+
console.warn('Client Hint issue without details received.');
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
return [new ClientHintIssue(details, issuesModel)];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const issueDescriptions: Map<Protocol.Audits.ClientHintIssueReason, LazyMarkdownIssueDescription> = new Map([
|
|
75
|
+
[
|
|
76
|
+
Protocol.Audits.ClientHintIssueReason.MetaTagAllowListInvalidOrigin,
|
|
77
|
+
{
|
|
78
|
+
file: 'clientHintMetaTagAllowListInvalidOrigin.md',
|
|
79
|
+
links: [{
|
|
80
|
+
link: 'https://wicg.github.io/client-hints-infrastructure/',
|
|
81
|
+
linkTitle: i18nLazyString(UIStrings.clientHintsInfrastructure),
|
|
82
|
+
}],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
Protocol.Audits.ClientHintIssueReason.MetaTagModifiedHTML,
|
|
87
|
+
{
|
|
88
|
+
file: 'clientHintMetaTagModifiedHTML.md',
|
|
89
|
+
links: [{
|
|
90
|
+
link: 'https://wicg.github.io/client-hints-infrastructure/',
|
|
91
|
+
linkTitle: i18nLazyString(UIStrings.clientHintsInfrastructure),
|
|
92
|
+
}],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
]);
|
|
@@ -36,7 +36,7 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/ContentSecurityP
|
|
|
36
36
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
37
37
|
|
|
38
38
|
export class ContentSecurityPolicyIssue extends Issue {
|
|
39
|
-
|
|
39
|
+
#issueDetails: Protocol.Audits.ContentSecurityPolicyIssueDetails;
|
|
40
40
|
|
|
41
41
|
constructor(
|
|
42
42
|
issueDetails: Protocol.Audits.ContentSecurityPolicyIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel,
|
|
@@ -46,7 +46,7 @@ export class ContentSecurityPolicyIssue extends Issue {
|
|
|
46
46
|
issueDetails.contentSecurityPolicyViolationType,
|
|
47
47
|
].join('::');
|
|
48
48
|
super(issueCode, issuesModel, issueId);
|
|
49
|
-
this
|
|
49
|
+
this.#issueDetails = issueDetails;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
getCategory(): IssueCategory {
|
|
@@ -54,7 +54,7 @@ export class ContentSecurityPolicyIssue extends Issue {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
primaryKey(): string {
|
|
57
|
-
return JSON.stringify(this
|
|
57
|
+
return JSON.stringify(this.#issueDetails, [
|
|
58
58
|
'blockedURL',
|
|
59
59
|
'contentSecurityPolicyViolationType',
|
|
60
60
|
'violatedDirective',
|
|
@@ -68,7 +68,7 @@ export class ContentSecurityPolicyIssue extends Issue {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
getDescription(): MarkdownIssueDescription|null {
|
|
71
|
-
const description = issueDescriptions.get(this
|
|
71
|
+
const description = issueDescriptions.get(this.#issueDetails.contentSecurityPolicyViolationType);
|
|
72
72
|
if (!description) {
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
@@ -76,11 +76,11 @@ export class ContentSecurityPolicyIssue extends Issue {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
details(): Protocol.Audits.ContentSecurityPolicyIssueDetails {
|
|
79
|
-
return this
|
|
79
|
+
return this.#issueDetails;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
getKind(): IssueKind {
|
|
83
|
-
if (this
|
|
83
|
+
if (this.#issueDetails.isReportOnly) {
|
|
84
84
|
return IssueKind.Improvement;
|
|
85
85
|
}
|
|
86
86
|
return IssueKind.PageError;
|