chrome-devtools-frontend 1.0.950850 → 1.0.952284
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/gni/devtools_grd_files.gni +3 -3
- package/extension-api/ExtensionAPI.d.ts +1 -1
- package/front_end/.eslintrc.js +6 -0
- package/front_end/Tests.js +10 -0
- package/front_end/core/common/App.ts +0 -3
- package/front_end/core/common/AppProvider.ts +0 -3
- package/front_end/core/common/JavaScriptMetaData.ts +0 -3
- package/front_end/core/common/QueryParamHandler.ts +0 -3
- package/front_end/core/common/Runnable.ts +0 -3
- package/front_end/core/common/SimpleHistoryManager.ts +0 -3
- package/front_end/core/i18n/locales/en-US.json +183 -183
- package/front_end/core/i18n/locales/en-XL.json +183 -183
- package/front_end/core/sdk/CSSRule.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +12 -37
- package/front_end/core/sdk/OverlayModel.ts +18 -34
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -12
- package/front_end/core/sdk/RuntimeModel.ts +0 -1
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/core/sdk/TracingManager.ts +0 -3
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +36 -36
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +53 -53
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +11 -11
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +43 -43
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +106 -105
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +26 -26
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +51 -56
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +201 -204
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +84 -83
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +16 -16
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +21 -21
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +30 -30
- package/front_end/entrypoints/main/MainImpl.ts +12 -12
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +33 -33
- package/front_end/entrypoints/node_app/NodeMain.ts +35 -35
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +16 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -3
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +1 -2
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -4
- package/front_end/models/bindings/FileUtils.ts +0 -4
- package/front_end/models/bindings/IgnoreListManager.ts +1 -2
- package/front_end/models/bindings/NetworkProject.ts +1 -2
- package/front_end/models/extensions/ExtensionAPI.ts +2 -2
- package/front_end/models/extensions/ExtensionTraceProvider.ts +0 -3
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
- package/front_end/models/issues_manager/CorsIssue.ts +9 -9
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
- package/front_end/models/issues_manager/GenericIssue.ts +5 -5
- package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
- package/front_end/models/issues_manager/Issue.ts +10 -10
- package/front_end/models/issues_manager/IssueResolver.ts +11 -10
- package/front_end/models/issues_manager/IssuesManager.ts +56 -56
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
- package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
- package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
- package/front_end/models/issues_manager/SameSiteCookieIssue.ts +17 -18
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
- package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
- package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
- package/front_end/models/timeline_model/TimelineModel.ts +1 -1
- package/front_end/models/timeline_model/TracingLayerTree.ts +0 -1
- package/front_end/panels/accessibility/ARIAMetadata.ts +0 -1
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +2 -2
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -2
- package/front_end/panels/animation/AnimationTimeline.ts +0 -1
- package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -4
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +0 -2
- package/front_end/panels/application/StorageView.ts +2 -6
- package/front_end/panels/application/{BackForwardCacheStrings.ts → components/BackForwardCacheStrings.ts} +2 -2
- package/front_end/panels/application/{BackForwardCacheView.ts → components/BackForwardCacheView.ts} +96 -62
- package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
- package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
- package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
- package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
- package/front_end/panels/application/components/ReportsGrid.ts +30 -30
- package/front_end/panels/application/components/StackTrace.ts +48 -47
- package/front_end/panels/application/components/TrustTokensView.ts +31 -31
- package/front_end/panels/application/{backForwardCacheView.css → components/backForwardCacheView.css} +9 -0
- package/front_end/panels/application/components/components.ts +2 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -25
- package/front_end/panels/console/consoleView.css +5 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
- package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
- package/front_end/panels/elements/ComputedStyleModel.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +2 -6
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
- package/front_end/panels/elements/components/AdornerManager.ts +21 -21
- package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
- package/front_end/panels/elements/components/CSSQuery.ts +16 -16
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
- package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
- package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
- package/front_end/panels/elements/components/LayoutPane.ts +47 -47
- package/front_end/panels/elements/components/NodeText.ts +18 -18
- package/front_end/panels/elements/components/QueryContainer.ts +40 -40
- package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
- package/front_end/panels/event_listeners/EventListenersUtils.ts +2 -1
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
- package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
- package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
- package/front_end/panels/issues/AffectedElementsView.ts +4 -4
- package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
- package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
- package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
- package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
- package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
- package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
- package/front_end/panels/issues/CSPViolationsView.ts +17 -17
- package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
- package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
- package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
- package/front_end/panels/issues/IssueAggregator.ts +95 -95
- package/front_end/panels/issues/IssueKindView.ts +14 -14
- package/front_end/panels/issues/IssueView.ts +98 -98
- package/front_end/panels/issues/IssuesPane.ts +102 -102
- package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
- package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
- package/front_end/panels/layer_viewer/Layers3DView.ts +3 -9
- package/front_end/panels/lighthouse/LighthouseController.ts +4 -5
- package/front_end/panels/media/PlayerListView.ts +160 -97
- package/front_end/panels/media/PlayerMessagesView.ts +1 -0
- package/front_end/panels/media/TickingFlameChart.ts +1 -2
- package/front_end/panels/media/playerListView.css +58 -0
- package/front_end/panels/network/NetworkLogView.ts +2 -6
- package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
- package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
- package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +6 -12
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +0 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -2
- package/front_end/panels/profiler/heapProfiler.css +1 -1
- package/front_end/panels/search/SearchConfig.ts +0 -6
- package/front_end/panels/security/SecurityModel.ts +2 -4
- package/front_end/panels/security/SecurityPanel.ts +2 -2
- package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -0
- package/front_end/panels/settings/components/SyncSection.ts +14 -14
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
- package/front_end/panels/settings/settingsScreen.css +8 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
- package/front_end/panels/sources/NavigatorView.ts +4 -10
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +2 -3
- package/front_end/panels/sources/SourceMapNamesResolver.ts +3 -3
- package/front_end/panels/sources/SourcesPanel.ts +1 -3
- package/front_end/panels/sources/SourcesView.ts +0 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -4
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -5
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +0 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -1
- package/front_end/panels/timeline/TimelineLoader.ts +0 -3
- package/front_end/panels/timeline/TimelinePanel.ts +2 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
- package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
- package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
- package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
- package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
- package/front_end/third_party/codemirror.next/bundle.ts +3 -3
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +10 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +2 -1
- package/front_end/third_party/codemirror.next/package.json +3 -3
- package/front_end/third_party/puppeteer/package/README.md +11 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api-docs-entry.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +9 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +21 -12
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EvalTypes.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +8 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +50 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +70 -33
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +12 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +25 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +2 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +39 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +36 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts +3 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts +46 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js +124 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +27 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +144 -74
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +5 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +43 -17
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js +101 -34
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +5 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +9 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +24 -17
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +8 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +7 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +50 -11
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +70 -34
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +12 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +26 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +2 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +39 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +38 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +3 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts +46 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js +120 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +27 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +144 -75
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +12 -14
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +5 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +3 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +10 -12
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +43 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +104 -40
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +5 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/web.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +173 -36
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/ui/components/adorners/Adorner.ts +2 -2
- package/front_end/ui/components/buttons/Button.ts +9 -9
- package/front_end/ui/components/data_grid/DataGrid.ts +62 -62
- package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
- package/front_end/ui/components/diff_view/DiffView.ts +6 -6
- package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
- package/front_end/ui/components/icon_button/Icon.ts +4 -4
- package/front_end/ui/components/icon_button/IconButton.ts +4 -4
- package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -5
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
- package/front_end/ui/components/report_view/ReportView.ts +16 -16
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
- package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
- package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
- package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -1
- package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
- package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
- package/front_end/ui/legacy/ContextFlavorListener.ts +0 -4
- package/front_end/ui/legacy/ContextMenu.ts +2 -3
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/front_end/ui/legacy/ReportView.ts +3 -4
- package/front_end/ui/legacy/SearchableView.ts +1 -2
- package/front_end/ui/legacy/SplitWidget.ts +2 -3
- package/front_end/ui/legacy/SuggestBox.ts +0 -3
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/XLink.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -9
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +7 -7
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +1 -5
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +0 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -2
- package/front_end/ui/legacy/themeColors.css +2 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +24 -1
- package/inspector_overlay/main.ts +16 -2
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
- package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
- package/scripts/migration/class-fields/migrate.js +2 -3
- package/scripts/migration/class-fields/migrate.sh +1 -3
- package/scripts/migration/class-fields/package.json +1 -1
|
@@ -229,27 +229,26 @@ const PROTOCOL_AUTHENTICATOR_VALUES: Protocol.EnumerableEnum<typeof Protocol.Web
|
|
|
229
229
|
|
|
230
230
|
export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
231
231
|
SDK.TargetManager.SDKModelObserver<SDK.WebAuthnModel.WebAuthnModel> {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
private isEnabling?: Promise<void>;
|
|
232
|
+
#activeAuthId: Protocol.WebAuthn.AuthenticatorId|null = null;
|
|
233
|
+
#hasBeenEnabled = false;
|
|
234
|
+
readonly #dataGrids = new Map<Protocol.WebAuthn.AuthenticatorId, DataGrid.DataGrid.DataGridImpl<DataGridNode>>();
|
|
235
|
+
#enableCheckbox!: UI.Toolbar.ToolbarCheckbox;
|
|
236
|
+
readonly #availableAuthenticatorSetting: Common.Settings.Setting<AvailableAuthenticatorOptions[]>;
|
|
237
|
+
#model?: SDK.WebAuthnModel.WebAuthnModel;
|
|
238
|
+
#authenticatorsView: HTMLElement;
|
|
239
|
+
#topToolbarContainer: HTMLElement|undefined;
|
|
240
|
+
#topToolbar: UI.Toolbar.Toolbar|undefined;
|
|
241
|
+
#learnMoreView: HTMLElement|undefined;
|
|
242
|
+
#newAuthenticatorSection: HTMLElement|undefined;
|
|
243
|
+
#newAuthenticatorForm: HTMLElement|undefined;
|
|
244
|
+
#protocolSelect: HTMLSelectElement|undefined;
|
|
245
|
+
#transportSelect: HTMLSelectElement|undefined;
|
|
246
|
+
#residentKeyCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;
|
|
247
|
+
#residentKeyCheckbox: HTMLInputElement|undefined;
|
|
248
|
+
#userVerificationCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;
|
|
249
|
+
#userVerificationCheckbox: HTMLInputElement|undefined;
|
|
250
|
+
#addAuthenticatorButton: HTMLButtonElement|undefined;
|
|
251
|
+
#isEnabling?: Promise<void>;
|
|
253
252
|
|
|
254
253
|
constructor() {
|
|
255
254
|
super(true);
|
|
@@ -257,14 +256,14 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
257
256
|
|
|
258
257
|
this.contentElement.classList.add('webauthn-pane');
|
|
259
258
|
|
|
260
|
-
this
|
|
259
|
+
this.#availableAuthenticatorSetting =
|
|
261
260
|
Common.Settings.Settings.instance().createSetting<AvailableAuthenticatorOptions[]>(
|
|
262
261
|
'webauthnAuthenticators', []);
|
|
263
262
|
|
|
264
|
-
this
|
|
265
|
-
this
|
|
266
|
-
this
|
|
267
|
-
this
|
|
263
|
+
this.#createToolbar();
|
|
264
|
+
this.#authenticatorsView = this.contentElement.createChild('div', 'authenticators-view');
|
|
265
|
+
this.#createNewAuthenticatorSection();
|
|
266
|
+
this.#updateVisibility(false);
|
|
268
267
|
}
|
|
269
268
|
|
|
270
269
|
static instance(opts = {forceNew: null}): WebauthnPaneImpl {
|
|
@@ -278,26 +277,26 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
278
277
|
|
|
279
278
|
modelAdded(model: SDK.WebAuthnModel.WebAuthnModel): void {
|
|
280
279
|
if (model.target() === SDK.TargetManager.TargetManager.instance().mainTarget()) {
|
|
281
|
-
this
|
|
280
|
+
this.#model = model;
|
|
282
281
|
}
|
|
283
282
|
}
|
|
284
283
|
|
|
285
284
|
modelRemoved(model: SDK.WebAuthnModel.WebAuthnModel): void {
|
|
286
285
|
if (model.target() === SDK.TargetManager.TargetManager.instance().mainTarget()) {
|
|
287
|
-
this
|
|
286
|
+
this.#model = undefined;
|
|
288
287
|
}
|
|
289
288
|
}
|
|
290
289
|
|
|
291
|
-
|
|
290
|
+
async #loadInitialAuthenticators(): Promise<void> {
|
|
292
291
|
let activeAuthenticatorId: Protocol.WebAuthn.AuthenticatorId|null = null;
|
|
293
|
-
const availableAuthenticators = this
|
|
292
|
+
const availableAuthenticators = this.#availableAuthenticatorSetting.get();
|
|
294
293
|
for (const options of availableAuthenticators) {
|
|
295
|
-
if (!this
|
|
294
|
+
if (!this.#model) {
|
|
296
295
|
continue;
|
|
297
296
|
}
|
|
298
297
|
|
|
299
|
-
const authenticatorId = await this
|
|
300
|
-
this
|
|
298
|
+
const authenticatorId = await this.#model.addAuthenticator(options);
|
|
299
|
+
this.#addAuthenticatorSection(authenticatorId, options);
|
|
301
300
|
// Update the authenticatorIds in the options.
|
|
302
301
|
options.authenticatorId = authenticatorId;
|
|
303
302
|
if (options.active) {
|
|
@@ -306,29 +305,29 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
306
305
|
}
|
|
307
306
|
|
|
308
307
|
// Update the settings to reflect the new authenticatorIds.
|
|
309
|
-
this
|
|
308
|
+
this.#availableAuthenticatorSetting.set(availableAuthenticators);
|
|
310
309
|
if (activeAuthenticatorId) {
|
|
311
|
-
this
|
|
310
|
+
this.#setActiveAuthenticator(activeAuthenticatorId);
|
|
312
311
|
}
|
|
313
312
|
}
|
|
314
313
|
|
|
315
314
|
async ownerViewDisposed(): Promise<void> {
|
|
316
|
-
if (this
|
|
317
|
-
this
|
|
315
|
+
if (this.#enableCheckbox) {
|
|
316
|
+
this.#enableCheckbox.setChecked(false);
|
|
318
317
|
}
|
|
319
|
-
await this
|
|
318
|
+
await this.#setVirtualAuthEnvEnabled(false);
|
|
320
319
|
}
|
|
321
320
|
|
|
322
|
-
|
|
323
|
-
this
|
|
324
|
-
this
|
|
321
|
+
#createToolbar(): void {
|
|
322
|
+
this.#topToolbarContainer = this.contentElement.createChild('div', 'webauthn-toolbar-container');
|
|
323
|
+
this.#topToolbar = new UI.Toolbar.Toolbar('webauthn-toolbar', this.#topToolbarContainer);
|
|
325
324
|
const enableCheckboxTitle = i18nString(UIStrings.enableVirtualAuthenticator);
|
|
326
|
-
this
|
|
327
|
-
new UI.Toolbar.ToolbarCheckbox(enableCheckboxTitle, enableCheckboxTitle, this
|
|
328
|
-
this
|
|
325
|
+
this.#enableCheckbox =
|
|
326
|
+
new UI.Toolbar.ToolbarCheckbox(enableCheckboxTitle, enableCheckboxTitle, this.#handleCheckboxToggle.bind(this));
|
|
327
|
+
this.#topToolbar.appendToolbarItem(this.#enableCheckbox);
|
|
329
328
|
}
|
|
330
329
|
|
|
331
|
-
|
|
330
|
+
#createCredentialsDataGrid(authenticatorId: Protocol.WebAuthn.AuthenticatorId):
|
|
332
331
|
DataGrid.DataGrid.DataGridImpl<DataGridNode> {
|
|
333
332
|
const columns = ([
|
|
334
333
|
{
|
|
@@ -368,33 +367,32 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
368
367
|
const dataGrid = new WebauthnDataGrid(dataGridConfig);
|
|
369
368
|
dataGrid.renderInline();
|
|
370
369
|
dataGrid.setStriped(true);
|
|
371
|
-
dataGrid.addEventListener(Events.ExportCredential, this
|
|
372
|
-
dataGrid.addEventListener(Events.RemoveCredential, this
|
|
370
|
+
dataGrid.addEventListener(Events.ExportCredential, this.#handleExportCredential, this);
|
|
371
|
+
dataGrid.addEventListener(Events.RemoveCredential, this.#handleRemoveCredential.bind(this, authenticatorId));
|
|
373
372
|
|
|
374
|
-
this
|
|
373
|
+
this.#dataGrids.set(authenticatorId, dataGrid);
|
|
375
374
|
|
|
376
375
|
return dataGrid;
|
|
377
376
|
}
|
|
378
377
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
this.exportCredential(credential);
|
|
378
|
+
#handleExportCredential({data: credential}: Common.EventTarget.EventTargetEvent<Protocol.WebAuthn.Credential>): void {
|
|
379
|
+
this.#exportCredential(credential);
|
|
382
380
|
}
|
|
383
381
|
|
|
384
|
-
|
|
382
|
+
#handleRemoveCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {
|
|
385
383
|
data: credential,
|
|
386
384
|
}: Common.EventTarget.EventTargetEvent<Protocol.WebAuthn.Credential>): void {
|
|
387
|
-
this
|
|
385
|
+
this.#removeCredential(authenticatorId, credential.credentialId);
|
|
388
386
|
}
|
|
389
387
|
|
|
390
|
-
|
|
391
|
-
const dataGrid = this
|
|
388
|
+
async #updateCredentials(authenticatorId: Protocol.WebAuthn.AuthenticatorId): Promise<void> {
|
|
389
|
+
const dataGrid = this.#dataGrids.get(authenticatorId);
|
|
392
390
|
if (!dataGrid) {
|
|
393
391
|
return;
|
|
394
392
|
}
|
|
395
393
|
|
|
396
|
-
if (this
|
|
397
|
-
const credentials = await this
|
|
394
|
+
if (this.#model) {
|
|
395
|
+
const credentials = await this.#model.getCredentials(authenticatorId);
|
|
398
396
|
|
|
399
397
|
dataGrid.rootNode().removeChildren();
|
|
400
398
|
for (const credential of credentials) {
|
|
@@ -402,14 +400,14 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
402
400
|
dataGrid.rootNode().appendChild(node);
|
|
403
401
|
}
|
|
404
402
|
|
|
405
|
-
this
|
|
403
|
+
this.#maybeAddEmptyNode(dataGrid);
|
|
406
404
|
}
|
|
407
405
|
|
|
408
406
|
// TODO(crbug.com/1112528): Add back-end events for credential creation and removal to avoid polling.
|
|
409
|
-
setTimeout(this
|
|
407
|
+
setTimeout(this.#updateCredentials.bind(this, authenticatorId), TIMEOUT);
|
|
410
408
|
}
|
|
411
409
|
|
|
412
|
-
|
|
410
|
+
#maybeAddEmptyNode(dataGrid: DataGrid.DataGrid.DataGridImpl<DataGridNode>): void {
|
|
413
411
|
if (dataGrid.rootNode().children.length) {
|
|
414
412
|
return;
|
|
415
413
|
}
|
|
@@ -418,73 +416,73 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
418
416
|
dataGrid.rootNode().appendChild(node);
|
|
419
417
|
}
|
|
420
418
|
|
|
421
|
-
|
|
422
|
-
await this
|
|
423
|
-
this
|
|
424
|
-
if (enable && !this
|
|
419
|
+
async #setVirtualAuthEnvEnabled(enable: boolean): Promise<void> {
|
|
420
|
+
await this.#isEnabling;
|
|
421
|
+
this.#isEnabling = new Promise<void>(async (resolve: (value: void) => void) => {
|
|
422
|
+
if (enable && !this.#hasBeenEnabled) {
|
|
425
423
|
// Ensures metric is only tracked once per session.
|
|
426
424
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.VirtualAuthenticatorEnvironmentEnabled);
|
|
427
|
-
this
|
|
425
|
+
this.#hasBeenEnabled = true;
|
|
428
426
|
}
|
|
429
|
-
if (this
|
|
430
|
-
await this
|
|
427
|
+
if (this.#model) {
|
|
428
|
+
await this.#model.setVirtualAuthEnvEnabled(enable);
|
|
431
429
|
}
|
|
432
430
|
|
|
433
431
|
if (enable) {
|
|
434
|
-
await this
|
|
432
|
+
await this.#loadInitialAuthenticators();
|
|
435
433
|
} else {
|
|
436
|
-
this
|
|
434
|
+
this.#removeAuthenticatorSections();
|
|
437
435
|
}
|
|
438
436
|
|
|
439
|
-
this
|
|
440
|
-
this
|
|
437
|
+
this.#updateVisibility(enable);
|
|
438
|
+
this.#isEnabling = undefined;
|
|
441
439
|
resolve();
|
|
442
440
|
});
|
|
443
441
|
}
|
|
444
442
|
|
|
445
|
-
|
|
443
|
+
#updateVisibility(enabled: boolean): void {
|
|
446
444
|
this.contentElement.classList.toggle('enabled', enabled);
|
|
447
445
|
}
|
|
448
446
|
|
|
449
|
-
|
|
450
|
-
this
|
|
451
|
-
this
|
|
447
|
+
#removeAuthenticatorSections(): void {
|
|
448
|
+
this.#authenticatorsView.innerHTML = '';
|
|
449
|
+
this.#dataGrids.clear();
|
|
452
450
|
}
|
|
453
451
|
|
|
454
|
-
|
|
455
|
-
this
|
|
452
|
+
#handleCheckboxToggle(e: MouseEvent): void {
|
|
453
|
+
this.#setVirtualAuthEnvEnabled((e.target as HTMLInputElement).checked);
|
|
456
454
|
}
|
|
457
455
|
|
|
458
|
-
|
|
459
|
-
if (!this
|
|
456
|
+
#updateEnabledTransportOptions(enabledOptions: Protocol.WebAuthn.AuthenticatorTransport[]): void {
|
|
457
|
+
if (!this.#transportSelect) {
|
|
460
458
|
return;
|
|
461
459
|
}
|
|
462
460
|
|
|
463
|
-
const prevValue = this
|
|
464
|
-
this
|
|
461
|
+
const prevValue = this.#transportSelect.value;
|
|
462
|
+
this.#transportSelect.removeChildren();
|
|
465
463
|
|
|
466
464
|
for (const option of enabledOptions) {
|
|
467
|
-
this
|
|
465
|
+
this.#transportSelect.appendChild(new Option(option, option));
|
|
468
466
|
}
|
|
469
467
|
|
|
470
468
|
// Make sure the currently selected value stays the same.
|
|
471
|
-
this
|
|
469
|
+
this.#transportSelect.value = prevValue;
|
|
472
470
|
// If the new set does not include the previous value.
|
|
473
|
-
if (!this
|
|
471
|
+
if (!this.#transportSelect.value) {
|
|
474
472
|
// Select the first available value.
|
|
475
|
-
this
|
|
473
|
+
this.#transportSelect.selectedIndex = 0;
|
|
476
474
|
}
|
|
477
475
|
}
|
|
478
476
|
|
|
479
|
-
|
|
480
|
-
if (!this
|
|
477
|
+
#updateNewAuthenticatorSectionOptions(): void {
|
|
478
|
+
if (!this.#protocolSelect || !this.#residentKeyCheckbox || !this.#userVerificationCheckbox) {
|
|
481
479
|
return;
|
|
482
480
|
}
|
|
483
481
|
|
|
484
|
-
if (this
|
|
485
|
-
this
|
|
486
|
-
this
|
|
487
|
-
this
|
|
482
|
+
if (this.#protocolSelect.value === Protocol.WebAuthn.AuthenticatorProtocol.Ctap2) {
|
|
483
|
+
this.#residentKeyCheckbox.disabled = false;
|
|
484
|
+
this.#userVerificationCheckbox.disabled = false;
|
|
485
|
+
this.#updateEnabledTransportOptions([
|
|
488
486
|
Protocol.WebAuthn.AuthenticatorTransport.Usb,
|
|
489
487
|
Protocol.WebAuthn.AuthenticatorTransport.Ble,
|
|
490
488
|
Protocol.WebAuthn.AuthenticatorTransport.Nfc,
|
|
@@ -493,11 +491,11 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
493
491
|
Protocol.WebAuthn.AuthenticatorTransport.Internal,
|
|
494
492
|
]);
|
|
495
493
|
} else {
|
|
496
|
-
this
|
|
497
|
-
this
|
|
498
|
-
this
|
|
499
|
-
this
|
|
500
|
-
this
|
|
494
|
+
this.#residentKeyCheckbox.checked = false;
|
|
495
|
+
this.#residentKeyCheckbox.disabled = true;
|
|
496
|
+
this.#userVerificationCheckbox.checked = false;
|
|
497
|
+
this.#userVerificationCheckbox.disabled = true;
|
|
498
|
+
this.#updateEnabledTransportOptions([
|
|
501
499
|
Protocol.WebAuthn.AuthenticatorTransport.Usb,
|
|
502
500
|
Protocol.WebAuthn.AuthenticatorTransport.Ble,
|
|
503
501
|
Protocol.WebAuthn.AuthenticatorTransport.Nfc,
|
|
@@ -505,9 +503,9 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
505
503
|
}
|
|
506
504
|
}
|
|
507
505
|
|
|
508
|
-
|
|
509
|
-
this
|
|
510
|
-
this
|
|
506
|
+
#createNewAuthenticatorSection(): void {
|
|
507
|
+
this.#learnMoreView = this.contentElement.createChild('div', 'learn-more');
|
|
508
|
+
this.#learnMoreView.appendChild(UI.Fragment.html`
|
|
511
509
|
<div>
|
|
512
510
|
${i18nString(UIStrings.useWebauthnForPhishingresistant)}<br /><br />
|
|
513
511
|
${
|
|
@@ -516,108 +514,108 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
516
514
|
</div>
|
|
517
515
|
`);
|
|
518
516
|
|
|
519
|
-
this
|
|
517
|
+
this.#newAuthenticatorSection = this.contentElement.createChild('div', 'new-authenticator-container');
|
|
520
518
|
const newAuthenticatorTitle =
|
|
521
519
|
UI.UIUtils.createLabel(i18nString(UIStrings.newAuthenticator), 'new-authenticator-title');
|
|
522
|
-
this
|
|
523
|
-
this
|
|
520
|
+
this.#newAuthenticatorSection.appendChild(newAuthenticatorTitle);
|
|
521
|
+
this.#newAuthenticatorForm = this.#newAuthenticatorSection.createChild('div', 'new-authenticator-form');
|
|
524
522
|
|
|
525
|
-
const protocolGroup = this
|
|
526
|
-
const transportGroup = this
|
|
527
|
-
const residentKeyGroup = this
|
|
528
|
-
const userVerificationGroup = this
|
|
529
|
-
const addButtonGroup = this
|
|
523
|
+
const protocolGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');
|
|
524
|
+
const transportGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');
|
|
525
|
+
const residentKeyGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');
|
|
526
|
+
const userVerificationGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');
|
|
527
|
+
const addButtonGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');
|
|
530
528
|
|
|
531
529
|
const protocolSelectTitle = UI.UIUtils.createLabel(i18nString(UIStrings.protocol), 'authenticator-option-label');
|
|
532
530
|
protocolGroup.appendChild(protocolSelectTitle);
|
|
533
|
-
this
|
|
534
|
-
UI.ARIAUtils.bindLabelToControl(protocolSelectTitle, (this
|
|
531
|
+
this.#protocolSelect = (protocolGroup.createChild('select', 'chrome-select') as HTMLSelectElement);
|
|
532
|
+
UI.ARIAUtils.bindLabelToControl(protocolSelectTitle, (this.#protocolSelect as Element));
|
|
535
533
|
Object.values(PROTOCOL_AUTHENTICATOR_VALUES)
|
|
536
534
|
.sort()
|
|
537
535
|
.forEach((option: Protocol.WebAuthn.AuthenticatorProtocol): void => {
|
|
538
|
-
if (this
|
|
539
|
-
this
|
|
536
|
+
if (this.#protocolSelect) {
|
|
537
|
+
this.#protocolSelect.appendChild(new Option(option, option));
|
|
540
538
|
}
|
|
541
539
|
});
|
|
542
540
|
|
|
543
|
-
if (this
|
|
544
|
-
this
|
|
541
|
+
if (this.#protocolSelect) {
|
|
542
|
+
this.#protocolSelect.value = Protocol.WebAuthn.AuthenticatorProtocol.Ctap2;
|
|
545
543
|
}
|
|
546
544
|
|
|
547
545
|
const transportSelectTitle = UI.UIUtils.createLabel(i18nString(UIStrings.transport), 'authenticator-option-label');
|
|
548
546
|
transportGroup.appendChild(transportSelectTitle);
|
|
549
|
-
this
|
|
550
|
-
UI.ARIAUtils.bindLabelToControl(transportSelectTitle, (this
|
|
547
|
+
this.#transportSelect = (transportGroup.createChild('select', 'chrome-select') as HTMLSelectElement);
|
|
548
|
+
UI.ARIAUtils.bindLabelToControl(transportSelectTitle, (this.#transportSelect as Element));
|
|
551
549
|
// transportSelect will be populated in updateNewAuthenticatorSectionOptions.
|
|
552
550
|
|
|
553
|
-
this
|
|
554
|
-
this
|
|
555
|
-
residentKeyGroup.appendChild(this
|
|
556
|
-
this
|
|
557
|
-
this
|
|
558
|
-
this
|
|
559
|
-
residentKeyGroup.appendChild(this
|
|
560
|
-
|
|
561
|
-
this
|
|
562
|
-
this
|
|
563
|
-
userVerificationGroup.appendChild(this
|
|
564
|
-
this
|
|
565
|
-
this
|
|
566
|
-
this
|
|
567
|
-
userVerificationGroup.appendChild(this
|
|
568
|
-
|
|
569
|
-
this
|
|
570
|
-
UI.UIUtils.createTextButton(i18nString(UIStrings.add), this
|
|
551
|
+
this.#residentKeyCheckboxLabel = UI.UIUtils.CheckboxLabel.create(i18nString(UIStrings.supportsResidentKeys), false);
|
|
552
|
+
this.#residentKeyCheckboxLabel.textElement.classList.add('authenticator-option-label');
|
|
553
|
+
residentKeyGroup.appendChild(this.#residentKeyCheckboxLabel.textElement);
|
|
554
|
+
this.#residentKeyCheckbox = this.#residentKeyCheckboxLabel.checkboxElement;
|
|
555
|
+
this.#residentKeyCheckbox.checked = false;
|
|
556
|
+
this.#residentKeyCheckbox.classList.add('authenticator-option-checkbox');
|
|
557
|
+
residentKeyGroup.appendChild(this.#residentKeyCheckboxLabel);
|
|
558
|
+
|
|
559
|
+
this.#userVerificationCheckboxLabel = UI.UIUtils.CheckboxLabel.create('Supports user verification', false);
|
|
560
|
+
this.#userVerificationCheckboxLabel.textElement.classList.add('authenticator-option-label');
|
|
561
|
+
userVerificationGroup.appendChild(this.#userVerificationCheckboxLabel.textElement);
|
|
562
|
+
this.#userVerificationCheckbox = this.#userVerificationCheckboxLabel.checkboxElement;
|
|
563
|
+
this.#userVerificationCheckbox.checked = false;
|
|
564
|
+
this.#userVerificationCheckbox.classList.add('authenticator-option-checkbox');
|
|
565
|
+
userVerificationGroup.appendChild(this.#userVerificationCheckboxLabel);
|
|
566
|
+
|
|
567
|
+
this.#addAuthenticatorButton =
|
|
568
|
+
UI.UIUtils.createTextButton(i18nString(UIStrings.add), this.#handleAddAuthenticatorButton.bind(this), '');
|
|
571
569
|
addButtonGroup.createChild('div', 'authenticator-option-label');
|
|
572
|
-
addButtonGroup.appendChild(this
|
|
570
|
+
addButtonGroup.appendChild(this.#addAuthenticatorButton);
|
|
573
571
|
const addAuthenticatorTitle = UI.UIUtils.createLabel(i18nString(UIStrings.addAuthenticator), '');
|
|
574
|
-
UI.ARIAUtils.bindLabelToControl(addAuthenticatorTitle, this
|
|
572
|
+
UI.ARIAUtils.bindLabelToControl(addAuthenticatorTitle, this.#addAuthenticatorButton);
|
|
575
573
|
|
|
576
|
-
this
|
|
577
|
-
if (this
|
|
578
|
-
this
|
|
574
|
+
this.#updateNewAuthenticatorSectionOptions();
|
|
575
|
+
if (this.#protocolSelect) {
|
|
576
|
+
this.#protocolSelect.addEventListener('change', this.#updateNewAuthenticatorSectionOptions.bind(this));
|
|
579
577
|
}
|
|
580
578
|
}
|
|
581
579
|
|
|
582
|
-
|
|
583
|
-
const options = this
|
|
584
|
-
if (this
|
|
585
|
-
const authenticatorId = await this
|
|
586
|
-
const availableAuthenticators = this
|
|
580
|
+
async #handleAddAuthenticatorButton(): Promise<void> {
|
|
581
|
+
const options = this.#createOptionsFromCurrentInputs();
|
|
582
|
+
if (this.#model) {
|
|
583
|
+
const authenticatorId = await this.#model.addAuthenticator(options);
|
|
584
|
+
const availableAuthenticators = this.#availableAuthenticatorSetting.get();
|
|
587
585
|
availableAuthenticators.push({authenticatorId, active: true, ...options});
|
|
588
|
-
this
|
|
586
|
+
this.#availableAuthenticatorSetting.set(
|
|
589
587
|
availableAuthenticators.map(a => ({...a, active: a.authenticatorId === authenticatorId})));
|
|
590
|
-
const section = await this
|
|
588
|
+
const section = await this.#addAuthenticatorSection(authenticatorId, options);
|
|
591
589
|
const mediaQueryList = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
592
590
|
const prefersReducedMotion = mediaQueryList.matches;
|
|
593
591
|
section.scrollIntoView({block: 'start', behavior: prefersReducedMotion ? 'auto' : 'smooth'});
|
|
594
592
|
}
|
|
595
593
|
}
|
|
596
594
|
|
|
597
|
-
|
|
595
|
+
async #addAuthenticatorSection(
|
|
598
596
|
authenticatorId: Protocol.WebAuthn.AuthenticatorId,
|
|
599
597
|
options: Protocol.WebAuthn.VirtualAuthenticatorOptions): Promise<HTMLDivElement> {
|
|
600
598
|
const section = document.createElement('div');
|
|
601
599
|
section.classList.add('authenticator-section');
|
|
602
600
|
section.setAttribute('data-authenticator-id', authenticatorId);
|
|
603
|
-
this
|
|
601
|
+
this.#authenticatorsView.appendChild(section);
|
|
604
602
|
|
|
605
603
|
const headerElement = section.createChild('div', 'authenticator-section-header');
|
|
606
604
|
const titleElement = headerElement.createChild('div', 'authenticator-section-title');
|
|
607
605
|
UI.ARIAUtils.markAsHeading(titleElement, 2);
|
|
608
606
|
|
|
609
|
-
await this
|
|
607
|
+
await this.#clearActiveAuthenticator();
|
|
610
608
|
const activeButtonContainer = headerElement.createChild('div', 'active-button-container');
|
|
611
609
|
const activeLabel =
|
|
612
610
|
UI.UIUtils.createRadioLabel(`active-authenticator-${authenticatorId}`, i18nString(UIStrings.active));
|
|
613
|
-
activeLabel.radioElement.addEventListener('click', this
|
|
611
|
+
activeLabel.radioElement.addEventListener('click', this.#setActiveAuthenticator.bind(this, authenticatorId));
|
|
614
612
|
activeButtonContainer.appendChild(activeLabel);
|
|
615
613
|
(activeLabel.radioElement as HTMLInputElement).checked = true;
|
|
616
|
-
this
|
|
614
|
+
this.#activeAuthId = authenticatorId; // Newly added authenticator is automatically set as active.
|
|
617
615
|
|
|
618
616
|
const removeButton = headerElement.createChild('button', 'text-button');
|
|
619
617
|
removeButton.textContent = i18nString(UIStrings.remove);
|
|
620
|
-
removeButton.addEventListener('click', this
|
|
618
|
+
removeButton.addEventListener('click', this.#removeAuthenticator.bind(this, authenticatorId));
|
|
621
619
|
|
|
622
620
|
const toolbar = new UI.Toolbar.Toolbar('edit-name-toolbar', titleElement);
|
|
623
621
|
const editName = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.editName), 'largeicon-edit');
|
|
@@ -628,42 +626,42 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
628
626
|
nameField.disabled = true;
|
|
629
627
|
const userFriendlyName = authenticatorId.slice(-5); // User friendly name defaults to last 5 chars of UUID.
|
|
630
628
|
nameField.value = i18nString(UIStrings.authenticatorS, {PH1: userFriendlyName});
|
|
631
|
-
this
|
|
629
|
+
this.#updateActiveLabelTitle(activeLabel, nameField.value);
|
|
632
630
|
|
|
633
631
|
editName.addEventListener(
|
|
634
632
|
UI.Toolbar.ToolbarButton.Events.Click,
|
|
635
|
-
(): void => this
|
|
633
|
+
(): void => this.#handleEditNameButton(titleElement, nameField, editName, saveName));
|
|
636
634
|
saveName.addEventListener(
|
|
637
635
|
UI.Toolbar.ToolbarButton.Events.Click,
|
|
638
|
-
(): void => this
|
|
636
|
+
(): void => this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel));
|
|
639
637
|
|
|
640
638
|
nameField.addEventListener(
|
|
641
|
-
'focusout', (): void => this
|
|
639
|
+
'focusout', (): void => this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel));
|
|
642
640
|
nameField.addEventListener('keydown', (event: KeyboardEvent): void => {
|
|
643
641
|
if (event.key === 'Enter') {
|
|
644
|
-
this
|
|
642
|
+
this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel);
|
|
645
643
|
}
|
|
646
644
|
});
|
|
647
645
|
|
|
648
646
|
toolbar.appendToolbarItem(editName);
|
|
649
647
|
toolbar.appendToolbarItem(saveName);
|
|
650
648
|
|
|
651
|
-
this
|
|
649
|
+
this.#createAuthenticatorFields(section, authenticatorId, options);
|
|
652
650
|
|
|
653
651
|
const label = document.createElement('div');
|
|
654
652
|
label.classList.add('credentials-title');
|
|
655
653
|
label.textContent = i18nString(UIStrings.credentials);
|
|
656
654
|
section.appendChild(label);
|
|
657
655
|
|
|
658
|
-
const dataGrid = this
|
|
656
|
+
const dataGrid = this.#createCredentialsDataGrid(authenticatorId);
|
|
659
657
|
dataGrid.asWidget().show(section);
|
|
660
658
|
|
|
661
|
-
this
|
|
659
|
+
this.#updateCredentials(authenticatorId);
|
|
662
660
|
|
|
663
661
|
return section;
|
|
664
662
|
}
|
|
665
663
|
|
|
666
|
-
|
|
664
|
+
#exportCredential(credential: Protocol.WebAuthn.Credential): void {
|
|
667
665
|
let pem = PRIVATE_KEY_HEADER;
|
|
668
666
|
for (let i = 0; i < credential.privateKey.length; i += 64) {
|
|
669
667
|
pem += credential.privateKey.substring(i, i + 64) + '\n';
|
|
@@ -676,9 +674,8 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
676
674
|
link.click();
|
|
677
675
|
}
|
|
678
676
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
const dataGrid = this.dataGrids.get(authenticatorId);
|
|
677
|
+
async #removeCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, credentialId: string): Promise<void> {
|
|
678
|
+
const dataGrid = this.#dataGrids.get(authenticatorId);
|
|
682
679
|
if (!dataGrid) {
|
|
683
680
|
return;
|
|
684
681
|
}
|
|
@@ -688,17 +685,17 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
688
685
|
.children
|
|
689
686
|
.find((n: DataGrid.DataGrid.DataGridNode<DataGridNode>): boolean => n.data.credentialId === credentialId)
|
|
690
687
|
.remove();
|
|
691
|
-
this
|
|
688
|
+
this.#maybeAddEmptyNode(dataGrid);
|
|
692
689
|
|
|
693
|
-
if (this
|
|
694
|
-
await this
|
|
690
|
+
if (this.#model) {
|
|
691
|
+
await this.#model.removeCredential(authenticatorId, credentialId);
|
|
695
692
|
}
|
|
696
693
|
}
|
|
697
694
|
|
|
698
695
|
/**
|
|
699
696
|
* Creates the fields describing the authenticator in the front end.
|
|
700
697
|
*/
|
|
701
|
-
|
|
698
|
+
#createAuthenticatorFields(
|
|
702
699
|
section: Element, authenticatorId: string, options: Protocol.WebAuthn.VirtualAuthenticatorOptions): void {
|
|
703
700
|
const sectionFields = section.createChild('div', 'authenticator-fields');
|
|
704
701
|
const uuidField = sectionFields.createChild('div', 'authenticator-field');
|
|
@@ -724,7 +721,7 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
724
721
|
options.hasUserVerification ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);
|
|
725
722
|
}
|
|
726
723
|
|
|
727
|
-
|
|
724
|
+
#handleEditNameButton(
|
|
728
725
|
titleElement: Element, nameField: HTMLInputElement, editName: UI.Toolbar.ToolbarButton,
|
|
729
726
|
saveName: UI.Toolbar.ToolbarButton): void {
|
|
730
727
|
nameField.disabled = false;
|
|
@@ -734,17 +731,17 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
734
731
|
editName.setVisible(false);
|
|
735
732
|
}
|
|
736
733
|
|
|
737
|
-
|
|
734
|
+
#handleSaveNameButton(
|
|
738
735
|
titleElement: Element, nameField: HTMLInputElement, editName: UI.Toolbar.ToolbarItem,
|
|
739
736
|
saveName: UI.Toolbar.ToolbarItem, activeLabel: UI.UIUtils.DevToolsRadioButton): void {
|
|
740
737
|
nameField.disabled = true;
|
|
741
738
|
titleElement.classList.remove('editing-name');
|
|
742
739
|
editName.setVisible(true);
|
|
743
740
|
saveName.setVisible(false);
|
|
744
|
-
this
|
|
741
|
+
this.#updateActiveLabelTitle(activeLabel, nameField.value);
|
|
745
742
|
}
|
|
746
743
|
|
|
747
|
-
|
|
744
|
+
#updateActiveLabelTitle(activeLabel: UI.UIUtils.DevToolsRadioButton, authenticatorName: string): void {
|
|
748
745
|
UI.Tooltip.Tooltip.install(
|
|
749
746
|
activeLabel.radioElement, i18nString(UIStrings.setSAsTheActiveAuthenticator, {PH1: authenticatorName}));
|
|
750
747
|
}
|
|
@@ -752,47 +749,48 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
752
749
|
/**
|
|
753
750
|
* Removes both the authenticator and its respective UI element.
|
|
754
751
|
*/
|
|
755
|
-
|
|
756
|
-
if (this
|
|
757
|
-
const child = this
|
|
752
|
+
#removeAuthenticator(authenticatorId: Protocol.WebAuthn.AuthenticatorId): void {
|
|
753
|
+
if (this.#authenticatorsView) {
|
|
754
|
+
const child = this.#authenticatorsView.querySelector(`[data-authenticator-id=${CSS.escape(authenticatorId)}]`);
|
|
758
755
|
if (child) {
|
|
759
756
|
child.remove();
|
|
760
757
|
}
|
|
761
758
|
}
|
|
762
|
-
this
|
|
759
|
+
this.#dataGrids.delete(authenticatorId);
|
|
763
760
|
|
|
764
|
-
if (this
|
|
765
|
-
this
|
|
761
|
+
if (this.#model) {
|
|
762
|
+
this.#model.removeAuthenticator(authenticatorId);
|
|
766
763
|
}
|
|
767
764
|
|
|
768
765
|
// Update available authenticator setting.
|
|
769
|
-
const prevAvailableAuthenticators = this
|
|
766
|
+
const prevAvailableAuthenticators = this.#availableAuthenticatorSetting.get();
|
|
770
767
|
const newAvailableAuthenticators = prevAvailableAuthenticators.filter(a => a.authenticatorId !== authenticatorId);
|
|
771
|
-
this
|
|
768
|
+
this.#availableAuthenticatorSetting.set(newAvailableAuthenticators);
|
|
772
769
|
|
|
773
|
-
if (this
|
|
774
|
-
const availableAuthenticatorIds = Array.from(this
|
|
770
|
+
if (this.#activeAuthId === authenticatorId) {
|
|
771
|
+
const availableAuthenticatorIds = Array.from(this.#dataGrids.keys());
|
|
775
772
|
if (availableAuthenticatorIds.length) {
|
|
776
|
-
this
|
|
773
|
+
this.#setActiveAuthenticator(availableAuthenticatorIds[0]);
|
|
777
774
|
} else {
|
|
778
|
-
this
|
|
775
|
+
this.#activeAuthId = null;
|
|
779
776
|
}
|
|
780
777
|
}
|
|
781
778
|
}
|
|
782
779
|
|
|
783
|
-
|
|
780
|
+
#createOptionsFromCurrentInputs(): Protocol.WebAuthn.VirtualAuthenticatorOptions {
|
|
784
781
|
// TODO(crbug.com/1034663): Add optionality for isUserVerified param.
|
|
785
|
-
if (!this
|
|
782
|
+
if (!this.#protocolSelect || !this.#transportSelect || !this.#residentKeyCheckbox ||
|
|
783
|
+
!this.#userVerificationCheckbox) {
|
|
786
784
|
throw new Error('Unable to create options from current inputs');
|
|
787
785
|
}
|
|
788
786
|
|
|
789
787
|
return {
|
|
790
|
-
protocol: this
|
|
788
|
+
protocol: this.#protocolSelect.options[this.#protocolSelect.selectedIndex].value as
|
|
791
789
|
Protocol.WebAuthn.AuthenticatorProtocol,
|
|
792
|
-
transport: this
|
|
790
|
+
transport: this.#transportSelect.options[this.#transportSelect.selectedIndex].value as
|
|
793
791
|
Protocol.WebAuthn.AuthenticatorTransport,
|
|
794
|
-
hasResidentKey: this
|
|
795
|
-
hasUserVerification: this
|
|
792
|
+
hasResidentKey: this.#residentKeyCheckbox.checked,
|
|
793
|
+
hasUserVerification: this.#userVerificationCheckbox.checked,
|
|
796
794
|
automaticPresenceSimulation: true,
|
|
797
795
|
isUserVerified: true,
|
|
798
796
|
};
|
|
@@ -802,38 +800,38 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
|
|
|
802
800
|
* Sets the given authenticator as active.
|
|
803
801
|
* Note that a newly added authenticator will automatically be set as active.
|
|
804
802
|
*/
|
|
805
|
-
|
|
806
|
-
await this
|
|
807
|
-
if (this
|
|
808
|
-
await this
|
|
803
|
+
async #setActiveAuthenticator(authenticatorId: Protocol.WebAuthn.AuthenticatorId): Promise<void> {
|
|
804
|
+
await this.#clearActiveAuthenticator();
|
|
805
|
+
if (this.#model) {
|
|
806
|
+
await this.#model.setAutomaticPresenceSimulation(authenticatorId, true);
|
|
809
807
|
}
|
|
810
|
-
this
|
|
808
|
+
this.#activeAuthId = authenticatorId;
|
|
811
809
|
|
|
812
|
-
const prevAvailableAuthenticators = this
|
|
810
|
+
const prevAvailableAuthenticators = this.#availableAuthenticatorSetting.get();
|
|
813
811
|
const newAvailableAuthenticators =
|
|
814
812
|
prevAvailableAuthenticators.map(a => ({...a, active: a.authenticatorId === authenticatorId}));
|
|
815
|
-
this
|
|
813
|
+
this.#availableAuthenticatorSetting.set(newAvailableAuthenticators);
|
|
816
814
|
|
|
817
|
-
this
|
|
815
|
+
this.#updateActiveButtons();
|
|
818
816
|
}
|
|
819
817
|
|
|
820
|
-
|
|
821
|
-
const authenticators = this
|
|
818
|
+
#updateActiveButtons(): void {
|
|
819
|
+
const authenticators = this.#authenticatorsView.getElementsByClassName('authenticator-section');
|
|
822
820
|
Array.from(authenticators).forEach((authenticator: Element): void => {
|
|
823
821
|
const button = (authenticator.querySelector('input.dt-radio-button') as HTMLInputElement);
|
|
824
822
|
if (!button) {
|
|
825
823
|
return;
|
|
826
824
|
}
|
|
827
|
-
button.checked = (authenticator as HTMLElement).dataset.authenticatorId === this
|
|
825
|
+
button.checked = (authenticator as HTMLElement).dataset.authenticatorId === this.#activeAuthId;
|
|
828
826
|
});
|
|
829
827
|
}
|
|
830
828
|
|
|
831
|
-
|
|
832
|
-
if (this
|
|
833
|
-
await this
|
|
829
|
+
async #clearActiveAuthenticator(): Promise<void> {
|
|
830
|
+
if (this.#activeAuthId && this.#model) {
|
|
831
|
+
await this.#model.setAutomaticPresenceSimulation(this.#activeAuthId, false);
|
|
834
832
|
}
|
|
835
|
-
this
|
|
836
|
-
this
|
|
833
|
+
this.#activeAuthId = null;
|
|
834
|
+
this.#updateActiveButtons();
|
|
837
835
|
}
|
|
838
836
|
wasShown(): void {
|
|
839
837
|
super.wasShown();
|