chrome-devtools-frontend 1.0.1662289 → 1.0.1664496
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/.agents/skills/{creating-a-model → devtools-model-management}/SKILL.md +0 -1
- package/.agents/skills/devtools-unicode-escaping/SKILL.md +64 -0
- package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +2 -1
- package/.agents/skills/fixing-skipped-tests/SKILL.md +3 -3
- package/.agents/skills/merging-devtools-module/SKILL.md +1 -1
- package/.agents/skills/migrate-chromium-test/SKILL.md +32 -6
- package/.agents/skills/repro-flaky-tests/SKILL.md +71 -31
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
- package/docs/ui_engineering.md +2 -0
- package/eslint.config.mjs +1 -0
- package/front_end/core/common/SettingRegistration.ts +0 -5
- package/front_end/core/common/Settings.ts +144 -3
- package/front_end/core/platform/StringUtilities.ts +38 -6
- package/front_end/core/protocol_client/PuppeteerDevToolsConnection.ts +112 -0
- package/front_end/core/sdk/CPUProfilerModel.ts +21 -13
- package/front_end/core/sdk/CSSContainerQuery.ts +1 -1
- package/front_end/core/sdk/CSSLayer.ts +1 -1
- package/front_end/core/sdk/CSSMedia.ts +1 -1
- package/front_end/core/sdk/CSSModel.ts +1 -1
- package/front_end/core/sdk/CSSNavigation.ts +1 -1
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +1 -1
- package/front_end/core/sdk/CSSScope.ts +1 -1
- package/front_end/core/sdk/CSSStartingStyle.ts +1 -1
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/CSSSupports.ts +1 -1
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +1 -1
- package/front_end/core/sdk/NetworkRequest.ts +7 -7
- package/front_end/core/sdk/Resource.ts +1 -1
- package/front_end/core/sdk/ScopeTreeCache.ts +1 -1
- package/front_end/core/sdk/Script.ts +1 -1
- package/front_end/core/sdk/ServerSentEvents.ts +1 -1
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -10
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -10
- package/front_end/core/sdk/sdk-meta.ts +3 -4
- package/front_end/{models → core}/text_utils/ContentProvider.ts +4 -6
- package/front_end/{models → core}/text_utils/StaticContentProvider.ts +4 -6
- package/front_end/{models → core}/text_utils/StreamingContentData.ts +1 -2
- package/front_end/{models → core}/text_utils/TextRange.ts +6 -3
- package/front_end/{models → core}/text_utils/TextUtils.ts +7 -7
- package/front_end/{models → core}/text_utils/WasmDisassembly.ts +2 -2
- package/front_end/core/text_utils/text_utils.ts +27 -0
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +1 -1
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +0 -13
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +8 -3
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +21 -3
- package/front_end/foundation/Universe.ts +16 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -14
- package/front_end/generated/protocol-mapping.d.ts +0 -53
- package/front_end/generated/protocol-proxy-api.d.ts +0 -46
- package/front_end/generated/protocol.ts +0 -148
- package/front_end/models/ai_assistance/AgentProject.ts +1 -1
- package/front_end/models/ai_assistance/AiAgent2.ts +3 -3
- package/front_end/models/ai_assistance/AiConversation.ts +21 -10
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +21 -10
- package/front_end/models/ai_assistance/ChangeManager.ts +2 -2
- package/front_end/models/ai_assistance/ExtensionScope.ts +6 -2
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +4 -7
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +19 -11
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +23 -10
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +19 -18
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -4
- package/front_end/models/ai_assistance/contexts/FileContext.ts +7 -3
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +39 -11
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +6 -3
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +4 -4
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +8 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +76 -3
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +11 -1
- package/front_end/models/badges/AiExplorerBadge.ts +8 -3
- package/front_end/models/badges/Badge.ts +1 -0
- package/front_end/models/badges/UserBadges.ts +43 -23
- package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
- package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -2
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
- package/front_end/models/bindings/DefaultScriptMapping.ts +1 -1
- package/front_end/models/bindings/FileUtils.ts +1 -1
- package/front_end/models/bindings/NetworkProject.ts +16 -4
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +7 -10
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/bindings/ResourceScriptMapping.ts +1 -1
- package/front_end/models/bindings/SASSSourceMapping.ts +1 -1
- package/front_end/models/bindings/StylesSourceMapping.ts +1 -1
- package/front_end/models/breakpoints/BreakpointManager.ts +1 -1
- package/front_end/models/crux-manager/CrUXManager.ts +1 -1
- package/front_end/models/emulation/DeviceModeModel.ts +67 -5
- package/front_end/models/emulation/EmulatedDevices.ts +3 -2
- package/front_end/models/extensions/RecorderPluginManager.ts +10 -6
- package/front_end/models/har/Importer.ts +1 -1
- package/front_end/models/har/Log.snapshot.txt +193 -0
- package/front_end/models/har/Log.ts +3 -2
- package/front_end/models/har/Writer.ts +1 -1
- package/front_end/models/issues_manager/IssueAggregator.ts +9 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/LazyLoadImageIssue.ts +76 -0
- package/front_end/models/issues_manager/descriptions/lazyLoadImageZeroSize.md +7 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +9 -10
- package/front_end/models/live-metrics/LiveMetrics.ts +2 -3
- package/front_end/models/logs/NetworkLog.ts +4 -3
- package/front_end/models/logs/logs-meta.ts +3 -3
- package/front_end/models/network_time_calculator/NetworkTimeCalculator.ts +4 -4
- package/front_end/models/persistence/Automapping.ts +1 -1
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +1 -1
- package/front_end/models/persistence/PersistenceImpl.ts +1 -1
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +8 -6
- package/front_end/models/source_map_scopes/NamesResolver.ts +37 -31
- package/front_end/models/stack_trace/StackTrace.ts +17 -0
- package/front_end/models/text_utils/text_utils.ts +2 -24
- package/front_end/models/trace/insights/ImageDelivery.ts +2 -2
- package/front_end/models/trace/insights/LegacyJavaScript.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/ThirdParties.ts +1 -1
- package/front_end/models/workspace/FileManager.ts +1 -1
- package/front_end/models/workspace/UISourceCode.ts +1 -1
- package/front_end/models/workspace/WorkspaceImpl.ts +1 -1
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +1 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
- package/front_end/panels/accessibility/AccessibilityStrings.ts +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
- package/front_end/panels/ai_assistance/ExportConversation.ts +1 -1
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +4 -4
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -2
- package/front_end/panels/application/CrashReportContextView.ts +1 -1
- package/front_end/panels/application/DOMStorageItemsView.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +4 -4
- package/front_end/panels/application/ExtensionStorageItemsView.ts +1 -1
- package/front_end/panels/application/FrameDetailsView.ts +1 -1
- package/front_end/panels/application/IndexedDBModel.ts +0 -10
- package/front_end/panels/application/IndexedDBViews.ts +240 -164
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +12 -2
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/SharedStorageModel.ts +0 -10
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/AdsView.ts +23 -0
- package/front_end/panels/application/components/BackForwardCacheView.ts +21 -5
- package/front_end/panels/application/components/CrashReportContextGrid.ts +1 -1
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +2 -2
- package/front_end/panels/application/components/adsView.css +21 -1
- package/front_end/panels/application/indexedDBViews.css +1 -1
- package/front_end/panels/application/preloading/PreloadingView.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -4
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/panels/common/ExtensionServer.ts +1 -1
- package/front_end/panels/console/ConsoleFilter.ts +1 -1
- package/front_end/panels/console/ConsoleSidebar.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/console/PromptBuilder.ts +1 -1
- package/front_end/panels/coverage/CoverageDecorationManager.ts +9 -1
- package/front_end/panels/coverage/CoverageModel.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/AccessibilityTreeView.ts +38 -3
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +1 -1
- package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +10 -3
- package/front_end/panels/elements/StandaloneStylesContainer.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
- package/front_end/panels/elements/StylesContainer.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +1 -1
- package/front_end/panels/explain/components/ConsoleInsight.ts +2 -2
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +76 -0
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
- package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -1
- package/front_end/panels/issues/IssueView.ts +2 -0
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +5 -0
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
- package/front_end/panels/network/BinaryResourceView.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +72 -8
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/network/NetworkLogViewColumns.ts +6 -6
- package/front_end/panels/network/NetworkPanel.ts +4 -4
- package/front_end/panels/network/NetworkSearchScope.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +1 -1
- package/front_end/panels/network/RequestHTMLView.ts +1 -1
- package/front_end/panels/network/RequestInitiatorView.ts +24 -2
- package/front_end/panels/network/RequestPayloadView.ts +1 -1
- package/front_end/panels/network/RequestPreviewView.ts +1 -1
- package/front_end/panels/network/RequestResponseView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -1
- package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
- package/front_end/panels/network/forward/UIRequestLocation.ts +1 -1
- package/front_end/panels/network/network-meta.ts +3 -3
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/network/requestInitiatorViewTree.css +5 -0
- package/front_end/panels/profiler/HeapProfileView.ts +200 -81
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/ProfileDataGrid.ts +12 -8
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -1
- package/front_end/panels/recorder/README.md +1 -2
- package/front_end/panels/recorder/RecorderPanel.ts +1861 -17
- package/front_end/panels/recorder/RecordingListView.ts +8 -37
- package/front_end/panels/recorder/RecordingView.ts +54 -27
- package/front_end/panels/recorder/SelectorPicker.ts +0 -13
- package/front_end/panels/recorder/StepEditor.ts +6 -14
- package/front_end/panels/recorder/StepView.ts +36 -105
- package/front_end/panels/recorder/recorder.ts +0 -2
- package/front_end/panels/search/SearchResultsPane.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +3 -3
- package/front_end/panels/settings/AISettingsTab.ts +17 -4
- package/front_end/panels/settings/components/SyncSection.ts +4 -4
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +3 -3
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CoveragePlugin.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -4
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +27 -3
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/PersistenceActions.ts +1 -1
- package/front_end/panels/sources/SourcesNavigator.ts +1 -1
- package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -3
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
- package/front_end/panels/sources/components/HeadersView.ts +1 -1
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +12 -1
- package/front_end/panels/sources/sources-meta.ts +1 -1
- package/front_end/panels/timeline/StatusDialog.ts +1 -1
- package/front_end/panels/timeline/TimelineController.ts +24 -3
- package/front_end/panels/timeline/TimelinePanel.ts +116 -25
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +2 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
- package/front_end/panels/timeline/components/CWVMetrics.ts +1 -1
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timeline-meta.ts +13 -0
- package/front_end/services/tracing/TracingManager.ts +27 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1418 -1413
- package/front_end/third_party/lighthouse/locales/en-US.json +12 -6
- package/front_end/third_party/lighthouse/locales/en-XL.json +12 -6
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/third_party/puppeteer/puppeteer.ts +20 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +4 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +1 -1
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +46 -2
- package/front_end/ui/components/markdown_view/markdownView.css +23 -0
- package/front_end/ui/components/spinners/Spinner.ts +29 -32
- package/front_end/ui/components/spinners/spinner.css +32 -84
- package/front_end/ui/components/text_editor/config.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +7 -1
- package/front_end/ui/legacy/Infobar.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +12 -7
- package/front_end/ui/legacy/SuggestBox.ts +1 -1
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +5 -2
- package/front_end/ui/legacy/Treeoutline.ts +40 -13
- package/front_end/ui/legacy/UIUtils.ts +25 -10
- package/front_end/ui/legacy/Widget.ts +17 -10
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +37 -8
- package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +27 -13
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +5 -2
- package/front_end/ui/legacy/components/inline_editor/CSSLinearEasingModel.ts +23 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +223 -121
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/objectValue.css +2 -1
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +105 -115
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +5 -1
- package/front_end/ui/legacy/components/source_frame/jsonView.css +4 -0
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +10 -6
- package/front_end/ui/lit/lit.ts +1 -0
- package/front_end/ui/lit/render.ts +44 -10
- package/front_end/ui/lit/strip-whitespace.ts +23 -2
- package/front_end/ui/settings/SettingUIRegistration.ts +105 -0
- package/front_end/ui/settings/settings.ts +9 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/recorder/RecorderController.ts +0 -1759
- /package/.agents/skills/{verification → devtools-verification}/SKILL.md +0 -0
- /package/front_end/{models → core}/text_utils/CodeMirrorUtils.ts +0 -0
- /package/front_end/{models → core}/text_utils/ContentData.ts +0 -0
- /package/front_end/{models → core}/text_utils/Text.ts +0 -0
- /package/front_end/{models → core}/text_utils/TextCursor.ts +0 -0
- /package/front_end/{models → core}/text_utils/TextUtils.snapshot.txt +0 -0
- /package/front_end/panels/recorder/{recorderController.css → recorderPanel.css} +0 -0
|
@@ -11,6 +11,8 @@ import * as Protocol from '../../generated/protocol.js';
|
|
|
11
11
|
import * as Geometry from '../geometry/geometry.js';
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
|
+
type Cutout,
|
|
15
|
+
CutoutShape,
|
|
14
16
|
type EmulatedDevice,
|
|
15
17
|
Horizontal,
|
|
16
18
|
HorizontalSpanned,
|
|
@@ -85,6 +87,13 @@ const UIStrings = {
|
|
|
85
87
|
const str_ = i18n.i18n.registerUIStrings('models/emulation/DeviceModeModel.ts', UIStrings);
|
|
86
88
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
87
89
|
|
|
90
|
+
const CUTOUT_SHAPE_TO_PROTOCOL: Record<CutoutShape, Protocol.Overlay.DisplayCutoutShape> = {
|
|
91
|
+
[CutoutShape.PILL]: Protocol.Overlay.DisplayCutoutShape.Pill,
|
|
92
|
+
[CutoutShape.NOTCH]: Protocol.Overlay.DisplayCutoutShape.Notch,
|
|
93
|
+
[CutoutShape.CIRCLE]: Protocol.Overlay.DisplayCutoutShape.Circle,
|
|
94
|
+
[CutoutShape.RECTANGLE]: Protocol.Overlay.DisplayCutoutShape.Rectangle,
|
|
95
|
+
};
|
|
96
|
+
|
|
88
97
|
export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
|
|
89
98
|
SDK.TargetManager.SDKModelObserver<SDK.EmulationModel.EmulationModel> {
|
|
90
99
|
#screenRect: Rect;
|
|
@@ -506,7 +515,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
506
515
|
return;
|
|
507
516
|
}
|
|
508
517
|
|
|
509
|
-
this.
|
|
518
|
+
this.showDeviceOverlaysIfApplicable(overlayModel);
|
|
510
519
|
}
|
|
511
520
|
|
|
512
521
|
private onScreenOrientationLockChanged(
|
|
@@ -638,7 +647,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
638
647
|
const mobile = this.isMobile();
|
|
639
648
|
const overlayModel = this.#emulationModel ? this.#emulationModel.overlayModel() : null;
|
|
640
649
|
if (overlayModel) {
|
|
641
|
-
this.
|
|
650
|
+
this.showDeviceOverlaysIfApplicable(overlayModel);
|
|
642
651
|
}
|
|
643
652
|
if (this.#type === Type.Device && this.#device && this.#mode) {
|
|
644
653
|
const orientation = this.#device.orientationByName(this.#mode.orientation);
|
|
@@ -878,14 +887,67 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
878
887
|
}
|
|
879
888
|
}
|
|
880
889
|
|
|
881
|
-
private
|
|
890
|
+
private showDeviceOverlaysIfApplicable(overlayModel: SDK.OverlayModel.OverlayModel): void {
|
|
882
891
|
const orientation = (this.#device && this.#mode) ? this.#device.orientationByName(this.#mode.orientation) : null;
|
|
883
892
|
if (orientation?.hinge) {
|
|
884
893
|
overlayModel.showHingeForDualScreen(orientation.hinge);
|
|
885
|
-
|
|
894
|
+
} else {
|
|
895
|
+
overlayModel.showHingeForDualScreen(null);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
overlayModel.showDisplayCutout(this.currentDisplayCutout());
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
private currentDisplayCutout(): SDK.OverlayModel.DisplayCutout|null {
|
|
902
|
+
const device = this.#device;
|
|
903
|
+
const mode = this.#mode;
|
|
904
|
+
if (!device || !mode || !device.modes.includes(mode)) {
|
|
905
|
+
return null;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
const cutout = mode.cutout;
|
|
909
|
+
if (cutout) {
|
|
910
|
+
return this.toDisplayCutout(cutout);
|
|
886
911
|
}
|
|
887
912
|
|
|
888
|
-
|
|
913
|
+
if (mode.orientation !== Horizontal) {
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
const rotationPartner = device.getRotationPartner(mode);
|
|
918
|
+
const rotatedCutout = rotationPartner?.cutout;
|
|
919
|
+
if (rotationPartner?.orientation !== Vertical || !rotatedCutout) {
|
|
920
|
+
return null;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
const orientation = device.orientationByName(mode.orientation);
|
|
924
|
+
if (rotatedCutout.shape === CutoutShape.CIRCLE) {
|
|
925
|
+
return this.toDisplayCutout({
|
|
926
|
+
...rotatedCutout,
|
|
927
|
+
x: orientation.width - rotatedCutout.y - rotatedCutout.height,
|
|
928
|
+
y: rotatedCutout.x,
|
|
929
|
+
width: rotatedCutout.height,
|
|
930
|
+
height: rotatedCutout.width,
|
|
931
|
+
cx: orientation.width - rotatedCutout.cy,
|
|
932
|
+
cy: rotatedCutout.cx,
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
return this.toDisplayCutout({
|
|
936
|
+
...rotatedCutout,
|
|
937
|
+
x: orientation.width - rotatedCutout.y - rotatedCutout.height,
|
|
938
|
+
y: rotatedCutout.x,
|
|
939
|
+
width: rotatedCutout.height,
|
|
940
|
+
height: rotatedCutout.width,
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
private toDisplayCutout(cutout: Cutout): SDK.OverlayModel.DisplayCutout {
|
|
945
|
+
const {shape, ...rest} = cutout;
|
|
946
|
+
return {
|
|
947
|
+
...rest,
|
|
948
|
+
shape: CUTOUT_SHAPE_TO_PROTOCOL[shape],
|
|
949
|
+
contentColor: {r: 0, g: 0, b: 0, a: 1},
|
|
950
|
+
} as SDK.OverlayModel.DisplayCutout;
|
|
889
951
|
}
|
|
890
952
|
|
|
891
953
|
private getDisplayFeatureOrientation(): Protocol.Emulation.DisplayFeatureOrientation {
|
|
@@ -581,7 +581,7 @@ export class EmulatedDevicesList extends Common.ObjectWrapper.ObjectWrapper<Even
|
|
|
581
581
|
#standard: Set<EmulatedDevice>;
|
|
582
582
|
readonly #customSetting: Common.Settings.Setting<any[]>;
|
|
583
583
|
readonly #custom: Set<EmulatedDevice>;
|
|
584
|
-
constructor(settings: Common.Settings.Settings
|
|
584
|
+
constructor(settings: Common.Settings.Settings) {
|
|
585
585
|
super();
|
|
586
586
|
|
|
587
587
|
this.#standardSetting = settings.createSetting('standard-emulated-device-list', []);
|
|
@@ -598,7 +598,8 @@ export class EmulatedDevicesList extends Common.ObjectWrapper.ObjectWrapper<Even
|
|
|
598
598
|
|
|
599
599
|
static instance(): EmulatedDevicesList {
|
|
600
600
|
if (!Root.DevToolsContext.globalInstance().has(EmulatedDevicesList)) {
|
|
601
|
-
Root.DevToolsContext.globalInstance().set(EmulatedDevicesList,
|
|
601
|
+
Root.DevToolsContext.globalInstance().set(EmulatedDevicesList,
|
|
602
|
+
new EmulatedDevicesList(Common.Settings.Settings.instance()));
|
|
602
603
|
}
|
|
603
604
|
return Root.DevToolsContext.globalInstance().get(EmulatedDevicesList);
|
|
604
605
|
}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
+
import * as Root from '../../core/root/root.js';
|
|
6
7
|
|
|
7
8
|
import type {RecorderExtensionEndpoint} from './RecorderExtensionEndpoint.js';
|
|
8
9
|
|
|
9
|
-
let instance: RecorderPluginManager|null = null;
|
|
10
|
-
|
|
11
10
|
export interface ViewDescriptor {
|
|
12
11
|
id: string;
|
|
13
12
|
title: string;
|
|
@@ -21,11 +20,16 @@ export class RecorderPluginManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
21
20
|
#plugins = new Set<RecorderExtensionEndpoint>();
|
|
22
21
|
#views = new Map<string, ViewDescriptor>();
|
|
23
22
|
|
|
24
|
-
static instance(): RecorderPluginManager {
|
|
25
|
-
if (!
|
|
26
|
-
|
|
23
|
+
static instance(opts?: {forceNew: boolean}): RecorderPluginManager {
|
|
24
|
+
if (!Root.DevToolsContext.globalInstance().has(RecorderPluginManager) || opts?.forceNew) {
|
|
25
|
+
Root.DevToolsContext.globalInstance().set(RecorderPluginManager, new RecorderPluginManager());
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
|
|
28
|
+
return Root.DevToolsContext.globalInstance().get(RecorderPluginManager);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static removeInstance(): void {
|
|
32
|
+
Root.DevToolsContext.globalInstance().delete(RecorderPluginManager);
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
addPlugin(plugin: RecorderExtensionEndpoint): void {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
+
import * as TextUtils from '../../core/text_utils/text_utils.js';
|
|
8
9
|
import * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
import * as TextUtils from '../text_utils/text_utils.js';
|
|
10
10
|
|
|
11
11
|
import type {HARCookie, HAREntry, HARLog, HARPage, HARTimings} from './HARFormat.js';
|
|
12
12
|
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Title: HAR Log build converts network requests into a complete HAR log with pages and entries
|
|
2
|
+
Content:
|
|
3
|
+
{
|
|
4
|
+
"version": "1.2",
|
|
5
|
+
"creator": {
|
|
6
|
+
"name": "WebInspector",
|
|
7
|
+
"version": "VERSION"
|
|
8
|
+
},
|
|
9
|
+
"pages": [
|
|
10
|
+
{
|
|
11
|
+
"startedDateTime": "1970-01-01T00:00:01.000Z",
|
|
12
|
+
"id": "page_1",
|
|
13
|
+
"title": "http://127.0.0.1:8000/devtools/resources/inspected-page.html",
|
|
14
|
+
"pageTimings": {
|
|
15
|
+
"onContentLoad": 9000,
|
|
16
|
+
"onLoad": 14000
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"entries": [
|
|
21
|
+
{
|
|
22
|
+
"_initiator": null,
|
|
23
|
+
"_priority": null,
|
|
24
|
+
"_resourceType": "document",
|
|
25
|
+
"cache": {},
|
|
26
|
+
"request": {
|
|
27
|
+
"method": "GET",
|
|
28
|
+
"url": "http://127.0.0.1:8000/devtools/resources/inspected-page.html",
|
|
29
|
+
"httpVersion": "HTTP/1.1",
|
|
30
|
+
"headers": [
|
|
31
|
+
{
|
|
32
|
+
"name": "version",
|
|
33
|
+
"value": "HTTP/1.1"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"queryString": [],
|
|
37
|
+
"cookies": [
|
|
38
|
+
{
|
|
39
|
+
"name": "a",
|
|
40
|
+
"value": "b",
|
|
41
|
+
"path": "/path",
|
|
42
|
+
"domain": "example.com",
|
|
43
|
+
"expires": null,
|
|
44
|
+
"httpOnly": false,
|
|
45
|
+
"secure": false
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "a1",
|
|
49
|
+
"value": "b1",
|
|
50
|
+
"expires": null,
|
|
51
|
+
"httpOnly": false,
|
|
52
|
+
"secure": false
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "c1",
|
|
56
|
+
"value": "d1",
|
|
57
|
+
"expires": null,
|
|
58
|
+
"httpOnly": false,
|
|
59
|
+
"secure": false
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"headersSize": -1,
|
|
63
|
+
"bodySize": 0
|
|
64
|
+
},
|
|
65
|
+
"response": {
|
|
66
|
+
"status": 0,
|
|
67
|
+
"statusText": "",
|
|
68
|
+
"httpVersion": "",
|
|
69
|
+
"headers": [
|
|
70
|
+
{
|
|
71
|
+
"name": "Set-Cookie",
|
|
72
|
+
"value": "x=y; Path=/path; Domain=example.com; httpOnly; Secure\nx1=y1; SameSite=Strict\nz2=y2; SameSite=Lax"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"cookies": [
|
|
76
|
+
{
|
|
77
|
+
"name": "x",
|
|
78
|
+
"value": "y",
|
|
79
|
+
"path": "/path",
|
|
80
|
+
"domain": "example.com",
|
|
81
|
+
"expires": null,
|
|
82
|
+
"httpOnly": true,
|
|
83
|
+
"secure": true
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "x1",
|
|
87
|
+
"value": "y1",
|
|
88
|
+
"domain": "127.0.0.1",
|
|
89
|
+
"expires": null,
|
|
90
|
+
"httpOnly": false,
|
|
91
|
+
"secure": false,
|
|
92
|
+
"sameSite": "Strict"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "z2",
|
|
96
|
+
"value": "y2",
|
|
97
|
+
"domain": "127.0.0.1",
|
|
98
|
+
"expires": null,
|
|
99
|
+
"httpOnly": false,
|
|
100
|
+
"secure": false,
|
|
101
|
+
"sameSite": "Lax"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"content": {
|
|
105
|
+
"size": 0,
|
|
106
|
+
"mimeType": "x-unknown"
|
|
107
|
+
},
|
|
108
|
+
"redirectURL": "",
|
|
109
|
+
"headersSize": -1,
|
|
110
|
+
"bodySize": -1,
|
|
111
|
+
"_transferSize": 0,
|
|
112
|
+
"_error": null,
|
|
113
|
+
"_fetchedViaServiceWorker": true,
|
|
114
|
+
"_responseCacheStorageCacheName": "v1",
|
|
115
|
+
"_serviceWorkerResponseSource": "cache-storage",
|
|
116
|
+
"_serviceWorkerRouterRuleIdMatched": 3,
|
|
117
|
+
"_serviceWorkerRouterMatchedSourceType": "cache",
|
|
118
|
+
"_serviceWorkerRouterActualSourceType": "cache"
|
|
119
|
+
},
|
|
120
|
+
"serverIPAddress": "",
|
|
121
|
+
"startedDateTime": "1969-12-31T23:59:59.000Z",
|
|
122
|
+
"time": 0,
|
|
123
|
+
"timings": {
|
|
124
|
+
"blocked": 0,
|
|
125
|
+
"dns": -1,
|
|
126
|
+
"ssl": -1,
|
|
127
|
+
"connect": -1,
|
|
128
|
+
"send": 0,
|
|
129
|
+
"wait": 0,
|
|
130
|
+
"receive": 0,
|
|
131
|
+
"_blocked_queueing": 2000
|
|
132
|
+
},
|
|
133
|
+
"pageref": "page_1"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"_initiator": null,
|
|
137
|
+
"_priority": null,
|
|
138
|
+
"_resourceType": "xhr",
|
|
139
|
+
"cache": {},
|
|
140
|
+
"request": {
|
|
141
|
+
"method": "POST",
|
|
142
|
+
"url": "http://127.0.0.1:8000/devtools/resources/post-target.cgi",
|
|
143
|
+
"httpVersion": "",
|
|
144
|
+
"headers": [
|
|
145
|
+
{
|
|
146
|
+
"name": "Content-Type",
|
|
147
|
+
"value": "text/xml"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"queryString": [],
|
|
151
|
+
"cookies": [],
|
|
152
|
+
"headersSize": -1,
|
|
153
|
+
"bodySize": 11,
|
|
154
|
+
"postData": {
|
|
155
|
+
"mimeType": "text/xml",
|
|
156
|
+
"text": "<xml></xml>"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"response": {
|
|
160
|
+
"status": 0,
|
|
161
|
+
"statusText": "",
|
|
162
|
+
"httpVersion": "",
|
|
163
|
+
"headers": [],
|
|
164
|
+
"cookies": [],
|
|
165
|
+
"content": {
|
|
166
|
+
"size": 0,
|
|
167
|
+
"mimeType": "application/xml"
|
|
168
|
+
},
|
|
169
|
+
"redirectURL": "",
|
|
170
|
+
"headersSize": -1,
|
|
171
|
+
"bodySize": -1,
|
|
172
|
+
"_transferSize": 0,
|
|
173
|
+
"_error": null,
|
|
174
|
+
"_fetchedViaServiceWorker": false
|
|
175
|
+
},
|
|
176
|
+
"serverIPAddress": "",
|
|
177
|
+
"startedDateTime": "1969-12-31T23:59:59.000Z",
|
|
178
|
+
"time": 0,
|
|
179
|
+
"timings": {
|
|
180
|
+
"blocked": 0,
|
|
181
|
+
"dns": -1,
|
|
182
|
+
"ssl": -1,
|
|
183
|
+
"connect": -1,
|
|
184
|
+
"send": 0,
|
|
185
|
+
"wait": 0,
|
|
186
|
+
"receive": 0,
|
|
187
|
+
"_blocked_queueing": -1
|
|
188
|
+
},
|
|
189
|
+
"pageref": "page_1"
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
=== end content
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// See https://bugs.webkit.org/show_bug.cgi?id=58127 for details.
|
|
10
10
|
|
|
11
11
|
import * as Common from '../../core/common/common.js';
|
|
12
|
-
import
|
|
12
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
13
13
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
14
14
|
import type * as Protocol from '../../generated/protocol.js';
|
|
15
15
|
|
|
@@ -33,7 +33,8 @@ export class Log {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
private creator(): Creator {
|
|
36
|
-
const
|
|
36
|
+
const userAgent = Platform.HostRuntime.HOST_RUNTIME.getUserAgent();
|
|
37
|
+
const webKitVersion = /AppleWebKit\/([^ ]+)/.exec(userAgent);
|
|
37
38
|
|
|
38
39
|
return {name: 'WebInspector', version: webKitVersion ? webKitVersion[1] : 'n/a'};
|
|
39
40
|
}
|
|
@@ -36,7 +36,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
36
36
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
37
37
|
import * as Platform from '../../core/platform/platform.js';
|
|
38
38
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
39
|
-
import * as TextUtils from '
|
|
39
|
+
import * as TextUtils from '../../core/text_utils/text_utils.js';
|
|
40
40
|
|
|
41
41
|
import {type BuildOptions, type EntryDTO, Log} from './Log.js';
|
|
42
42
|
|
|
@@ -16,6 +16,7 @@ import {HeavyAdIssue} from './HeavyAdIssue.js';
|
|
|
16
16
|
import {Issue, IssueCategory, IssueKind, unionIssueKind} from './Issue.js';
|
|
17
17
|
import type {EventTypes as IssuesManagerEventsTypes, IssueAddedEvent} from './IssuesManager.js';
|
|
18
18
|
import {Events as IssuesManagerEvents} from './IssuesManagerEvents.js';
|
|
19
|
+
import {LazyLoadImageIssue} from './LazyLoadImageIssue.js';
|
|
19
20
|
import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
|
20
21
|
import {MixedContentIssue} from './MixedContentIssue.js';
|
|
21
22
|
import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
|
|
@@ -67,6 +68,7 @@ export class AggregatedIssue extends Issue {
|
|
|
67
68
|
#mixedContentIssues = new Set<MixedContentIssue>();
|
|
68
69
|
#partitioningBlobURLIssues = new Set<PartitioningBlobURLIssue>();
|
|
69
70
|
#permissionElementIssues = new Set<PermissionElementIssue>();
|
|
71
|
+
#lazyLoadImageIssues = new Set<LazyLoadImageIssue>();
|
|
70
72
|
#selectivePermissionsInterventionIssues = new Set<SelectivePermissionsInterventionIssue>();
|
|
71
73
|
#sharedArrayBufferIssues = new Set<SharedArrayBufferIssue>();
|
|
72
74
|
#quirksModeIssues = new Set<QuirksModeIssue>();
|
|
@@ -190,6 +192,10 @@ export class AggregatedIssue extends Issue {
|
|
|
190
192
|
return this.#permissionElementIssues;
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
getLazyLoadImageIssues(): Iterable<LazyLoadImageIssue> {
|
|
196
|
+
return this.#lazyLoadImageIssues;
|
|
197
|
+
}
|
|
198
|
+
|
|
193
199
|
/**
|
|
194
200
|
* Produces a primary key for a cookie. Use this instead of `JSON.stringify` in
|
|
195
201
|
* case new fields are added to `AffectedCookie`.
|
|
@@ -279,6 +285,9 @@ export class AggregatedIssue extends Issue {
|
|
|
279
285
|
if (issue instanceof PermissionElementIssue) {
|
|
280
286
|
this.#permissionElementIssues.add(issue);
|
|
281
287
|
}
|
|
288
|
+
if (issue instanceof LazyLoadImageIssue) {
|
|
289
|
+
this.#lazyLoadImageIssues.add(issue);
|
|
290
|
+
}
|
|
282
291
|
if (issue instanceof SelectivePermissionsInterventionIssue) {
|
|
283
292
|
this.#selectivePermissionsInterventionIssues.add(issue);
|
|
284
293
|
}
|
|
@@ -23,6 +23,7 @@ import {GenericIssue} from './GenericIssue.js';
|
|
|
23
23
|
import {HeavyAdIssue} from './HeavyAdIssue.js';
|
|
24
24
|
import type {Issue, IssueKind} from './Issue.js';
|
|
25
25
|
import {Events} from './IssuesManagerEvents.js';
|
|
26
|
+
import {LazyLoadImageIssue} from './LazyLoadImageIssue.js';
|
|
26
27
|
import {MixedContentIssue} from './MixedContentIssue.js';
|
|
27
28
|
import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
|
|
28
29
|
import {PermissionElementIssue} from './PermissionElementIssue.js';
|
|
@@ -154,6 +155,10 @@ const issueCodeHandlers =
|
|
|
154
155
|
Protocol.Audits.InspectorIssueCode.SelectivePermissionsInterventionIssue,
|
|
155
156
|
SelectivePermissionsInterventionIssue.fromInspectorIssue,
|
|
156
157
|
],
|
|
158
|
+
[
|
|
159
|
+
Protocol.Audits.InspectorIssueCode.LazyLoadImageIssue,
|
|
160
|
+
LazyLoadImageIssue.fromInspectorIssue,
|
|
161
|
+
],
|
|
157
162
|
]);
|
|
158
163
|
|
|
159
164
|
export function isIssueCodeSupported(code: Protocol.Audits.InspectorIssueCode): boolean {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
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 {type AffectedElement, Issue, IssueCategory, IssueKind} from './Issue.js';
|
|
10
|
+
import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
|
11
|
+
|
|
12
|
+
const UIStrings = {
|
|
13
|
+
/**
|
|
14
|
+
* @description Link title for the lazy-loaded image with zero size issue in the Issues panel.
|
|
15
|
+
*/
|
|
16
|
+
lazyLoadImageZeroSize: 'Lazy-loaded images should have explicit dimensions',
|
|
17
|
+
} as const;
|
|
18
|
+
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/LazyLoadImageIssue.ts', UIStrings);
|
|
19
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
|
+
|
|
21
|
+
export class LazyLoadImageIssue extends Issue<Protocol.Audits.LazyLoadImageIssueDetails> {
|
|
22
|
+
constructor(issueDetails: Protocol.Audits.LazyLoadImageIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
|
|
23
|
+
const umaCode = [Protocol.Audits.InspectorIssueCode.LazyLoadImageIssue, 'ZeroSize'].join('::');
|
|
24
|
+
super({code: Protocol.Audits.InspectorIssueCode.LazyLoadImageIssue, umaCode}, issueDetails, issuesModel);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
primaryKey(): string {
|
|
28
|
+
return `${this.code()}-(${this.details().nodeId})-(${this.details().url})`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getCategory(): IssueCategory {
|
|
32
|
+
return IssueCategory.OTHER;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getDescription(): MarkdownIssueDescription {
|
|
36
|
+
return {
|
|
37
|
+
file: 'lazyLoadImageZeroSize.md',
|
|
38
|
+
links: [
|
|
39
|
+
{
|
|
40
|
+
link: 'https://web.dev/articles/browser-level-image-lazy-loading/#dimension-attributes',
|
|
41
|
+
linkTitle: i18nString(UIStrings.lazyLoadImageZeroSize),
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
elementCount(): number {
|
|
48
|
+
return this.details().nodeId ? 1 : 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override elements(): Iterable<AffectedElement> {
|
|
52
|
+
if (this.details().nodeId) {
|
|
53
|
+
const target = this.model()?.target();
|
|
54
|
+
return [{
|
|
55
|
+
backendNodeId: this.details().nodeId,
|
|
56
|
+
nodeName: 'img',
|
|
57
|
+
target: target || null,
|
|
58
|
+
}];
|
|
59
|
+
}
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
getKind(): IssueKind {
|
|
64
|
+
return IssueKind.IMPROVEMENT;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel|null,
|
|
68
|
+
inspectorIssue: Protocol.Audits.InspectorIssue): LazyLoadImageIssue[] {
|
|
69
|
+
const details = inspectorIssue.details.lazyLoadImageIssueDetails;
|
|
70
|
+
if (!details) {
|
|
71
|
+
console.warn('Lazy-loaded image issue without details received.');
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
return [new LazyLoadImageIssue(details, issuesModel)];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Lazy-loaded images should have explicit dimensions
|
|
2
|
+
|
|
3
|
+
An image on this page specifies `loading="lazy"` without explicit width and height dimensions or aspect ratio styling.
|
|
4
|
+
|
|
5
|
+
When lazy-loaded images lack dimensions, the browser allocates an initial 0x0 bounding box before network loading completes. As the user scrolls and the image loads, its sudden expansion triggers unexpected layout shifts (CLS) and can displace or clip surrounding content.
|
|
6
|
+
|
|
7
|
+
To prevent layout shifts, always include explicit `width` and `height` attributes on lazy-loaded images, or define their aspect ratio using CSS.
|
|
@@ -20,6 +20,7 @@ import * as Issue from './Issue.js';
|
|
|
20
20
|
import * as IssueAggregator from './IssueAggregator.js';
|
|
21
21
|
import * as IssueResolver from './IssueResolver.js';
|
|
22
22
|
import * as IssuesManager from './IssuesManager.js';
|
|
23
|
+
import * as LazyLoadImageIssue from './LazyLoadImageIssue.js';
|
|
23
24
|
import * as MarkdownIssueDescription from './MarkdownIssueDescription.js';
|
|
24
25
|
import * as MixedContentIssue from './MixedContentIssue.js';
|
|
25
26
|
import * as PartitioningBlobURLIssue from './PartitioningBlobURLIssue.js';
|
|
@@ -54,6 +55,7 @@ export {
|
|
|
54
55
|
IssueAggregator,
|
|
55
56
|
IssueResolver,
|
|
56
57
|
IssuesManager,
|
|
58
|
+
LazyLoadImageIssue,
|
|
57
59
|
MarkdownIssueDescription,
|
|
58
60
|
MixedContentIssue,
|
|
59
61
|
PartitioningBlobURLIssue,
|
|
@@ -226,7 +226,7 @@ export const NativeFunctions = [
|
|
|
226
226
|
{
|
|
227
227
|
name: "create",
|
|
228
228
|
signatures: [["?options"]],
|
|
229
|
-
receivers: ["CredentialsContainer","
|
|
229
|
+
receivers: ["CredentialsContainer","SemanticEmbedder"]
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
name: "defineProperty",
|
|
@@ -8257,15 +8257,6 @@ export const NativeFunctions = [
|
|
|
8257
8257
|
name: "WorkletAnimation",
|
|
8258
8258
|
signatures: [["animatorName","effects","?timeline","?options"]]
|
|
8259
8259
|
},
|
|
8260
|
-
{
|
|
8261
|
-
name: "availability",
|
|
8262
|
-
signatures: [["?options"]],
|
|
8263
|
-
receivers: ["SemanticEmbedder"]
|
|
8264
|
-
},
|
|
8265
|
-
{
|
|
8266
|
-
name: "classify",
|
|
8267
|
-
signatures: [["input","?options"]]
|
|
8268
|
-
},
|
|
8269
8260
|
{
|
|
8270
8261
|
name: "LanguageModelToolCall",
|
|
8271
8262
|
signatures: [["init"]]
|
|
@@ -8278,6 +8269,10 @@ export const NativeFunctions = [
|
|
|
8278
8269
|
name: "LanguageModelToolError",
|
|
8279
8270
|
signatures: [["init"]]
|
|
8280
8271
|
},
|
|
8272
|
+
{
|
|
8273
|
+
name: "availability",
|
|
8274
|
+
signatures: [["?options"]]
|
|
8275
|
+
},
|
|
8281
8276
|
{
|
|
8282
8277
|
name: "embed",
|
|
8283
8278
|
signatures: [["input","?options"]]
|
|
@@ -8642,6 +8637,10 @@ export const NativeFunctions = [
|
|
|
8642
8637
|
name: "Touch",
|
|
8643
8638
|
signatures: [["initDict"]]
|
|
8644
8639
|
},
|
|
8640
|
+
{
|
|
8641
|
+
name: "InstallResultEvent",
|
|
8642
|
+
signatures: [["type","?eventInitDict"]]
|
|
8643
|
+
},
|
|
8645
8644
|
{
|
|
8646
8645
|
name: "TrackEvent",
|
|
8647
8646
|
signatures: [["type","?eventInitDict"]]
|
|
@@ -17,12 +17,11 @@ const UIStrings = {
|
|
|
17
17
|
/**
|
|
18
18
|
* @description Warning text indicating that the Largest Contentful Paint (LCP) performance metric was affected by the user changing the simulated device.
|
|
19
19
|
*/
|
|
20
|
-
lcpEmulationWarning:
|
|
21
|
-
'Simulating a new device after the page loads can affect LCP. Reload the page after simulating a new device for accurate LCP data.',
|
|
20
|
+
lcpEmulationWarning: 'Simulating a device after the page loads can affect LCP. Reload the page for accurate LCP.',
|
|
22
21
|
/**
|
|
23
22
|
* @description Warning text indicating that the Largest Contentful Paint (LCP) performance metric was affected by the page loading in the background.
|
|
24
23
|
*/
|
|
25
|
-
lcpVisibilityWarning: 'LCP
|
|
24
|
+
lcpVisibilityWarning: 'LCP may be inflated because the page started loading in the background.',
|
|
26
25
|
} as const;
|
|
27
26
|
|
|
28
27
|
const str_ = i18n.i18n.registerUIStrings('models/live-metrics/LiveMetrics.ts', UIStrings);
|
|
@@ -35,8 +35,8 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
|
|
|
35
35
|
readonly #settings: Common.Settings.Settings;
|
|
36
36
|
|
|
37
37
|
constructor(
|
|
38
|
-
targetManager: SDK.TargetManager.TargetManager
|
|
39
|
-
settings: Common.Settings.Settings
|
|
38
|
+
targetManager: SDK.TargetManager.TargetManager,
|
|
39
|
+
settings: Common.Settings.Settings,
|
|
40
40
|
) {
|
|
41
41
|
super();
|
|
42
42
|
this.#targetManager = targetManager;
|
|
@@ -55,7 +55,8 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
|
|
|
55
55
|
|
|
56
56
|
static instance(): NetworkLog {
|
|
57
57
|
if (!Root.DevToolsContext.globalInstance().has(NetworkLog)) {
|
|
58
|
-
Root.DevToolsContext.globalInstance().set(
|
|
58
|
+
Root.DevToolsContext.globalInstance().set(
|
|
59
|
+
NetworkLog, new NetworkLog(SDK.TargetManager.TargetManager.instance(), Common.Settings.Settings.instance()));
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
return Root.DevToolsContext.globalInstance().get(NetworkLog);
|
|
@@ -9,7 +9,7 @@ const UIStrings = {
|
|
|
9
9
|
/**
|
|
10
10
|
* @description Text to preserve the log after refreshing
|
|
11
11
|
*/
|
|
12
|
-
preserveLog: '
|
|
12
|
+
preserveLog: 'Keep log',
|
|
13
13
|
/**
|
|
14
14
|
* @description A term that can be used to search in the command menu, and will find the search
|
|
15
15
|
* result 'Preserve log on page reload / navigation'. This is an additional search term to help
|
|
@@ -31,11 +31,11 @@ const UIStrings = {
|
|
|
31
31
|
/**
|
|
32
32
|
* @description Title of a setting under the Network category that can be invoked through the Command Menu
|
|
33
33
|
*/
|
|
34
|
-
preserveLogOnPageReload: '
|
|
34
|
+
preserveLogOnPageReload: 'Keep log on page reload / navigation',
|
|
35
35
|
/**
|
|
36
36
|
* @description Title of a setting under the Network category that can be invoked through the Command Menu
|
|
37
37
|
*/
|
|
38
|
-
doNotPreserveLogOnPageReload: '
|
|
38
|
+
doNotPreserveLogOnPageReload: 'Don’t keep log on page reload / navigation',
|
|
39
39
|
/**
|
|
40
40
|
* @description Title of an action in the network tool to toggle recording
|
|
41
41
|
*/
|