chrome-devtools-frontend 1.0.1555430 → 1.0.1558690
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/front_end/core/common/Object.ts +5 -1
- package/front_end/core/host/ResourceLoader.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/sdk/DOMModel.ts +7 -0
- package/front_end/core/sdk/NetworkManager.ts +0 -7
- package/front_end/core/sdk/SourceMap.ts +16 -2
- package/front_end/core/sdk/SourceMapManager.ts +1 -1
- package/front_end/core/sdk/SourceMapScopesInfo.ts +11 -4
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +3 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +119 -8
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +5 -1
- package/front_end/generated/Deprecation.ts +0 -7
- package/front_end/generated/InspectorBackendCommands.ts +4 -4
- package/front_end/generated/protocol.ts +9 -1
- package/front_end/models/ai_assistance/AiConversation.ts +71 -10
- package/front_end/models/ai_assistance/ArtifactsManager.ts +67 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +3 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +17 -27
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +151 -3
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +3 -3
- package/front_end/models/annotations/AnnotationRepository.ts +2 -2
- package/front_end/models/bindings/CompilerScriptMapping.ts +7 -6
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +4 -4
- package/front_end/models/greendev/Prototypes.ts +56 -0
- package/front_end/models/greendev/README.md +5 -0
- package/front_end/models/greendev/greendev.ts +5 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +5 -3
- package/front_end/models/stack_trace/StackTraceModel.ts +53 -40
- package/front_end/models/trace/EventsSerializer.ts +8 -2
- package/front_end/models/trace/extras/TraceTree.ts +4 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/insights/LCPDiscovery.ts +0 -2
- package/front_end/models/trace/types/TraceEvents.ts +0 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +96 -91
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +16 -0
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +109 -7
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +7 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +15 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +9 -9
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +6 -1
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +5 -6
- package/front_end/panels/application/AppManifestView.ts +360 -391
- package/front_end/panels/application/ApplicationPanelSidebar.ts +24 -57
- package/front_end/panels/application/CookieItemsView.ts +1 -0
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -0
- package/front_end/panels/application/ServiceWorkersView.ts +2 -0
- package/front_end/panels/application/SharedStorageTreeElement.ts +3 -0
- package/front_end/panels/application/StorageView.ts +1 -0
- package/front_end/panels/application/appManifestView.css +49 -1
- package/front_end/panels/application/components/ProtocolHandlersView.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +4 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +7 -1
- package/front_end/panels/elements/components/AdornerManager.ts +8 -0
- package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +0 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +10 -0
- package/front_end/panels/lighthouse/lighthousePanel.css +46 -3
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +4 -8
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +148 -97
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +37 -35
- package/front_end/panels/network/NetworkLogViewColumns.ts +9 -9
- package/front_end/panels/network/RequestCookiesView.ts +125 -141
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/requestCookiesView.css +22 -20
- package/front_end/panels/recorder/components/RecordingView.ts +3 -3
- package/front_end/panels/recorder/components/StepView.ts +2 -1
- package/front_end/panels/settings/SettingsScreen.ts +133 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +4 -0
- package/front_end/panels/settings/settings-meta.ts +24 -0
- package/front_end/panels/settings/settingsScreen.css +4 -0
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -3
- package/front_end/panels/sources/DebuggerPausedMessage.ts +125 -90
- package/front_end/panels/sources/SourcesPanel.ts +10 -7
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -17
- package/front_end/panels/sources/debuggerPausedMessage.css +8 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +2 -0
- package/front_end/third_party/acorn/estree-legacy.d.ts +4 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +14 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +10 -14
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +21 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +86 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +14 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +11 -15
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +21 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +18 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +0 -33
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +14 -28
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/bidi/core/Connection.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +15 -6
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +29 -10
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/icon_button/iconButton.css +3 -1
- package/front_end/ui/components/report_view/ReportView.docs.ts +37 -0
- package/front_end/ui/components/report_view/ReportView.ts +12 -6
- package/front_end/ui/components/report_view/report.css +16 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +135 -7
- package/front_end/ui/components/text_editor/config.ts +6 -6
- package/front_end/ui/legacy/ContextMenu.ts +11 -2
- package/front_end/ui/legacy/Floaty.ts +5 -9
- package/front_end/ui/legacy/InspectorView.ts +2 -1
- package/front_end/ui/legacy/ReportView.ts +5 -4
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +4 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -2
- package/front_end/ui/legacy/Widget.ts +7 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +18 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +6 -0
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -1
- package/front_end/ui/legacy/reportView.css +0 -24
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/package.json +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Copyright 2016 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api, @devtools/no-lit-render-outside-of-view */
|
|
5
4
|
|
|
6
|
-
import '../../ui/kit/kit.js';
|
|
7
5
|
import '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
6
|
+
import '../../ui/components/report_view/report_view.js';
|
|
8
7
|
|
|
9
8
|
import * as Common from '../../core/common/common.js';
|
|
10
9
|
import * as Host from '../../core/host/host.js';
|
|
@@ -15,12 +14,16 @@ import type * as Protocol from '../../generated/protocol.js';
|
|
|
15
14
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
16
15
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
17
16
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
18
|
-
import {html, i18nTemplate, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
17
|
+
import {Directives, html, i18nTemplate, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
19
18
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
20
19
|
|
|
21
20
|
import appManifestViewStyles from './appManifestView.css.js';
|
|
22
21
|
import * as ApplicationComponents from './components/components.js';
|
|
23
22
|
|
|
23
|
+
const {styleMap, classMap, ref} = Directives;
|
|
24
|
+
const {linkifyURL} = Components.Linkifier.Linkifier;
|
|
25
|
+
const {widgetConfig} = UI.Widget;
|
|
26
|
+
|
|
24
27
|
const UIStrings = {
|
|
25
28
|
/**
|
|
26
29
|
* @description Text in App Manifest View of the Application panel
|
|
@@ -446,6 +449,11 @@ const UIStrings = {
|
|
|
446
449
|
* @description Text for emulation OS selection dropdown
|
|
447
450
|
*/
|
|
448
451
|
selectWindowControlsOverlayEmulationOs: 'Emulate the Window Controls Overlay on',
|
|
452
|
+
/**
|
|
453
|
+
* @description Alert message for screen reader to announce which subsection is being scrolled to
|
|
454
|
+
* @example {"Identity"} PH1
|
|
455
|
+
*/
|
|
456
|
+
onInvokeAlert: 'Scrolled to {PH1}',
|
|
449
457
|
} as const;
|
|
450
458
|
const str_ = i18n.i18n.registerUIStrings('panels/application/AppManifestView.ts', UIStrings);
|
|
451
459
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -506,13 +514,6 @@ interface Manifest {
|
|
|
506
514
|
}
|
|
507
515
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
508
516
|
|
|
509
|
-
interface ReportSectionItem {
|
|
510
|
-
content: LitTemplate|LitTemplate[]|string|HTMLElement;
|
|
511
|
-
title?: string;
|
|
512
|
-
label?: string;
|
|
513
|
-
flexed?: boolean;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
517
|
interface IdentitySectionData {
|
|
517
518
|
name: string;
|
|
518
519
|
shortName: string;
|
|
@@ -592,76 +593,80 @@ type ProcessedImageResource = {
|
|
|
592
593
|
imageSrc: string,
|
|
593
594
|
};
|
|
594
595
|
|
|
595
|
-
function
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
color: error.critical ? 'var(--icon-error)' : 'var(--icon-warning)',
|
|
607
|
-
});
|
|
608
|
-
errorsSection.appendRow().appendChild(icon);
|
|
609
|
-
}
|
|
596
|
+
function renderSectionHeader(text: Platform.UIString.LocalizedString, output?: ViewOutput): LitTemplate {
|
|
597
|
+
// clang-format off
|
|
598
|
+
return html`
|
|
599
|
+
<devtools-report-section-header
|
|
600
|
+
${ref(e => { if (output && e instanceof HTMLElement) {
|
|
601
|
+
output.scrollToSection.set(text, () => { e.scrollIntoView(); });
|
|
602
|
+
}})}>
|
|
603
|
+
${text}
|
|
604
|
+
</devtools-report-section-header>`;
|
|
605
|
+
// clang-format on
|
|
606
|
+
}
|
|
610
607
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
608
|
+
function renderErrors(
|
|
609
|
+
warnings?: Platform.UIString.LocalizedString[], manifestErrors?: Protocol.Page.AppManifestError[],
|
|
610
|
+
imageErrors?: Platform.UIString.LocalizedString[], output?: ViewOutput): LitTemplate {
|
|
611
|
+
// clang-format off
|
|
612
|
+
return html`
|
|
613
|
+
${renderSectionHeader(i18nString(UIStrings.errorsAndWarnings), output)}
|
|
614
|
+
<div class="report-section" jslog=${VisualLogging.section('errors-and-warnings')}>
|
|
615
|
+
${manifestErrors?.map(error => html`<div class="report-row">
|
|
616
|
+
<devtools-icon
|
|
617
|
+
name=${error.critical ? 'cross-circle-filled' : 'warning-filled'}
|
|
618
|
+
style=${styleMap({color: error.critical ? 'var(--icon-error)' : 'var(--icon-warning)'})}>
|
|
619
|
+
</devtools-icon>
|
|
620
|
+
${error.message}</div>
|
|
621
|
+
`)}
|
|
622
|
+
${warnings?.map(warning => html`<div class="report-row">${warning}</div>`)}
|
|
623
|
+
${imageErrors?.map(error => html`<div class="report-row">${error}</div>`)}
|
|
624
|
+
</div>`;
|
|
625
|
+
// clang-format on
|
|
619
626
|
}
|
|
620
627
|
|
|
621
|
-
function renderIdentity(
|
|
628
|
+
function renderIdentity(identityData: IdentitySectionData, onCopy: () => void, output: ViewOutput): LitTemplate {
|
|
622
629
|
const {name, shortName, description, appId, recommendedId, hasId} = identityData;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
setSectionContents(fields, identitySection);
|
|
630
|
+
// clang-format off
|
|
631
|
+
return html`${renderSectionHeader(i18nString(UIStrings.identity), output)}
|
|
632
|
+
<div class="report-section" jslog=${VisualLogging.section('identity')}>
|
|
633
|
+
<devtools-report-key>${i18nString(UIStrings.name)}</devtools-report-key>
|
|
634
|
+
<devtools-report-value>${name}</devtools-report-value>
|
|
635
|
+
<devtools-report-key>${i18nString(UIStrings.shortName)}</devtools-report-key>
|
|
636
|
+
<devtools-report-value>${shortName}</devtools-report-value>
|
|
637
|
+
<devtools-report-key>${i18nString(UIStrings.description)}</devtools-report-key>
|
|
638
|
+
<devtools-report-value>${description}</devtools-report-value>
|
|
639
|
+
${appId && recommendedId ? html`
|
|
640
|
+
<devtools-report-key aria-label="App Id">${i18nString(UIStrings.computedAppId)}</devtools-report-key>
|
|
641
|
+
<devtools-report-value jslog=${VisualLogging.section('identity')}>
|
|
642
|
+
${appId}
|
|
643
|
+
<devtools-icon class="inline-icon" name="help" title=${i18nString(UIStrings.appIdExplainer)}
|
|
644
|
+
jslog=${VisualLogging.action('help').track({hover: true})}>
|
|
645
|
+
</devtools-icon>
|
|
646
|
+
<devtools-link href="https://developer.chrome.com/blog/pwa-manifest-id/"
|
|
647
|
+
.jslogContext=${'learn-more'}
|
|
648
|
+
${ref(setFocusOnSection(i18nString(UIStrings.identity), output))}>
|
|
649
|
+
${i18nString(UIStrings.learnMore)}
|
|
650
|
+
</devtools-link>
|
|
651
|
+
${!hasId ? html`
|
|
652
|
+
<div class="multiline-value">
|
|
653
|
+
${i18nTemplate(str_, UIStrings.appIdNote, {
|
|
654
|
+
PH1: html`<code>${recommendedId}</code>`,
|
|
655
|
+
PH2: html`<devtools-button class="inline-button" @click=${onCopy}
|
|
656
|
+
.iconName=${'copy'}
|
|
657
|
+
.variant=${Buttons.Button.Variant.ICON}
|
|
658
|
+
.size=${Buttons.Button.Size.SMALL}
|
|
659
|
+
.jslogContext=${'manifest.copy-id'}
|
|
660
|
+
.title=${i18nString(UIStrings.copyToClipboard)}>
|
|
661
|
+
</devtools-button>`,
|
|
662
|
+
})}
|
|
663
|
+
</div>` : nothing}
|
|
664
|
+
</devtools-report-value>` : nothing}
|
|
665
|
+
</div>`;
|
|
666
|
+
// clang-format on
|
|
661
667
|
}
|
|
662
668
|
|
|
663
|
-
function renderPresentation(
|
|
664
|
-
presentationSection: UI.ReportView.Section, presentationData: PresentationSectionData): void {
|
|
669
|
+
function renderPresentation(presentationData: PresentationSectionData, output: ViewOutput): LitTemplate {
|
|
665
670
|
const {
|
|
666
671
|
startUrl,
|
|
667
672
|
completeStartUrl,
|
|
@@ -673,42 +678,55 @@ function renderPresentation(
|
|
|
673
678
|
hasNewNoteUrl,
|
|
674
679
|
completeNewNoteUrl,
|
|
675
680
|
} = presentationData;
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
681
|
+
// clang-format off
|
|
682
|
+
return html`${renderSectionHeader(i18nString(UIStrings.presentation), output)}
|
|
683
|
+
<div class="report-section" jslog=${VisualLogging.section('presentation')}>
|
|
684
|
+
<devtools-report-key>${i18nString(UIStrings.startUrl)}</devtools-report-key>
|
|
685
|
+
<devtools-report-value>
|
|
686
|
+
${completeStartUrl ? (() => {
|
|
687
|
+
const link = linkifyURL(completeStartUrl, {text: startUrl, tabStop: true, jslogContext: 'start-url'});
|
|
688
|
+
output.focusOnSection.set(i18nString(UIStrings.presentation), () => link.focus());
|
|
689
|
+
return link;
|
|
690
|
+
})() : nothing}
|
|
691
|
+
</devtools-report-value>
|
|
692
|
+
<devtools-report-key>${i18nString(UIStrings.themeColor)}</devtools-report-key>
|
|
693
|
+
<devtools-report-value>${themeColor
|
|
694
|
+
? html`<devtools-color-swatch .color=${themeColor}></devtools-color-swatch>`
|
|
695
|
+
: nothing}
|
|
696
|
+
</devtools-report-value>
|
|
697
|
+
<devtools-report-key>${i18nString(UIStrings.backgroundColor)}</devtools-report-key>
|
|
698
|
+
<devtools-report-value>${backgroundColor
|
|
699
|
+
? html`<devtools-color-swatch .color=${backgroundColor}></devtools-color-swatch>`
|
|
700
|
+
: nothing}
|
|
701
|
+
</devtools-report-value>
|
|
702
|
+
<devtools-report-key>${i18nString(UIStrings.orientation)}</devtools-report-key>
|
|
703
|
+
<devtools-report-value>${orientation}</devtools-report-value>
|
|
704
|
+
<devtools-report-key>${i18nString(UIStrings.display)}</devtools-report-key>
|
|
705
|
+
<devtools-report-value>${display}</devtools-report-value>
|
|
706
|
+
${completeNewNoteUrl ? html`
|
|
707
|
+
<devtools-report-key>${i18nString(UIStrings.newNoteUrl)}</devtools-report-key>
|
|
708
|
+
<devtools-report-value>${hasNewNoteUrl
|
|
709
|
+
? linkifyURL(completeNewNoteUrl, {text: newNoteUrl, tabStop: true})
|
|
710
|
+
: nothing}
|
|
711
|
+
</devtools-report-value>
|
|
712
|
+
` : nothing}
|
|
713
|
+
</div>
|
|
714
|
+
`;
|
|
715
|
+
// clang-format on
|
|
705
716
|
}
|
|
706
717
|
|
|
707
|
-
function renderProtocolHandlers(
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
718
|
+
function renderProtocolHandlers(data: ProtocolHandlersSectionData, output: ViewOutput): LitTemplate {
|
|
719
|
+
// clang-format off
|
|
720
|
+
return html`${renderSectionHeader(i18nString(UIStrings.protocolHandlers), output)}
|
|
721
|
+
<div class="report-row">
|
|
722
|
+
<devtools-widget .widgetConfig=${widgetConfig(
|
|
723
|
+
ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView,
|
|
724
|
+
{protocolHandlers: data.protocolHandlers, manifestLink: data.manifestLink})}
|
|
725
|
+
${ref(setFocusOnSection(i18nString(UIStrings.protocolHandlers), output))}>
|
|
726
|
+
</devtools-widget>
|
|
727
|
+
</div>
|
|
728
|
+
<devtools-report-divider></devtools-report-divider>`;
|
|
729
|
+
// clang-format on
|
|
712
730
|
}
|
|
713
731
|
|
|
714
732
|
function renderImage(imageSrc: string, imageUrl: string, naturalWidth: number): LitTemplate {
|
|
@@ -721,166 +739,164 @@ function renderImage(imageSrc: string, imageUrl: string, naturalWidth: number):
|
|
|
721
739
|
// clang-format on
|
|
722
740
|
}
|
|
723
741
|
|
|
724
|
-
function
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
{
|
|
730
|
-
content: html`<devtools-checkbox class="mask-checkbox"
|
|
731
|
-
jslog=${VisualLogging.toggle('show-minimal-safe-area-for-maskable-icons')
|
|
732
|
-
.track({change: true})}
|
|
733
|
-
@click=${(event: Event) => {
|
|
734
|
-
iconsSection.setIconMasked((event.target as HTMLInputElement).checked);
|
|
735
|
-
}}>
|
|
736
|
-
${i18nString(UIStrings.showOnlyTheMinimumSafeAreaFor)}
|
|
737
|
-
</devtools-checkbox>`},
|
|
738
|
-
// clang-format on
|
|
739
|
-
{
|
|
740
|
-
content: i18nTemplate(str_, UIStrings.needHelpReadOurS, {
|
|
741
|
-
PH1: html`
|
|
742
|
-
<devtools-link href="https://web.dev/maskable-icon/" .jslogContext=${'learn-more'}>
|
|
743
|
-
${i18nString(UIStrings.documentationOnMaskableIcons)}
|
|
744
|
-
</devtools-link>`,
|
|
745
|
-
}),
|
|
746
|
-
},
|
|
747
|
-
];
|
|
748
|
-
for (const [title, images] of data.icons) {
|
|
749
|
-
const content = images.filter(icon => 'imageSrc' in icon)
|
|
750
|
-
.map(icon => renderImage(icon.imageSrc, icon.imageUrl, icon.naturalWidth));
|
|
751
|
-
contents.push({title, content, flexed: true});
|
|
752
|
-
}
|
|
753
|
-
setSectionContents(contents, iconsSection);
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
function renderShortcuts(
|
|
757
|
-
reportView: UI.ReportView.ReportView, shortcutSections: UI.ReportView.Section[], data: ShortcutsSectionData): void {
|
|
758
|
-
for (const shortcutsSection of shortcutSections) {
|
|
759
|
-
shortcutsSection.detach(/** overrideHideOnDetach= */ true);
|
|
760
|
-
}
|
|
761
|
-
shortcutSections.length = 0;
|
|
762
|
-
|
|
763
|
-
let shortcutIndex = 1;
|
|
764
|
-
for (const shortcut of data.shortcuts) {
|
|
765
|
-
const shortcutSection = reportView.appendSection(i18nString(UIStrings.shortcutS, {PH1: shortcutIndex}));
|
|
766
|
-
shortcutSection.element.setAttribute('jslog', `${VisualLogging.section('shortcuts')}`);
|
|
767
|
-
shortcutSections.push(shortcutSection);
|
|
768
|
-
|
|
769
|
-
const fields: ReportSectionItem[] = [
|
|
770
|
-
{title: i18nString(UIStrings.name), flexed: true, content: shortcut.name},
|
|
771
|
-
];
|
|
772
|
-
if (shortcut.shortName) {
|
|
773
|
-
fields.push({title: i18nString(UIStrings.shortName), flexed: true, content: shortcut.shortName});
|
|
774
|
-
}
|
|
775
|
-
if (shortcut.description) {
|
|
776
|
-
fields.push({title: i18nString(UIStrings.description), flexed: true, content: shortcut.description});
|
|
777
|
-
}
|
|
778
|
-
fields.push({
|
|
779
|
-
title: i18nString(UIStrings.url),
|
|
780
|
-
flexed: true,
|
|
781
|
-
content: Components.Linkifier.Linkifier.linkifyURL(
|
|
782
|
-
shortcut.shortcutUrl, ({text: shortcut.url, tabStop: true, jslogContext: 'shortcut'})),
|
|
783
|
-
});
|
|
784
|
-
|
|
785
|
-
for (const [title, images] of shortcut.icons) {
|
|
786
|
-
const content = images.filter(icon => 'imageSrc' in icon)
|
|
787
|
-
.map(icon => renderImage(icon.imageSrc, icon.imageUrl, icon.naturalWidth));
|
|
788
|
-
fields.push({title, content, flexed: true});
|
|
742
|
+
function setFocusOnSection(section: Platform.UIString.LocalizedString, output: ViewOutput): (e: Element|undefined) =>
|
|
743
|
+
void {
|
|
744
|
+
return (e: Element|undefined) => {
|
|
745
|
+
if (e instanceof HTMLElement) {
|
|
746
|
+
output.focusOnSection.set(section, () => e.focus());
|
|
789
747
|
}
|
|
790
|
-
|
|
791
|
-
shortcutIndex++;
|
|
792
|
-
}
|
|
748
|
+
};
|
|
793
749
|
}
|
|
794
750
|
|
|
795
|
-
function
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
751
|
+
function renderIcons(
|
|
752
|
+
data: IconsSectionData, maskedIcons: boolean, onToggleIconMasked: (value: boolean) => void,
|
|
753
|
+
output: ViewOutput): LitTemplate {
|
|
754
|
+
// clang-format off
|
|
755
|
+
return html`${renderSectionHeader(i18nString(UIStrings.icons), output)}
|
|
756
|
+
<div class="report-section" jslog=${VisualLogging.section('icons')}>
|
|
757
|
+
<div class="report-row">
|
|
758
|
+
<devtools-checkbox class="mask-checkbox"
|
|
759
|
+
jslog=${VisualLogging.toggle('show-minimal-safe-area-for-maskable-icons')
|
|
760
|
+
.track({change: true})}
|
|
761
|
+
@click=${(event: Event) => onToggleIconMasked((event.target as HTMLInputElement).checked)}
|
|
762
|
+
${ref(setFocusOnSection(i18nString(UIStrings.icons), output))}>
|
|
763
|
+
${i18nString(UIStrings.showOnlyTheMinimumSafeAreaFor)}
|
|
764
|
+
</devtools-checkbox>
|
|
765
|
+
</div>
|
|
766
|
+
<div class="report-row">
|
|
767
|
+
${i18nTemplate(str_, UIStrings.needHelpReadOurS, {
|
|
768
|
+
PH1: html`
|
|
769
|
+
<devtools-link href="https://web.dev/maskable-icon/" .jslogContext=${'learn-more'}>
|
|
770
|
+
${i18nString(UIStrings.documentationOnMaskableIcons)}
|
|
771
|
+
</devtools-link>`,
|
|
772
|
+
})}
|
|
773
|
+
</div>
|
|
774
|
+
${Array.from(data.icons).map(([title, images]: [string, ProcessedImageResource[]]) => {
|
|
775
|
+
return html`
|
|
776
|
+
<devtools-report-key>${title}</devtools-report-key>
|
|
777
|
+
<devtools-report-value class=${classMap({'show-mask': Boolean(maskedIcons)})}>
|
|
778
|
+
${images.filter(icon => 'imageSrc' in icon)
|
|
779
|
+
.map(icon => renderImage(icon.imageSrc, icon.imageUrl, icon.naturalWidth))}
|
|
780
|
+
</devtools-report-value>
|
|
781
|
+
`;})}
|
|
782
|
+
</div>`;
|
|
783
|
+
// clang-format on
|
|
784
|
+
}
|
|
809
785
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
786
|
+
function renderShortcuts(data: ShortcutsSectionData): LitTemplate {
|
|
787
|
+
// clang-format off
|
|
788
|
+
return html`${data.shortcuts.map((shortcut, index) => html`
|
|
789
|
+
${renderSectionHeader(i18nString(UIStrings.shortcutS, {PH1: index + 1}))}
|
|
790
|
+
<div class="report-section" jslog=${VisualLogging.section('shortcuts')}>
|
|
791
|
+
<devtools-report-key>${i18nString(UIStrings.name)}</devtools-report-key>
|
|
792
|
+
<devtools-report-value>${shortcut.name}</devtools-report-value>
|
|
793
|
+
${shortcut.shortName ? html`
|
|
794
|
+
<devtools-report-key>${i18nString(UIStrings.shortName)}</devtools-report-key>
|
|
795
|
+
<devtools-report-value>${shortcut.shortName}</devtools-report-value>
|
|
796
|
+
` : nothing}
|
|
797
|
+
${shortcut.description ? html`
|
|
798
|
+
<devtools-report-key>${i18nString(UIStrings.description)}</devtools-report-key>
|
|
799
|
+
<devtools-report-value>${shortcut.description}</devtools-report-value>
|
|
800
|
+
` : nothing}
|
|
801
|
+
<devtools-report-key>${i18nString(UIStrings.url)}</devtools-report-key>
|
|
802
|
+
<devtools-report-value>
|
|
803
|
+
${linkifyURL(shortcut.shortcutUrl, {text: shortcut.url, tabStop: true, jslogContext: 'shortcut'})}
|
|
804
|
+
</devtools-report-value>
|
|
805
|
+
${Array.from(shortcut.icons).map(([title, images]) => html`
|
|
806
|
+
<devtools-report-key>${title}</devtools-report-key>
|
|
807
|
+
<devtools-report-value>
|
|
808
|
+
${images.filter(icon => 'imageSrc' in icon)
|
|
809
|
+
.map(icon => renderImage(icon.imageSrc, icon.imageUrl, icon.naturalWidth))}
|
|
810
|
+
</devtools-report-value>
|
|
811
|
+
`)}
|
|
812
|
+
</div>`)}`;
|
|
813
|
+
// clang-format on
|
|
814
|
+
}
|
|
819
815
|
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
816
|
+
function renderScreenshots(data: ScreenshotsSectionData): LitTemplate {
|
|
817
|
+
// clang-format off
|
|
818
|
+
return html`${data.screenshots.map(({screenshot, processedImage}, index) => html`
|
|
819
|
+
${renderSectionHeader(i18nString(UIStrings.screenshotS, {PH1: index + 1}))}
|
|
820
|
+
<div class="report-section" jslog=${VisualLogging.section('screenshots')}>
|
|
821
|
+
${screenshot.form_factor
|
|
822
|
+
? html`<devtools-report-key>${i18nString(UIStrings.formFactor)}</devtools-report-key>
|
|
823
|
+
<devtools-report-value>${screenshot.form_factor}</devtools-report-value>`
|
|
824
|
+
: nothing}
|
|
825
|
+
${screenshot.label
|
|
826
|
+
? html`<devtools-report-key>${i18nString(UIStrings.label)}</devtools-report-key>
|
|
827
|
+
<devtools-report-value>${screenshot.label}</devtools-report-value>`
|
|
828
|
+
: nothing}
|
|
829
|
+
${screenshot.platform
|
|
830
|
+
? html`<devtools-report-key>${i18nString(UIStrings.platform)}</devtools-report-key>
|
|
831
|
+
<devtools-report-value>${screenshot.platform}</devtools-report-value>`
|
|
832
|
+
: nothing}
|
|
833
|
+
${'imageSrc' in processedImage ? html`
|
|
834
|
+
<devtools-report-key>${processedImage.title}</devtools-report-key>
|
|
835
|
+
<devtools-report-value>
|
|
836
|
+
${renderImage(processedImage.imageSrc, processedImage.imageUrl, processedImage.naturalWidth)}
|
|
837
|
+
</devtools-report-value>`
|
|
838
|
+
: nothing}
|
|
839
|
+
</div>
|
|
840
|
+
`)}`;
|
|
841
|
+
// clang-format on
|
|
827
842
|
}
|
|
828
843
|
|
|
829
|
-
function renderInstallability(
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
844
|
+
function renderInstallability(installabilityErrors: Protocol.Page.InstallabilityError[]): LitTemplate {
|
|
845
|
+
return html`${renderSectionHeader(i18nString(UIStrings.installability))}
|
|
846
|
+
${getInstallabilityErrorMessages(installabilityErrors).map(content => html`
|
|
847
|
+
<div class="report-row">
|
|
848
|
+
${content}
|
|
849
|
+
</div>
|
|
850
|
+
`)}`;
|
|
835
851
|
}
|
|
836
852
|
|
|
837
853
|
function renderWindowControlsSection(
|
|
838
|
-
|
|
839
|
-
onSelectOs
|
|
840
|
-
onToggleWcoToolbar
|
|
841
|
-
const {hasWco, url} = data;
|
|
842
|
-
const contents: ReportSectionItem[] = [];
|
|
843
|
-
if (hasWco) {
|
|
844
|
-
// clang-format off
|
|
845
|
-
contents.push({content: html`
|
|
846
|
-
<devtools-icon class="inline-icon" name="check-circle"></devtools-icon>
|
|
847
|
-
${i18nTemplate(str_, UIStrings.wcoFound, {
|
|
848
|
-
PH1: html`<code class="wco">window-controls-overlay</code>`,
|
|
849
|
-
PH2: html`<code>
|
|
850
|
-
<devtools-link href="https://developer.mozilla.org/en-US/docs/Web/Manifest/display_override"
|
|
851
|
-
.jslogContext=${'display-override'}>
|
|
852
|
-
display-override
|
|
853
|
-
</devtools-link>
|
|
854
|
-
</code>`,
|
|
855
|
-
PH3: html`${Components.Linkifier.Linkifier.linkifyURL(url)}`,
|
|
856
|
-
})}`});
|
|
857
|
-
// clang-format on
|
|
858
|
-
if (selectedPlatform && onSelectOs && onToggleWcoToolbar) {
|
|
859
|
-
const controls = renderWindowControls(selectedPlatform, onSelectOs, onToggleWcoToolbar);
|
|
860
|
-
contents.push(controls);
|
|
861
|
-
}
|
|
862
|
-
} else {
|
|
863
|
-
// clang-format off
|
|
864
|
-
contents.push({content: html`
|
|
865
|
-
<devtools-icon class="inline-icon" name="info"></devtools-icon>
|
|
866
|
-
${i18nTemplate(str_, UIStrings.wcoNotFound, {
|
|
867
|
-
PH1: html`<code>
|
|
868
|
-
<devtools-link href="https://developer.mozilla.org/en-US/docs/Web/Manifest/display_override"
|
|
869
|
-
.jslogContext=${'display-override'}>
|
|
870
|
-
display-override
|
|
871
|
-
</devtools-link>
|
|
872
|
-
</code>`})}`});
|
|
873
|
-
// clang-format on
|
|
874
|
-
}
|
|
854
|
+
data: WindowControlsSectionData, selectedPlatform: string|undefined,
|
|
855
|
+
onSelectOs: ((selectedOS: SDK.OverlayModel.EmulatedOSType) => Promise<void>)|undefined,
|
|
856
|
+
onToggleWcoToolbar: ((enabled: boolean) => Promise<void>)|undefined, output: ViewOutput): LitTemplate {
|
|
875
857
|
// clang-format off
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
858
|
+
return html`
|
|
859
|
+
${renderSectionHeader(i18nString(UIStrings.windowControlsOverlay), output)}
|
|
860
|
+
<div class="report-section" jslog=${VisualLogging.section('window-controls-overlay')}>
|
|
861
|
+
${data?.hasWco && output ? html`
|
|
862
|
+
<div class="report-row">
|
|
863
|
+
<devtools-icon class="inline-icon" name="check-circle"></devtools-icon>
|
|
864
|
+
${i18nTemplate(str_, UIStrings.wcoFound, {
|
|
865
|
+
PH1: html`<code class="wco">window-controls-overlay</code>`,
|
|
866
|
+
PH2: html`<code>
|
|
867
|
+
<devtools-link
|
|
868
|
+
href="https://developer.mozilla.org/en-US/docs/Web/Manifest/display_override"
|
|
869
|
+
.jslogContext=${'display-override'}
|
|
870
|
+
${ref(setFocusOnSection(i18nString(UIStrings.windowControlsOverlay), output))}>
|
|
871
|
+
display-override
|
|
872
|
+
</devtools-link>
|
|
873
|
+
</code>`,
|
|
874
|
+
PH3: html`${Components.Linkifier.Linkifier.linkifyURL(data.url)}`,
|
|
875
|
+
})}
|
|
876
|
+
</div>
|
|
877
|
+
${selectedPlatform && onSelectOs && onToggleWcoToolbar ?
|
|
878
|
+
renderWindowControls(selectedPlatform, onSelectOs, onToggleWcoToolbar) :
|
|
879
|
+
nothing}` : html`
|
|
880
|
+
<div class="report-row">
|
|
881
|
+
<devtools-icon class="inline-icon" name="info"></devtools-icon>
|
|
882
|
+
${i18nTemplate(str_, UIStrings.wcoNotFound, {PH1: html`<code>
|
|
883
|
+
<devtools-link
|
|
884
|
+
href="https://developer.mozilla.org/en-US/docs/Web/Manifest/display_override"
|
|
885
|
+
.jslogContext=${'display-override'}
|
|
886
|
+
${ref(setFocusOnSection(i18nString(UIStrings.windowControlsOverlay), output))}>
|
|
887
|
+
display-override
|
|
888
|
+
</devtools-link>
|
|
889
|
+
</code>`})}
|
|
890
|
+
</div>`}
|
|
891
|
+
<div class="report-row">
|
|
892
|
+
${i18nTemplate(str_, UIStrings.wcoNeedHelpReadMore, {PH1: html`<devtools-link
|
|
893
|
+
href="https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/window-controls-overlay"
|
|
894
|
+
.jslogContext=${'customize-pwa-tittle-bar'}>
|
|
895
|
+
${i18nString(UIStrings.customizePwaTitleBar)}
|
|
896
|
+
</devtools-link>`})}
|
|
897
|
+
</div>
|
|
898
|
+
</div>`;
|
|
881
899
|
// clang-format on
|
|
882
|
-
windowControlsSection.clearContent();
|
|
883
|
-
setSectionContents(contents, windowControlsSection);
|
|
884
900
|
}
|
|
885
901
|
|
|
886
902
|
function getInstallabilityErrorMessages(installabilityErrors: Protocol.Page.InstallabilityError[]): string[] {
|
|
@@ -984,9 +1000,9 @@ function getInstallabilityErrorMessages(installabilityErrors: Protocol.Page.Inst
|
|
|
984
1000
|
|
|
985
1001
|
function renderWindowControls(
|
|
986
1002
|
selectedPlatform: string, onSelectOs: (selectedOS: SDK.OverlayModel.EmulatedOSType) => Promise<void>,
|
|
987
|
-
onToggleWcoToolbar: (enabled: boolean) => Promise<void>):
|
|
1003
|
+
onToggleWcoToolbar: (enabled: boolean) => Promise<void>): LitTemplate {
|
|
988
1004
|
// clang-format off
|
|
989
|
-
return
|
|
1005
|
+
return html`<div class="report-row">
|
|
990
1006
|
<devtools-checkbox @click=${(event: Event) => onToggleWcoToolbar((event.target as HTMLInputElement).checked)}
|
|
991
1007
|
title=${i18nString(UIStrings.selectWindowControlsOverlayEmulationOs)}>
|
|
992
1008
|
${i18nString(UIStrings.selectWindowControlsOverlayEmulationOs)}
|
|
@@ -1010,33 +1026,19 @@ function renderWindowControls(
|
|
|
1010
1026
|
jslog=${VisualLogging.item('linux').track({click: true})}>
|
|
1011
1027
|
Linux
|
|
1012
1028
|
</option>
|
|
1013
|
-
</select
|
|
1029
|
+
</select>
|
|
1030
|
+
</div>`;
|
|
1014
1031
|
// clang-format on
|
|
1015
1032
|
}
|
|
1016
1033
|
|
|
1017
|
-
function setSectionContents(items: ReportSectionItem[], section: UI.ReportView.Section): void {
|
|
1018
|
-
for (const item of items) {
|
|
1019
|
-
if (!item.title) {
|
|
1020
|
-
render(item.content, section.appendRow());
|
|
1021
|
-
continue;
|
|
1022
|
-
}
|
|
1023
|
-
const element = item.flexed ? section.appendFlexedField(item.title) : section.appendField(item.title);
|
|
1024
|
-
if (item.label) {
|
|
1025
|
-
UI.ARIAUtils.setLabel(element, item.label);
|
|
1026
|
-
}
|
|
1027
|
-
render(item.content, element);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
1034
|
interface ViewInput {
|
|
1032
|
-
|
|
1033
|
-
reportView: UI.ReportView.ReportView;
|
|
1035
|
+
isEmpty?: boolean;
|
|
1034
1036
|
errorsSection?: UI.ReportView.Section;
|
|
1035
1037
|
installabilitySection?: UI.ReportView.Section;
|
|
1036
1038
|
identitySection?: UI.ReportView.Section;
|
|
1037
1039
|
presentationSection?: UI.ReportView.Section;
|
|
1038
|
-
protocolHandlersView?: ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView;
|
|
1039
1040
|
iconsSection?: UI.ReportView.Section;
|
|
1041
|
+
maskedIcons?: boolean;
|
|
1040
1042
|
windowControlsSection?: UI.ReportView.Section;
|
|
1041
1043
|
shortcutSections?: UI.ReportView.Section[];
|
|
1042
1044
|
screenshotsSections?: UI.ReportView.Section[];
|
|
@@ -1056,22 +1058,20 @@ interface ViewInput {
|
|
|
1056
1058
|
selectedPlatform?: string;
|
|
1057
1059
|
onSelectOs?: (selectedOS: SDK.OverlayModel.EmulatedOSType) => Promise<void>;
|
|
1058
1060
|
onToggleWcoToolbar?: (enabled: boolean) => Promise<void>;
|
|
1061
|
+
onCopyId?: () => void;
|
|
1062
|
+
onToggleIconMasked?: (masked: boolean) => void;
|
|
1059
1063
|
}
|
|
1060
1064
|
|
|
1061
|
-
|
|
1065
|
+
interface ViewOutput {
|
|
1066
|
+
scrollToSection: Map<string, () => void>;
|
|
1067
|
+
focusOnSection: Map<string, () => void>;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
1062
1071
|
|
|
1063
|
-
export const DEFAULT_VIEW: View = (input,
|
|
1072
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
1064
1073
|
const {
|
|
1065
|
-
|
|
1066
|
-
errorsSection,
|
|
1067
|
-
installabilitySection,
|
|
1068
|
-
identitySection,
|
|
1069
|
-
presentationSection,
|
|
1070
|
-
protocolHandlersView,
|
|
1071
|
-
iconsSection,
|
|
1072
|
-
windowControlsSection,
|
|
1073
|
-
shortcutSections,
|
|
1074
|
-
screenshotsSections,
|
|
1074
|
+
isEmpty,
|
|
1075
1075
|
identityData,
|
|
1076
1076
|
presentationData,
|
|
1077
1077
|
protocolHandlersData,
|
|
@@ -1082,67 +1082,57 @@ export const DEFAULT_VIEW: View = (input, _output, _target) => {
|
|
|
1082
1082
|
warnings,
|
|
1083
1083
|
errors,
|
|
1084
1084
|
imageErrors,
|
|
1085
|
+
maskedIcons,
|
|
1085
1086
|
windowControlsData,
|
|
1086
1087
|
selectedPlatform,
|
|
1087
1088
|
onSelectOs,
|
|
1088
1089
|
onToggleWcoToolbar,
|
|
1090
|
+
onToggleIconMasked,
|
|
1091
|
+
onCopyId,
|
|
1092
|
+
url,
|
|
1089
1093
|
} = input;
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}
|
|
1115
|
-
if (errorsSection) {
|
|
1116
|
-
renderErrors(errorsSection, warnings, errors, imageErrors);
|
|
1117
|
-
}
|
|
1094
|
+
// clang-format off
|
|
1095
|
+
render(html`
|
|
1096
|
+
<style>${appManifestViewStyles}</style>
|
|
1097
|
+
<style>${UI.inspectorCommonStyles}</style>
|
|
1098
|
+
${isEmpty ? html`
|
|
1099
|
+
<devtools-widget .widgetConfig=${widgetConfig(UI.EmptyWidget.EmptyWidget, {
|
|
1100
|
+
header: i18nString(UIStrings.noManifestDetected),
|
|
1101
|
+
text: i18nString(UIStrings.manifestDescription),
|
|
1102
|
+
link: 'https://web.dev/add-manifest/' as Platform.DevToolsPath.UrlString
|
|
1103
|
+
})}></devtools-widget>` : html`
|
|
1104
|
+
<devtools-report .data=${{reportTitle: i18nString(UIStrings.appManifest), reportUrl: url}}>
|
|
1105
|
+
${renderErrors(warnings, errors, imageErrors, output)}
|
|
1106
|
+
${installabilityErrors?.length ? renderInstallability(installabilityErrors) : nothing}
|
|
1107
|
+
${identityData && onCopyId ? renderIdentity(identityData, onCopyId, output) : nothing}
|
|
1108
|
+
${presentationData ? renderPresentation(presentationData, output) : nothing}
|
|
1109
|
+
${protocolHandlersData ? renderProtocolHandlers(protocolHandlersData, output) : nothing}
|
|
1110
|
+
${iconsData && onToggleIconMasked && maskedIcons ?
|
|
1111
|
+
renderIcons(iconsData, maskedIcons, onToggleIconMasked, output) : nothing}
|
|
1112
|
+
${windowControlsData && output ? renderWindowControlsSection(
|
|
1113
|
+
windowControlsData, selectedPlatform, onSelectOs, onToggleWcoToolbar, output) : nothing}
|
|
1114
|
+
${shortcutsData ? renderShortcuts(shortcutsData) : nothing}
|
|
1115
|
+
${screenshotsData ? renderScreenshots(screenshotsData) : nothing}
|
|
1116
|
+
</devtools-report>`}`, target);
|
|
1117
|
+
// clang-format on
|
|
1118
1118
|
};
|
|
1119
1119
|
|
|
1120
1120
|
export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox)
|
|
1121
1121
|
implements SDK.TargetManager.Observer {
|
|
1122
|
-
private readonly emptyView: UI.EmptyWidget.EmptyWidget;
|
|
1123
|
-
private readonly reportView: UI.ReportView.ReportView;
|
|
1124
|
-
private readonly errorsSection: UI.ReportView.Section;
|
|
1125
|
-
private readonly installabilitySection: UI.ReportView.Section;
|
|
1126
|
-
private readonly identitySection: UI.ReportView.Section;
|
|
1127
|
-
private readonly presentationSection: UI.ReportView.Section;
|
|
1128
|
-
private readonly iconsSection: UI.ReportView.Section;
|
|
1129
|
-
private readonly windowControlsSection: UI.ReportView.Section;
|
|
1130
|
-
private readonly protocolHandlersSection: UI.ReportView.Section;
|
|
1131
|
-
private readonly shortcutSections: UI.ReportView.Section[];
|
|
1132
|
-
private readonly screenshotsSections: UI.ReportView.Section[];
|
|
1133
1122
|
private registeredListeners: Common.EventTarget.EventDescriptor[];
|
|
1134
1123
|
private target?: SDK.Target.Target;
|
|
1135
1124
|
private resourceTreeModel?: SDK.ResourceTreeModel.ResourceTreeModel|null;
|
|
1136
1125
|
private serviceWorkerManager?: SDK.ServiceWorkerManager.ServiceWorkerManager|null;
|
|
1137
1126
|
private overlayModel?: SDK.OverlayModel.OverlayModel|null;
|
|
1138
|
-
private protocolHandlersView: ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView;
|
|
1139
1127
|
private manifestUrl: Platform.DevToolsPath.UrlString;
|
|
1140
1128
|
private manifestData: string|null;
|
|
1141
1129
|
private manifestErrors: Protocol.Page.AppManifestError[];
|
|
1142
1130
|
private installabilityErrors: Protocol.Page.InstallabilityError[];
|
|
1143
1131
|
private appIdResponse: Protocol.Page.GetAppIdResponse|null;
|
|
1144
1132
|
private wcoToolbarEnabled = false;
|
|
1133
|
+
private maskedIcons = false;
|
|
1145
1134
|
private readonly view: View;
|
|
1135
|
+
private readonly output: ViewOutput = {scrollToSection: new Map(), focusOnSection: new Map()};
|
|
1146
1136
|
|
|
1147
1137
|
constructor(view: View = DEFAULT_VIEW) {
|
|
1148
1138
|
super({
|
|
@@ -1150,39 +1140,6 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1150
1140
|
useShadowDom: true,
|
|
1151
1141
|
});
|
|
1152
1142
|
this.view = view;
|
|
1153
|
-
this.registerRequiredCSS(appManifestViewStyles);
|
|
1154
|
-
|
|
1155
|
-
this.contentElement.classList.add('manifest-container');
|
|
1156
|
-
|
|
1157
|
-
this.emptyView = new UI.EmptyWidget.EmptyWidget(
|
|
1158
|
-
i18nString(UIStrings.noManifestDetected), i18nString(UIStrings.manifestDescription));
|
|
1159
|
-
this.emptyView.link = 'https://web.dev/add-manifest/' as Platform.DevToolsPath.UrlString;
|
|
1160
|
-
|
|
1161
|
-
this.emptyView.show(this.contentElement);
|
|
1162
|
-
this.emptyView.hideWidget();
|
|
1163
|
-
|
|
1164
|
-
this.reportView = new UI.ReportView.ReportView(i18nString(UIStrings.appManifest));
|
|
1165
|
-
this.reportView.registerRequiredCSS(appManifestViewStyles);
|
|
1166
|
-
this.reportView.element.classList.add('manifest-view-header');
|
|
1167
|
-
this.reportView.show(this.contentElement);
|
|
1168
|
-
this.reportView.hideWidget();
|
|
1169
|
-
|
|
1170
|
-
this.errorsSection =
|
|
1171
|
-
this.reportView.appendSection(i18nString(UIStrings.errorsAndWarnings), undefined, 'errors-and-warnings');
|
|
1172
|
-
this.installabilitySection =
|
|
1173
|
-
this.reportView.appendSection(i18nString(UIStrings.installability), undefined, 'installability');
|
|
1174
|
-
this.identitySection = this.reportView.appendSection(i18nString(UIStrings.identity), 'undefined,identity');
|
|
1175
|
-
this.presentationSection =
|
|
1176
|
-
this.reportView.appendSection(i18nString(UIStrings.presentation), 'undefined,presentation');
|
|
1177
|
-
this.protocolHandlersSection =
|
|
1178
|
-
this.reportView.appendSection(i18nString(UIStrings.protocolHandlers), 'undefined,protocol-handlers');
|
|
1179
|
-
this.protocolHandlersView = new ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView();
|
|
1180
|
-
this.protocolHandlersView.show(this.protocolHandlersSection.getFieldElement());
|
|
1181
|
-
this.iconsSection = this.reportView.appendSection(i18nString(UIStrings.icons), 'report-section-icons', 'icons');
|
|
1182
|
-
this.windowControlsSection =
|
|
1183
|
-
this.reportView.appendSection(UIStrings.windowControlsOverlay, undefined, 'window-controls-overlay');
|
|
1184
|
-
this.shortcutSections = [];
|
|
1185
|
-
this.screenshotsSections = [];
|
|
1186
1143
|
|
|
1187
1144
|
SDK.TargetManager.TargetManager.instance().observeTargets(this);
|
|
1188
1145
|
this.registeredListeners = [];
|
|
@@ -1194,18 +1151,36 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1194
1151
|
this.appIdResponse = null;
|
|
1195
1152
|
}
|
|
1196
1153
|
|
|
1197
|
-
|
|
1154
|
+
scrollToSection(sectionTitle: string): void {
|
|
1155
|
+
const handler = this.output.scrollToSection.get(sectionTitle);
|
|
1156
|
+
if (!handler) {
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
handler();
|
|
1160
|
+
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.onInvokeAlert, {PH1: sectionTitle}));
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
focusOnSection(sectionTitle: string): boolean {
|
|
1164
|
+
const handler = this.output.focusOnSection.get(sectionTitle);
|
|
1165
|
+
if (!handler) {
|
|
1166
|
+
return false;
|
|
1167
|
+
}
|
|
1168
|
+
handler();
|
|
1169
|
+
return true;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
getStaticSections(): Array<{title: string, jslogContext: string|undefined}> {
|
|
1198
1173
|
return [
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1174
|
+
{title: i18nString(UIStrings.identity), jslogContext: 'identity'},
|
|
1175
|
+
{title: i18nString(UIStrings.presentation), jslogContext: 'presentation'},
|
|
1176
|
+
{title: i18nString(UIStrings.protocolHandlers), jslogContext: 'protocol-handlers'},
|
|
1177
|
+
{title: i18nString(UIStrings.icons), jslogContext: 'icons'},
|
|
1178
|
+
{title: i18nString(UIStrings.windowControlsOverlay), jslogContext: 'window-controls'},
|
|
1204
1179
|
];
|
|
1205
1180
|
}
|
|
1206
1181
|
|
|
1207
1182
|
getManifestElement(): Element {
|
|
1208
|
-
return this.
|
|
1183
|
+
return this.contentElement;
|
|
1209
1184
|
}
|
|
1210
1185
|
|
|
1211
1186
|
targetAdded(target: SDK.Target.Target): void {
|
|
@@ -1282,23 +1257,14 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1282
1257
|
const appId = appIdResponse?.appId || null;
|
|
1283
1258
|
const recommendedId = appIdResponse?.recommendedId || null;
|
|
1284
1259
|
if ((!data || data === '{}') && !errors.length) {
|
|
1285
|
-
this.
|
|
1286
|
-
this.reportView.hideWidget();
|
|
1287
|
-
this.view({emptyView: this.emptyView, reportView: this.reportView}, undefined, this.contentElement);
|
|
1260
|
+
this.view({isEmpty: true}, this.output, this.contentElement);
|
|
1288
1261
|
this.dispatchEventToListeners(Events.MANIFEST_DETECTED, false);
|
|
1289
1262
|
return;
|
|
1290
1263
|
}
|
|
1291
|
-
this.emptyView.hideWidget();
|
|
1292
|
-
this.reportView.showWidget();
|
|
1293
1264
|
this.dispatchEventToListeners(Events.MANIFEST_DETECTED, true);
|
|
1294
1265
|
|
|
1295
|
-
const link = Components.Linkifier.Linkifier.linkifyURL(url, {tabStop: true});
|
|
1296
|
-
this.reportView.setURL(link);
|
|
1297
|
-
|
|
1298
1266
|
if (!data) {
|
|
1299
|
-
this.view(
|
|
1300
|
-
{emptyView: this.emptyView, reportView: this.reportView, errorsSection: this.errorsSection, errors},
|
|
1301
|
-
undefined, this.contentElement);
|
|
1267
|
+
this.view({url, errors}, this.output, this.contentElement);
|
|
1302
1268
|
return;
|
|
1303
1269
|
}
|
|
1304
1270
|
|
|
@@ -1336,19 +1302,17 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1336
1302
|
(selectedOS: SDK.OverlayModel.EmulatedOSType) => this.onSelectOs(selectedOS, windowControlsData.themeColor) :
|
|
1337
1303
|
undefined;
|
|
1338
1304
|
const onToggleWcoToolbar = this.overlayModel ? (enabled: boolean) => this.onToggleWcoToolbar(enabled) : undefined;
|
|
1305
|
+
const onCopyId = recommendedId ? () : void => {
|
|
1306
|
+
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.copiedToClipboard, {PH1: recommendedId}));
|
|
1307
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(recommendedId);
|
|
1308
|
+
}: undefined;
|
|
1309
|
+
const onToggleIconMasked = (masked: boolean): void => {
|
|
1310
|
+
this.maskedIcons = masked;
|
|
1311
|
+
this.requestUpdate();
|
|
1312
|
+
};
|
|
1339
1313
|
this.view(
|
|
1340
1314
|
{
|
|
1341
|
-
|
|
1342
|
-
reportView: this.reportView,
|
|
1343
|
-
errorsSection: this.errorsSection,
|
|
1344
|
-
installabilitySection: this.installabilitySection,
|
|
1345
|
-
identitySection: this.identitySection,
|
|
1346
|
-
presentationSection: this.presentationSection,
|
|
1347
|
-
protocolHandlersView: this.protocolHandlersView,
|
|
1348
|
-
iconsSection: this.iconsSection,
|
|
1349
|
-
windowControlsSection: this.windowControlsSection,
|
|
1350
|
-
shortcutSections: this.shortcutSections,
|
|
1351
|
-
screenshotsSections: this.screenshotsSections,
|
|
1315
|
+
maskedIcons: this.maskedIcons,
|
|
1352
1316
|
parsedManifest,
|
|
1353
1317
|
url,
|
|
1354
1318
|
identityData,
|
|
@@ -1365,8 +1329,10 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1365
1329
|
selectedPlatform,
|
|
1366
1330
|
onSelectOs,
|
|
1367
1331
|
onToggleWcoToolbar,
|
|
1332
|
+
onCopyId,
|
|
1333
|
+
onToggleIconMasked,
|
|
1368
1334
|
},
|
|
1369
|
-
|
|
1335
|
+
this.output, this.contentElement);
|
|
1370
1336
|
}
|
|
1371
1337
|
|
|
1372
1338
|
private stringProperty(parsedManifest: Manifest, name: keyof Manifest): string {
|
|
@@ -1396,6 +1362,8 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1396
1362
|
initiatorUrl: this.target.inspectedURL(),
|
|
1397
1363
|
},
|
|
1398
1364
|
/* isBinary=*/ true);
|
|
1365
|
+
// Just loading the image, not building UI.
|
|
1366
|
+
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
1399
1367
|
const image = document.createElement('img');
|
|
1400
1368
|
const result = new Promise((resolve, reject) => {
|
|
1401
1369
|
image.onload = resolve;
|
|
@@ -1405,6 +1373,7 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
1405
1373
|
// does not work, we can parse mimeType out of the response headers
|
|
1406
1374
|
// using front_end/core/platform/MimeType.ts.
|
|
1407
1375
|
image.src = 'data:application/octet-stream;base64,' + await Common.Base64.encode(content);
|
|
1376
|
+
/* eslint-enable @devtools/no-imperative-dom-api */
|
|
1408
1377
|
try {
|
|
1409
1378
|
await result;
|
|
1410
1379
|
return {naturalWidth: image.naturalWidth, naturalHeight: image.naturalHeight, src: image.src};
|