@@ -7,6 +7,7 @@ import '../../ui/legacy/legacy.js';
77import * as Common from '../../core/common/common.js' ;
88import * as Host from '../../core/host/host.js' ;
99import * as i18n from '../../core/i18n/i18n.js' ;
10+ import type * as Platform from '../../core/platform/platform.js' ;
1011import * as SDK from '../../core/sdk/sdk.js' ;
1112import * as Protocol from '../../generated/protocol.js' ;
1213import type * as Buttons from '../../ui/components/buttons/buttons.js' ;
@@ -64,13 +65,13 @@ const UIStrings = {
6465 */
6566 credentials : 'Credentials' ,
6667 /**
67- *@description Label for the learn more link that is shown before the virtual environment is enabled.
68+ *@description Text that shows before the virtual environment is enabled.
6869 */
69- useWebauthnForPhishingresistant : 'Use WebAuthn for phishing-resistant authentication ' ,
70+ noAuthenticator : 'No authenticator set up ' ,
7071 /**
71- *@description Text that is usually a hyperlink to more documentation
72+ *@description That that shows before virtual environment is enabled explaining the panel.
7273 */
73- learnMore : 'Learn more ' ,
74+ useWebauthnForPhishingresistant : 'Use WebAuthn for phishing-resistant authentication. ' ,
7475 /**
7576 *@description Title for section of interface that allows user to add a new virtual authenticator.
7677 */
@@ -151,6 +152,9 @@ const UIStrings = {
151152const str_ = i18n . i18n . registerUIStrings ( 'panels/webauthn/WebauthnPane.ts' , UIStrings ) ;
152153const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
153154
155+ const WEB_AUTHN_EXPLANATION_URL =
156+ 'https://developer.chrome.com/docs/devtools/webauthn' as Platform . DevToolsPath . UrlString ;
157+
154158const enum Events {
155159 EXPORT_CREDENTIAL = 'ExportCredential' ,
156160 REMOVE_CREDENTIAL = 'RemoveCredential' ,
@@ -249,7 +253,7 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
249253 #authenticatorsView: HTMLElement ;
250254 #topToolbarContainer: HTMLElement | undefined ;
251255 #topToolbar: UI . Toolbar . Toolbar | undefined ;
252- #learnMoreView: HTMLElement | undefined ;
256+ #learnMoreView: UI . EmptyWidget . EmptyWidget | undefined ;
253257 #newAuthenticatorSection: HTMLElement | undefined ;
254258 #newAuthenticatorForm: HTMLElement | undefined ;
255259 #protocolSelect: HTMLSelectElement | undefined ;
@@ -561,16 +565,11 @@ export class WebauthnPaneImpl extends UI.Widget.VBox implements
561565 }
562566
563567 #createNewAuthenticatorSection( ) : void {
564- const learnMoreLink = UI . XLink . XLink . create (
565- 'https://developers.google.com/web/updates/2018/05/webauthn' , i18nString ( UIStrings . learnMore ) , undefined ,
566- undefined , 'learn-more' ) ;
567- this . #learnMoreView = this . contentElement . createChild ( 'div' , 'learn-more' ) ;
568- this . #learnMoreView. appendChild ( UI . Fragment . html `
569- < div >
570- ${ i18nString ( UIStrings . useWebauthnForPhishingresistant ) } < br /> < br />
571- ${ learnMoreLink }
572- </ div >
573- ` ) ;
568+ this . #learnMoreView = new UI . EmptyWidget . EmptyWidget (
569+ i18nString ( UIStrings . noAuthenticator ) , i18nString ( UIStrings . useWebauthnForPhishingresistant ) ) ;
570+ this . #learnMoreView. element . classList . add ( 'learn-more' ) ;
571+ this . #learnMoreView. appendLink ( WEB_AUTHN_EXPLANATION_URL ) ;
572+ this . #learnMoreView. show ( this . contentElement ) ;
574573
575574 this . #newAuthenticatorSection = this . contentElement . createChild ( 'div' , 'new-authenticator-container' ) ;
576575 const newAuthenticatorTitle =
0 commit comments