chrome-devtools-frontend 1.0.1548980 → 1.0.1550444
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/docs/contributing/settings-experiments-features.md +35 -0
- package/docs/styleguide/ux/components.md +53 -12
- package/docs/styleguide/ux/images/cards.png +0 -0
- package/docs/styleguide/ux/patterns.md +27 -0
- package/docs/ui_engineering.md +2 -2
- package/eslint.config.mjs +1 -0
- package/front_end/Tests.js +2 -0
- package/front_end/core/host/InspectorFrontendHost.ts +26 -558
- package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
- package/front_end/core/host/ResourceLoader.ts +9 -23
- package/front_end/core/host/UserMetrics.ts +4 -4
- package/front_end/core/root/DevToolsContext.ts +4 -0
- package/front_end/core/root/Runtime.ts +10 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
- package/front_end/core/sdk/CSSModel.ts +24 -24
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +2 -2
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +41 -41
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/OverlayModel.ts +2 -2
- package/front_end/core/sdk/PageResourceLoader.ts +71 -38
- package/front_end/core/sdk/SourceMap.ts +6 -0
- package/front_end/core/sdk/SourceMapCache.ts +21 -0
- package/front_end/core/sdk/SourceMapManager.ts +14 -7
- package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
- package/front_end/core/sdk/TargetManager.ts +14 -2
- package/front_end/core/sdk/sdk-meta.ts +13 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +5 -4
- package/front_end/foundation/Universe.ts +8 -1
- package/front_end/generated/Deprecation.ts +18 -4
- package/front_end/generated/InspectorBackendCommands.ts +38 -33
- package/front_end/generated/SupportedCSSProperties.js +41 -41
- package/front_end/generated/protocol-mapping.d.ts +20 -0
- package/front_end/generated/protocol-proxy-api.d.ts +17 -0
- package/front_end/generated/protocol.ts +146 -35
- package/front_end/models/ai_assistance/AiConversation.ts +5 -4
- package/front_end/models/ai_assistance/BuiltInAi.ts +79 -5
- package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
- package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
- package/front_end/models/bindings/ResourceMapping.ts +73 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +6 -8
- package/front_end/models/issues_manager/BounceTrackingIssue.ts +4 -14
- package/front_end/models/issues_manager/ClientHintIssue.ts +5 -12
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -12
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +7 -14
- package/front_end/models/issues_manager/CookieIssue.ts +27 -30
- package/front_end/models/issues_manager/CorsIssue.ts +8 -17
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -8
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -14
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +7 -14
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/GenericIssue.ts +28 -16
- package/front_end/models/issues_manager/HeavyAdIssue.ts +4 -11
- package/front_end/models/issues_manager/Issue.ts +12 -4
- package/front_end/models/issues_manager/IssueAggregator.ts +8 -2
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +3 -10
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -13
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +4 -11
- package/front_end/models/issues_manager/PropertyRuleIssue.ts +6 -12
- package/front_end/models/issues_manager/QuirksModeIssue.ts +3 -10
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +7 -13
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +4 -11
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +6 -13
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +8 -13
- package/front_end/models/issues_manager/UnencodedDigestIssue.ts +2 -9
- package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +7 -16
- package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
- package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +51 -44
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
- package/front_end/panels/application/AppManifestView.ts +7 -6
- package/front_end/panels/application/ApplicationPanelSidebar.ts +21 -21
- package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -2
- package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -6
- package/front_end/panels/application/InterestGroupTreeElement.ts +2 -2
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -2
- package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
- package/front_end/panels/application/PreloadingTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiTreeElement.ts +2 -2
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +3 -3
- package/front_end/panels/application/ServiceWorkersView.ts +2 -2
- package/front_end/panels/application/SharedStorageListTreeElement.ts +2 -2
- package/front_end/panels/application/StorageBucketsTreeElement.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +4 -8
- package/front_end/panels/application/components/PermissionsPolicySection.ts +202 -158
- package/front_end/panels/application/components/ProtocolHandlersView.ts +118 -81
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
- package/front_end/panels/application/components/TrustTokensView.ts +77 -69
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
- package/front_end/panels/changes/ChangesSidebar.ts +2 -0
- package/front_end/panels/changes/CombinedDiffView.ts +2 -0
- package/front_end/panels/common/AnnotationManager.ts +71 -0
- package/front_end/panels/common/PersistenceUtils.ts +6 -7
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsolePrompt.ts +4 -4
- package/front_end/panels/console/ConsoleView.ts +5 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +16 -15
- package/front_end/panels/console/console-meta.ts +0 -13
- package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
- package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +3 -3
- package/front_end/panels/elements/ElementsPanel.ts +49 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +172 -121
- package/front_end/panels/elements/ElementsTreeOutline.ts +11 -3
- package/front_end/panels/elements/LayoutPane.ts +12 -10
- package/front_end/panels/elements/ShortcutTreeElement.ts +2 -2
- package/front_end/panels/elements/StyleEditorWidget.ts +2 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -18
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -5
- package/front_end/panels/elements/TopLayerContainer.ts +2 -2
- package/front_end/panels/elements/components/AdornerManager.ts +3 -3
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
- package/front_end/panels/elements/components/QueryContainer.ts +1 -1
- package/front_end/panels/elements/components/StylePropertyEditor.ts +7 -7
- package/front_end/panels/emulation/DeviceModeWrapper.ts +48 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +6 -4
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -2
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +2 -2
- package/front_end/panels/issues/IssueView.ts +4 -4
- package/front_end/panels/js_timeline/js_timeline-meta.ts +4 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +28 -50
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
- package/front_end/panels/media/PlayerListView.ts +100 -73
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +4 -5
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
- package/front_end/panels/network/NetworkFrameGrouper.ts +2 -2
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
- package/front_end/panels/network/components/RequestTrustTokensView.ts +5 -6
- package/front_end/panels/network/resourceChunkView.css +4 -0
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -3
- package/front_end/panels/profiler/ProfileDataGrid.ts +2 -2
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/recorder/components/CreateRecordingView.ts +1 -1
- package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +1 -1
- package/front_end/panels/recorder/components/StepView.ts +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +8 -8
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/CookieControlsTreeElement.ts +2 -2
- package/front_end/panels/security/CookieControlsView.ts +1 -1
- package/front_end/panels/security/CookieReportTreeElement.ts +2 -2
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/security/SecurityPanelSidebar.ts +3 -4
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +5 -5
- package/front_end/panels/settings/SettingsScreen.ts +7 -8
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +16 -6
- package/front_end/panels/sources/BreakpointEditDialog.ts +3 -3
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CSSPlugin.ts +4 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +4 -4
- package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +40 -23
- package/front_end/panels/sources/GoToLineQuickOpen.ts +11 -5
- package/front_end/panels/sources/NavigatorView.ts +4 -4
- package/front_end/panels/sources/OpenFileQuickOpen.ts +11 -16
- package/front_end/panels/sources/OutlineQuickOpen.ts +23 -23
- package/front_end/panels/sources/ProfilePlugin.ts +21 -12
- package/front_end/panels/sources/SourcesView.ts +2 -2
- package/front_end/panels/sources/TabbedEditorContainer.ts +4 -5
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/UISourceCodeFrame.ts +5 -6
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
- package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
- package/front_end/panels/timeline/TimelinePanel.ts +29 -25
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/Checklist.ts +1 -1
- package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -1
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -1
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
- package/front_end/panels/timeline/timeline-meta.ts +3 -2
- package/front_end/panels/utils/utils.ts +18 -3
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
- package/front_end/panels/whats_new/resources/WNDT.md +8 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
- package/front_end/ui/components/adorners/Adorner.ts +21 -1
- package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
- package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
- package/front_end/ui/components/annotations/annotations.ts +6 -0
- package/front_end/ui/components/buttons/Button.ts +2 -2
- package/front_end/ui/components/buttons/FloatingButton.ts +2 -2
- package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
- package/front_end/ui/components/diff_view/DiffView.ts +1 -1
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +16 -2
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
- package/front_end/ui/components/highlighting/highlighting.ts +7 -0
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +2 -2
- package/front_end/ui/components/icon_button/IconButton.ts +2 -2
- package/front_end/ui/components/icon_button/icon_button.ts +0 -2
- package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +2 -2
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/list/List.ts +184 -0
- package/front_end/ui/components/list/list.css +90 -0
- package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +4 -4
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/SelectMenu.ts +1 -1
- package/front_end/ui/components/node_text/NodeText.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +2 -2
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +2 -2
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +2 -2
- package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
- package/front_end/ui/components/text_editor/config.ts +2 -2
- package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/kit/cards/Card.docs.ts +43 -0
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.docs.ts +3 -4
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.ts +6 -4
- package/front_end/ui/kit/kit.ts +6 -0
- package/front_end/ui/legacy/Infobar.ts +3 -3
- package/front_end/ui/legacy/InspectorView.ts +3 -3
- package/front_end/ui/legacy/SearchableView.ts +2 -2
- package/front_end/ui/legacy/SoftContextMenu.ts +5 -5
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +106 -8
- package/front_end/ui/legacy/Toolbar.ts +3 -3
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +4 -188
- package/front_end/ui/legacy/ViewManager.ts +27 -12
- package/front_end/ui/legacy/ViewRegistration.ts +21 -22
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +8 -8
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +4 -4
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +4 -4
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +5 -5
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +23 -31
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +11 -27
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +11 -15
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +3 -3
- package/front_end/ui/legacy/tabbedPane.css +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/inspector_overlay/README.md +3 -3
- package/mcp/HostBindings.ts +310 -0
- package/mcp/mcp.ts +18 -0
- package/mcp/tsconfig.json +6 -1
- package/package.json +26 -24
- /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
- /package/front_end/ui/{components → kit}/cards/card.css +0 -0
- /package/front_end/ui/{components/icon_button → kit/icons}/icon.css +0 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import type * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
+
import * as Formatter from '../formatter/formatter.js';
|
|
8
9
|
import * as TextUtils from '../text_utils/text_utils.js';
|
|
9
10
|
import * as Workspace from '../workspace/workspace.js';
|
|
10
11
|
|
|
@@ -269,6 +270,78 @@ export class ResourceMapping implements SDK.TargetManager.SDKModelObserver<SDK.R
|
|
|
269
270
|
uiLocation.uiSourceCode.url(), uiLocation.lineNumber, uiLocation.columnNumber);
|
|
270
271
|
}
|
|
271
272
|
|
|
273
|
+
async functionBoundsAtRawLocation(rawLocation: SDK.DebuggerModel.Location):
|
|
274
|
+
Promise<Workspace.UISourceCode.UIFunctionBounds|null> {
|
|
275
|
+
const script = rawLocation.script();
|
|
276
|
+
if (!script) {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
const info = this.infoForTarget(script.debuggerModel.target());
|
|
280
|
+
if (!info) {
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
const embedderName = script.embedderName();
|
|
284
|
+
if (!embedderName) {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
const uiSourceCode = info.getProject().uiSourceCodeForURL(embedderName);
|
|
288
|
+
if (!uiSourceCode) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
let {lineNumber, columnNumber} = rawLocation;
|
|
293
|
+
lineNumber -= script.lineOffset;
|
|
294
|
+
if (lineNumber === 0) {
|
|
295
|
+
columnNumber -= script.columnOffset;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const scopeTreeAndText = script ? await SDK.ScopeTreeCache.scopeTreeForScript(script) : null;
|
|
299
|
+
if (!scopeTreeAndText) {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Find the inner-most scope that maps to the given position.
|
|
304
|
+
|
|
305
|
+
const offset = scopeTreeAndText.text.offsetFromPosition(lineNumber, columnNumber);
|
|
306
|
+
|
|
307
|
+
const results = [];
|
|
308
|
+
(function walk(nodes: Formatter.FormatterWorkerPool.ScopeTreeNode[]) {
|
|
309
|
+
for (const node of nodes) {
|
|
310
|
+
if (!(offset >= node.start && offset < node.end)) {
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
results.push(node);
|
|
314
|
+
walk(node.children);
|
|
315
|
+
}
|
|
316
|
+
})([scopeTreeAndText.scopeTree]);
|
|
317
|
+
|
|
318
|
+
const result = results.findLast(
|
|
319
|
+
node => node.kind === Formatter.FormatterWorkerPool.ScopeKind.FUNCTION ||
|
|
320
|
+
node.kind === Formatter.FormatterWorkerPool.ScopeKind.ARROW_FUNCTION);
|
|
321
|
+
if (!result) {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Map back to positions.
|
|
326
|
+
const startPosition = scopeTreeAndText.text.positionFromOffset(result.start);
|
|
327
|
+
const endPosition = scopeTreeAndText.text.positionFromOffset(result.end);
|
|
328
|
+
|
|
329
|
+
startPosition.lineNumber += script.lineOffset;
|
|
330
|
+
if (startPosition.lineNumber === script.lineOffset) {
|
|
331
|
+
startPosition.columnNumber += script.columnOffset;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
endPosition.lineNumber += script.lineOffset;
|
|
335
|
+
if (endPosition.lineNumber === script.lineOffset) {
|
|
336
|
+
endPosition.columnNumber += script.columnOffset;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const name = ''; // TODO(crbug.com/452333154): update ScopeVariableAnalysis to include function name.
|
|
340
|
+
const range = new TextUtils.TextRange.TextRange(
|
|
341
|
+
startPosition.lineNumber, startPosition.columnNumber, endPosition.lineNumber, endPosition.columnNumber);
|
|
342
|
+
return new Workspace.UISourceCode.UIFunctionBounds(uiSourceCode, range, name);
|
|
343
|
+
}
|
|
344
|
+
|
|
272
345
|
resetForTest(target: SDK.Target.Target): void {
|
|
273
346
|
const resourceTreeModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);
|
|
274
347
|
const info = resourceTreeModel ? this.#modelToInfo.get(resourceTreeModel) : null;
|
|
@@ -8,6 +8,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
8
8
|
import * as Root from '../../core/root/root.js';
|
|
9
9
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
10
|
import * as Protocol from '../../generated/protocol.js';
|
|
11
|
+
import * as Formatter from '../formatter/formatter.js';
|
|
11
12
|
import * as TextUtils from '../text_utils/text_utils.js';
|
|
12
13
|
import * as Workspace from '../workspace/workspace.js';
|
|
13
14
|
|
|
@@ -156,6 +157,55 @@ export class ResourceScriptMapping implements DebuggerSourceMapping {
|
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
|
|
160
|
+
async functionBoundsAtRawLocation(rawLocation: SDK.DebuggerModel.Location):
|
|
161
|
+
Promise<Workspace.UISourceCode.UIFunctionBounds|null> {
|
|
162
|
+
const script = rawLocation.script();
|
|
163
|
+
if (!script) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const uiSourceCode = this.#scriptToUISourceCode.get(script);
|
|
168
|
+
if (!uiSourceCode) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const scopeTreeAndText = script ? await SDK.ScopeTreeCache.scopeTreeForScript(script) : null;
|
|
173
|
+
if (!scopeTreeAndText) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Find the inner-most scope that maps to the given position.
|
|
178
|
+
|
|
179
|
+
const offset = scopeTreeAndText.text.offsetFromPosition(rawLocation.lineNumber, rawLocation.columnNumber);
|
|
180
|
+
|
|
181
|
+
const results = [];
|
|
182
|
+
(function walk(nodes: Formatter.FormatterWorkerPool.ScopeTreeNode[]) {
|
|
183
|
+
for (const node of nodes) {
|
|
184
|
+
if (!(offset >= node.start && offset < node.end)) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
results.push(node);
|
|
188
|
+
walk(node.children);
|
|
189
|
+
}
|
|
190
|
+
})([scopeTreeAndText.scopeTree]);
|
|
191
|
+
|
|
192
|
+
const result = results.findLast(
|
|
193
|
+
node => node.kind === Formatter.FormatterWorkerPool.ScopeKind.FUNCTION ||
|
|
194
|
+
node.kind === Formatter.FormatterWorkerPool.ScopeKind.ARROW_FUNCTION);
|
|
195
|
+
if (!result) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Map back to positions.
|
|
200
|
+
const startPosition = scopeTreeAndText.text.positionFromOffset(result.start);
|
|
201
|
+
const endPosition = scopeTreeAndText.text.positionFromOffset(result.end);
|
|
202
|
+
|
|
203
|
+
const name = ''; // TODO(crbug.com/452333154): update ScopeVariableAnalysis to include function name.
|
|
204
|
+
const range = new TextUtils.TextRange.TextRange(
|
|
205
|
+
startPosition.lineNumber, startPosition.columnNumber, endPosition.lineNumber, endPosition.columnNumber);
|
|
206
|
+
return new Workspace.UISourceCode.UIFunctionBounds(uiSourceCode, range, name);
|
|
207
|
+
}
|
|
208
|
+
|
|
159
209
|
private addScript(script: SDK.Script.Script): void {
|
|
160
210
|
// Ignore live edit scripts here.
|
|
161
211
|
if (script.isLiveEdit() || script.isBreakpointCondition) {
|
|
@@ -89,13 +89,10 @@ const structuredHeaderLink = {
|
|
|
89
89
|
linkTitle: 'Structured Headers RFC',
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
export class AttributionReportingIssue extends Issue<IssueCode> {
|
|
93
|
-
issueDetails: Readonly<Protocol.Audits.AttributionReportingIssueDetails>;
|
|
94
|
-
|
|
92
|
+
export class AttributionReportingIssue extends Issue<Protocol.Audits.AttributionReportingIssueDetails, IssueCode> {
|
|
95
93
|
constructor(
|
|
96
94
|
issueDetails: Protocol.Audits.AttributionReportingIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
|
|
97
|
-
super(getIssueCode(issueDetails), issuesModel);
|
|
98
|
-
this.issueDetails = issueDetails;
|
|
95
|
+
super(getIssueCode(issueDetails), issueDetails, issuesModel);
|
|
99
96
|
}
|
|
100
97
|
|
|
101
98
|
getCategory(): IssueCategory {
|
|
@@ -106,8 +103,9 @@ export class AttributionReportingIssue extends Issue<IssueCode> {
|
|
|
106
103
|
const url = new URL('https://wicg.github.io/attribution-reporting-api/validate-headers');
|
|
107
104
|
url.searchParams.set('header', name);
|
|
108
105
|
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
const details = this.details();
|
|
107
|
+
if (details.invalidParameter) {
|
|
108
|
+
url.searchParams.set('json', details.invalidParameter);
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
return {
|
|
@@ -229,7 +227,7 @@ export class AttributionReportingIssue extends Issue<IssueCode> {
|
|
|
229
227
|
}
|
|
230
228
|
|
|
231
229
|
primaryKey(): string {
|
|
232
|
-
return JSON.stringify(this.
|
|
230
|
+
return JSON.stringify(this.details());
|
|
233
231
|
}
|
|
234
232
|
|
|
235
233
|
getKind(): IssueKind {
|
|
@@ -18,12 +18,9 @@ const UIStrings = {
|
|
|
18
18
|
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/BounceTrackingIssue.ts', UIStrings);
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
|
-
export class BounceTrackingIssue extends Issue {
|
|
22
|
-
readonly #issueDetails: Protocol.Audits.BounceTrackingIssueDetails;
|
|
23
|
-
|
|
21
|
+
export class BounceTrackingIssue extends Issue<Protocol.Audits.BounceTrackingIssueDetails> {
|
|
24
22
|
constructor(issueDetails: Protocol.Audits.BounceTrackingIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
|
|
25
|
-
super(Protocol.Audits.InspectorIssueCode.BounceTrackingIssue, issuesModel);
|
|
26
|
-
this.#issueDetails = issueDetails;
|
|
23
|
+
super(Protocol.Audits.InspectorIssueCode.BounceTrackingIssue, issueDetails, issuesModel);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
getCategory(): IssueCategory {
|
|
@@ -42,23 +39,16 @@ export class BounceTrackingIssue extends Issue {
|
|
|
42
39
|
};
|
|
43
40
|
}
|
|
44
41
|
|
|
45
|
-
details(): Protocol.Audits.BounceTrackingIssueDetails {
|
|
46
|
-
return this.#issueDetails;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
42
|
getKind(): IssueKind {
|
|
50
43
|
return IssueKind.BREAKING_CHANGE;
|
|
51
44
|
}
|
|
52
45
|
|
|
53
46
|
primaryKey(): string {
|
|
54
|
-
return JSON.stringify(this
|
|
47
|
+
return JSON.stringify(this.details());
|
|
55
48
|
}
|
|
56
49
|
|
|
57
50
|
override trackingSites(): Iterable<string> {
|
|
58
|
-
|
|
59
|
-
return this.#issueDetails.trackingSites;
|
|
60
|
-
}
|
|
61
|
-
return [];
|
|
51
|
+
return this.details().trackingSites;
|
|
62
52
|
}
|
|
63
53
|
|
|
64
54
|
static fromInspectorIssue(
|
|
@@ -22,29 +22,22 @@ const UIStrings = {
|
|
|
22
22
|
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/ClientHintIssue.ts', UIStrings);
|
|
23
23
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
24
24
|
|
|
25
|
-
export class ClientHintIssue extends Issue {
|
|
26
|
-
private issueDetails: Protocol.Audits.ClientHintIssueDetails;
|
|
27
|
-
|
|
25
|
+
export class ClientHintIssue extends Issue<Protocol.Audits.ClientHintIssueDetails> {
|
|
28
26
|
constructor(issueDetails: Protocol.Audits.ClientHintIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
|
|
29
27
|
super(
|
|
30
28
|
{
|
|
31
29
|
code: Protocol.Audits.InspectorIssueCode.ClientHintIssue,
|
|
32
30
|
umaCode: [Protocol.Audits.InspectorIssueCode.ClientHintIssue, issueDetails.clientHintIssueReason].join('::'),
|
|
33
31
|
},
|
|
34
|
-
issuesModel);
|
|
35
|
-
this.issueDetails = issueDetails;
|
|
32
|
+
issueDetails, issuesModel);
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
getCategory(): IssueCategory {
|
|
39
36
|
return IssueCategory.OTHER;
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
details(): Protocol.Audits.ClientHintIssueDetails {
|
|
43
|
-
return this.issueDetails;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
39
|
getDescription(): MarkdownIssueDescription|null {
|
|
47
|
-
const description = issueDescriptions.get(this.
|
|
40
|
+
const description = issueDescriptions.get(this.details().clientHintIssueReason);
|
|
48
41
|
if (!description) {
|
|
49
42
|
return null;
|
|
50
43
|
}
|
|
@@ -52,11 +45,11 @@ export class ClientHintIssue extends Issue {
|
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
override sources(): Iterable<Protocol.Audits.SourceCodeLocation> {
|
|
55
|
-
return [this.
|
|
48
|
+
return [this.details().sourceCodeLocation];
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
primaryKey(): string {
|
|
59
|
-
return JSON.stringify(this.
|
|
52
|
+
return JSON.stringify(this.details());
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
getKind(): IssueKind {
|
|
@@ -38,9 +38,7 @@ const UIStrings = {
|
|
|
38
38
|
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/ContentSecurityPolicyIssue.ts', UIStrings);
|
|
39
39
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
40
40
|
|
|
41
|
-
export class ContentSecurityPolicyIssue extends Issue {
|
|
42
|
-
#issueDetails: Protocol.Audits.ContentSecurityPolicyIssueDetails;
|
|
43
|
-
|
|
41
|
+
export class ContentSecurityPolicyIssue extends Issue<Protocol.Audits.ContentSecurityPolicyIssueDetails> {
|
|
44
42
|
constructor(
|
|
45
43
|
issueDetails: Protocol.Audits.ContentSecurityPolicyIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null,
|
|
46
44
|
issueId?: Protocol.Audits.IssueId) {
|
|
@@ -48,8 +46,7 @@ export class ContentSecurityPolicyIssue extends Issue {
|
|
|
48
46
|
Protocol.Audits.InspectorIssueCode.ContentSecurityPolicyIssue,
|
|
49
47
|
issueDetails.contentSecurityPolicyViolationType,
|
|
50
48
|
].join('::');
|
|
51
|
-
super(issueCode, issuesModel, issueId);
|
|
52
|
-
this.#issueDetails = issueDetails;
|
|
49
|
+
super(issueCode, issueDetails, issuesModel, issueId);
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
getCategory(): IssueCategory {
|
|
@@ -57,7 +54,7 @@ export class ContentSecurityPolicyIssue extends Issue {
|
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
primaryKey(): string {
|
|
60
|
-
return JSON.stringify(this
|
|
57
|
+
return JSON.stringify(this.details(), [
|
|
61
58
|
'blockedURL',
|
|
62
59
|
'contentSecurityPolicyViolationType',
|
|
63
60
|
'violatedDirective',
|
|
@@ -71,19 +68,15 @@ export class ContentSecurityPolicyIssue extends Issue {
|
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
getDescription(): MarkdownIssueDescription|null {
|
|
74
|
-
const description = issueDescriptions.get(this
|
|
71
|
+
const description = issueDescriptions.get(this.details().contentSecurityPolicyViolationType);
|
|
75
72
|
if (!description) {
|
|
76
73
|
return null;
|
|
77
74
|
}
|
|
78
75
|
return resolveLazyDescription(description);
|
|
79
76
|
}
|
|
80
77
|
|
|
81
|
-
details(): Protocol.Audits.ContentSecurityPolicyIssueDetails {
|
|
82
|
-
return this.#issueDetails;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
78
|
getKind(): IssueKind {
|
|
86
|
-
if (this
|
|
79
|
+
if (this.details().isReportOnly) {
|
|
87
80
|
return IssueKind.IMPROVEMENT;
|
|
88
81
|
}
|
|
89
82
|
return IssueKind.PAGE_ERROR;
|
|
@@ -19,16 +19,13 @@ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/CookieDeprecatio
|
|
|
19
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
20
|
|
|
21
21
|
/** TODO(b/305738703): Move this issue into a warning on CookieIssue. **/
|
|
22
|
-
export class CookieDeprecationMetadataIssue extends Issue {
|
|
23
|
-
readonly #issueDetails: Protocol.Audits.CookieDeprecationMetadataIssueDetails;
|
|
24
|
-
|
|
22
|
+
export class CookieDeprecationMetadataIssue extends Issue<Protocol.Audits.CookieDeprecationMetadataIssueDetails> {
|
|
25
23
|
constructor(
|
|
26
24
|
issueDetails: Protocol.Audits.CookieDeprecationMetadataIssueDetails,
|
|
27
25
|
issuesModel: SDK.IssuesModel.IssuesModel|null) {
|
|
28
26
|
// Set a distinct code for ReadCookie and SetCookie issues, so they are grouped separately.
|
|
29
27
|
const issueCode = Protocol.Audits.InspectorIssueCode.CookieDeprecationMetadataIssue + '_' + issueDetails.operation;
|
|
30
|
-
super(issueCode, issuesModel);
|
|
31
|
-
this.#issueDetails = issueDetails;
|
|
28
|
+
super(issueCode, issueDetails, issuesModel);
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
getCategory(): IssueCategory {
|
|
@@ -36,12 +33,12 @@ export class CookieDeprecationMetadataIssue extends Issue {
|
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
getDescription(): MarkdownIssueDescription {
|
|
39
|
-
const fileName =
|
|
40
|
-
|
|
36
|
+
const fileName =
|
|
37
|
+
this.details().operation === 'SetCookie' ? 'cookieWarnMetadataGrantSet.md' : 'cookieWarnMetadataGrantRead.md';
|
|
41
38
|
|
|
42
39
|
let optOutText = '';
|
|
43
|
-
if (this
|
|
44
|
-
optOutText = '\n\n (Top level site opt-out: ' + this
|
|
40
|
+
if (this.details().isOptOutTopLevel) {
|
|
41
|
+
optOutText = '\n\n (Top level site opt-out: ' + this.details().optOutPercentage +
|
|
45
42
|
'% - [learn more](gracePeriodStagedControlExplainer))';
|
|
46
43
|
}
|
|
47
44
|
|
|
@@ -59,16 +56,12 @@ export class CookieDeprecationMetadataIssue extends Issue {
|
|
|
59
56
|
};
|
|
60
57
|
}
|
|
61
58
|
|
|
62
|
-
details(): Protocol.Audits.CookieDeprecationMetadataIssueDetails {
|
|
63
|
-
return this.#issueDetails;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
59
|
getKind(): IssueKind {
|
|
67
60
|
return IssueKind.BREAKING_CHANGE;
|
|
68
61
|
}
|
|
69
62
|
|
|
70
63
|
primaryKey(): string {
|
|
71
|
-
return JSON.stringify(this
|
|
64
|
+
return JSON.stringify(this.details());
|
|
72
65
|
}
|
|
73
66
|
|
|
74
67
|
static fromInspectorIssue(
|
|
@@ -68,27 +68,20 @@ export interface CookieReportInfo {
|
|
|
68
68
|
insight?: Protocol.Audits.CookieIssueInsight;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
export class CookieIssue extends Issue {
|
|
72
|
-
#issueDetails: Protocol.Audits.CookieIssueDetails;
|
|
73
|
-
|
|
74
|
-
constructor(
|
|
75
|
-
code: string, issueDetails: Protocol.Audits.CookieIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null,
|
|
76
|
-
issueId: Protocol.Audits.IssueId|undefined) {
|
|
77
|
-
super(code, issuesModel, issueId);
|
|
78
|
-
this.#issueDetails = issueDetails;
|
|
79
|
-
}
|
|
80
|
-
|
|
71
|
+
export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
81
72
|
cookieId(): string {
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
const details = this.details();
|
|
74
|
+
if (details.cookie) {
|
|
75
|
+
const {domain, path, name} = details.cookie;
|
|
84
76
|
const cookieId = `${domain};${path};${name}`;
|
|
85
77
|
return cookieId;
|
|
86
78
|
}
|
|
87
|
-
return this
|
|
79
|
+
return this.details().rawCookieLine ?? 'no-cookie-info';
|
|
88
80
|
}
|
|
89
81
|
|
|
90
82
|
primaryKey(): string {
|
|
91
|
-
const
|
|
83
|
+
const details = this.details();
|
|
84
|
+
const requestId = details.request ? details.request.requestId : 'no-request';
|
|
92
85
|
return `${this.code()}-(${this.cookieId()})-(${requestId})`;
|
|
93
86
|
}
|
|
94
87
|
|
|
@@ -210,22 +203,25 @@ export class CookieIssue extends Issue {
|
|
|
210
203
|
}
|
|
211
204
|
|
|
212
205
|
override cookies(): Iterable<Protocol.Audits.AffectedCookie> {
|
|
213
|
-
|
|
214
|
-
|
|
206
|
+
const details = this.details();
|
|
207
|
+
if (details.cookie) {
|
|
208
|
+
return [details.cookie];
|
|
215
209
|
}
|
|
216
210
|
return [];
|
|
217
211
|
}
|
|
218
212
|
|
|
219
213
|
override rawCookieLines(): Iterable<string> {
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
const details = this.details();
|
|
215
|
+
if (details.rawCookieLine) {
|
|
216
|
+
return [details.rawCookieLine];
|
|
222
217
|
}
|
|
223
218
|
return [];
|
|
224
219
|
}
|
|
225
220
|
|
|
226
221
|
override requests(): Iterable<Protocol.Audits.AffectedRequest> {
|
|
227
|
-
|
|
228
|
-
|
|
222
|
+
const details = this.details();
|
|
223
|
+
if (details.request) {
|
|
224
|
+
return [details.request];
|
|
229
225
|
}
|
|
230
226
|
return [];
|
|
231
227
|
}
|
|
@@ -244,27 +240,28 @@ export class CookieIssue extends Issue {
|
|
|
244
240
|
|
|
245
241
|
override isCausedByThirdParty(): boolean {
|
|
246
242
|
const outermostFrame = SDK.FrameManager.FrameManager.instance().getOutermostFrame();
|
|
247
|
-
return isCausedByThirdParty(outermostFrame, this
|
|
243
|
+
return isCausedByThirdParty(outermostFrame, this.details().cookieUrl, this.details().siteForCookies);
|
|
248
244
|
}
|
|
249
245
|
|
|
250
246
|
getKind(): IssueKind {
|
|
251
|
-
if (this
|
|
247
|
+
if (this.details().cookieExclusionReasons?.length > 0) {
|
|
252
248
|
return IssueKind.PAGE_ERROR;
|
|
253
249
|
}
|
|
254
250
|
return IssueKind.BREAKING_CHANGE;
|
|
255
251
|
}
|
|
256
252
|
|
|
257
253
|
makeCookieReportEntry(): CookieReportInfo|undefined {
|
|
258
|
-
const status = CookieIssue.getCookieStatus(this
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
const status = CookieIssue.getCookieStatus(this.details());
|
|
255
|
+
const details = this.details();
|
|
256
|
+
if (details.cookie && details.cookieUrl && status !== undefined) {
|
|
257
|
+
const entity = ThirdPartyWeb.ThirdPartyWeb.getEntity(details.cookieUrl);
|
|
261
258
|
return {
|
|
262
|
-
name:
|
|
263
|
-
domain:
|
|
259
|
+
name: details.cookie.name,
|
|
260
|
+
domain: details.cookie.domain,
|
|
264
261
|
type: entity?.category,
|
|
265
262
|
platform: entity?.name,
|
|
266
263
|
status,
|
|
267
|
-
insight: this
|
|
264
|
+
insight: this.details().insight,
|
|
268
265
|
};
|
|
269
266
|
}
|
|
270
267
|
|
|
@@ -332,8 +329,8 @@ export class CookieIssue extends Issue {
|
|
|
332
329
|
return new SDK.ConsoleModel.ConsoleMessage(
|
|
333
330
|
issuesModel.target().model(SDK.RuntimeModel.RuntimeModel), Common.Console.FrontendMessageSource.ISSUE_PANEL,
|
|
334
331
|
Protocol.Log.LogEntryLevel.Warning, UIStrings.consoleTpcdErrorMessage, {
|
|
335
|
-
url: this
|
|
336
|
-
affectedResources: {requestId: this
|
|
332
|
+
url: this.details().request?.url as Platform.DevToolsPath.UrlString | undefined,
|
|
333
|
+
affectedResources: {requestId: this.details().request?.requestId, issueId: this.issueId},
|
|
337
334
|
isCookieReportIssue: true
|
|
338
335
|
});
|
|
339
336
|
}
|
|
@@ -115,26 +115,19 @@ function getIssueCode(details: Protocol.Audits.CorsIssueDetails): IssueCode {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
export class CorsIssue extends Issue<IssueCode> {
|
|
119
|
-
#issueDetails: Protocol.Audits.CorsIssueDetails;
|
|
120
|
-
|
|
118
|
+
export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode> {
|
|
121
119
|
constructor(
|
|
122
120
|
issueDetails: Protocol.Audits.CorsIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null,
|
|
123
121
|
issueId: Protocol.Audits.IssueId|undefined) {
|
|
124
|
-
super(getIssueCode(issueDetails), issuesModel, issueId);
|
|
125
|
-
this.#issueDetails = issueDetails;
|
|
122
|
+
super(getIssueCode(issueDetails), issueDetails, issuesModel, issueId);
|
|
126
123
|
}
|
|
127
124
|
|
|
128
125
|
getCategory(): IssueCategory {
|
|
129
126
|
return IssueCategory.CORS;
|
|
130
127
|
}
|
|
131
128
|
|
|
132
|
-
details(): Protocol.Audits.CorsIssueDetails {
|
|
133
|
-
return this.#issueDetails;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
129
|
getDescription(): MarkdownIssueDescription|null {
|
|
137
|
-
switch (getIssueCode(this
|
|
130
|
+
switch (getIssueCode(this.details())) {
|
|
138
131
|
case IssueCode.INSECURE_PRIVATE_NETWORK:
|
|
139
132
|
return {
|
|
140
133
|
file: 'corsInsecurePrivateNetwork.md',
|
|
@@ -269,16 +262,14 @@ export class CorsIssue extends Issue<IssueCode> {
|
|
|
269
262
|
}
|
|
270
263
|
|
|
271
264
|
primaryKey(): string {
|
|
272
|
-
return JSON.stringify(this
|
|
265
|
+
return JSON.stringify(this.details());
|
|
273
266
|
}
|
|
274
267
|
|
|
275
268
|
getKind(): IssueKind {
|
|
276
|
-
if (this
|
|
277
|
-
(this
|
|
278
|
-
this
|
|
279
|
-
|
|
280
|
-
this.#issueDetails.corsErrorStatus.corsError ===
|
|
281
|
-
Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork)) {
|
|
269
|
+
if (this.details().isWarning &&
|
|
270
|
+
(this.details().corsErrorStatus.corsError === Protocol.Network.CorsError.InsecurePrivateNetwork ||
|
|
271
|
+
this.details().corsErrorStatus.corsError === Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork ||
|
|
272
|
+
this.details().corsErrorStatus.corsError === Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork)) {
|
|
282
273
|
return IssueKind.BREAKING_CHANGE;
|
|
283
274
|
}
|
|
284
275
|
return IssueKind.PAGE_ERROR;
|
|
@@ -42,25 +42,22 @@ export function isCrossOriginEmbedderPolicyIssue(reason: Protocol.Audits.Blocked
|
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export class CrossOriginEmbedderPolicyIssue extends Issue {
|
|
46
|
-
#issueDetails: Protocol.Audits.BlockedByResponseIssueDetails;
|
|
47
|
-
|
|
45
|
+
export class CrossOriginEmbedderPolicyIssue extends Issue<Protocol.Audits.BlockedByResponseIssueDetails> {
|
|
48
46
|
constructor(
|
|
49
47
|
issueDetails: Protocol.Audits.BlockedByResponseIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
|
|
50
|
-
super(`CrossOriginEmbedderPolicyIssue::${issueDetails.reason}`, issuesModel);
|
|
51
|
-
this.#issueDetails = issueDetails;
|
|
48
|
+
super(`CrossOriginEmbedderPolicyIssue::${issueDetails.reason}`, issueDetails, issuesModel);
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
primaryKey(): string {
|
|
55
|
-
return `${this.code()}-(${this
|
|
52
|
+
return `${this.code()}-(${this.details().request.requestId})`;
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
override getBlockedByResponseDetails(): Iterable<Protocol.Audits.BlockedByResponseIssueDetails> {
|
|
59
|
-
return [this
|
|
56
|
+
return [this.details()];
|
|
60
57
|
}
|
|
61
58
|
|
|
62
59
|
override requests(): Iterable<Protocol.Audits.AffectedRequest> {
|
|
63
|
-
return [this
|
|
60
|
+
return [this.details().request];
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
getCategory(): IssueCategory {
|
|
@@ -33,35 +33,28 @@ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined
|
|
|
33
33
|
const strDeprecation = i18n.i18n.registerUIStrings('generated/Deprecation.ts', Deprecation.UIStrings);
|
|
34
34
|
const i18nLazyDeprecationString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, strDeprecation);
|
|
35
35
|
|
|
36
|
-
export class DeprecationIssue extends Issue {
|
|
37
|
-
#issueDetails: Protocol.Audits.DeprecationIssueDetails;
|
|
38
|
-
|
|
36
|
+
export class DeprecationIssue extends Issue<Protocol.Audits.DeprecationIssueDetails> {
|
|
39
37
|
constructor(issueDetails: Protocol.Audits.DeprecationIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
|
|
40
38
|
const issueCode = [
|
|
41
39
|
Protocol.Audits.InspectorIssueCode.DeprecationIssue,
|
|
42
40
|
issueDetails.type,
|
|
43
41
|
].join('::');
|
|
44
|
-
super({code: issueCode, umaCode: 'DeprecationIssue'}, issuesModel);
|
|
45
|
-
this.#issueDetails = issueDetails;
|
|
42
|
+
super({code: issueCode, umaCode: 'DeprecationIssue'}, issueDetails, issuesModel);
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
getCategory(): IssueCategory {
|
|
49
46
|
return IssueCategory.OTHER;
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
details(): Protocol.Audits.DeprecationIssueDetails {
|
|
53
|
-
return this.#issueDetails;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
49
|
getDescription(): MarkdownIssueDescription {
|
|
57
50
|
let messageFunction = (): string => '';
|
|
58
|
-
const maybeEnglishMessage = (Deprecation.UIStrings as Record<string, string>)[this
|
|
51
|
+
const maybeEnglishMessage = (Deprecation.UIStrings as Record<string, string>)[this.details().type];
|
|
59
52
|
if (maybeEnglishMessage) {
|
|
60
53
|
messageFunction = i18nLazyDeprecationString(maybeEnglishMessage);
|
|
61
54
|
}
|
|
62
55
|
|
|
63
56
|
const links = [];
|
|
64
|
-
const deprecationMeta = Deprecation.DEPRECATIONS_METADATA[this
|
|
57
|
+
const deprecationMeta = Deprecation.DEPRECATIONS_METADATA[this.details().type];
|
|
65
58
|
const feature = deprecationMeta?.chromeStatusFeature ?? 0;
|
|
66
59
|
if (feature !== 0) {
|
|
67
60
|
links.push({
|
|
@@ -87,14 +80,14 @@ export class DeprecationIssue extends Issue {
|
|
|
87
80
|
}
|
|
88
81
|
|
|
89
82
|
override sources(): Iterable<Protocol.Audits.SourceCodeLocation> {
|
|
90
|
-
if (this
|
|
91
|
-
return [this
|
|
83
|
+
if (this.details().sourceCodeLocation) {
|
|
84
|
+
return [this.details().sourceCodeLocation];
|
|
92
85
|
}
|
|
93
86
|
return [];
|
|
94
87
|
}
|
|
95
88
|
|
|
96
89
|
primaryKey(): string {
|
|
97
|
-
return JSON.stringify(this
|
|
90
|
+
return JSON.stringify(this.details());
|
|
98
91
|
}
|
|
99
92
|
|
|
100
93
|
getKind(): IssueKind {
|