File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed
demos/credential-management Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ <h1>Exciting Website</h1>
31
31
</ section >
32
32
< dialog >
33
33
< form >
34
- <!-- UGLY HACK: working around https://crbug.com/529272
34
+ < button > Sign in via Federation.com</ button >
35
+ < hr >
35
36
< label for ="username "> Username:</ label >
36
37
< input id ="username " type ="text " name ="username " autocomplete ="username "> </ input >
37
38
< label for ="password "> Password:</ label >
38
39
< input id ="password " type ="password " name ="password " autocomplete ="new-password "> </ input >
39
40
< input type ="submit ">
40
- -->
41
41
</ form >
42
42
</ dialog >
43
43
</ body >
Original file line number Diff line number Diff line change @@ -49,29 +49,18 @@ function processResponse(c) {
49
49
* if no credential is provided).
50
50
*/
51
51
document . querySelector ( '#signin' ) . addEventListener ( 'click' , function ( ) {
52
- var formHTML = '' +
53
- '<button>Sign in via Federation.com</button>' +
54
- '<hr>' +
55
- '<label for="username">Username:</label>' +
56
- '<input id="username" type="text" name="username" autocomplete="username"></input>' +
57
- '<label for="password">Password:</label>' +
58
- '<input id="password" type="password" name="password" autocomplete="new-password"></input>' +
59
- '<input type="submit">' ;
60
-
61
52
console . log ( "Clicked 'sign in!'" ) ;
62
53
if ( navigator . credentials ) {
63
54
navigator . credentials . get ( {
64
55
password : true
65
56
} ) . then ( function ( c ) {
66
57
processResponse ( c ) ;
67
58
if ( ! c ) {
68
- document . querySelector ( 'form' ) . innerHTML = formHTML ;
69
59
document . querySelector ( 'form button' ) . addEventListener ( 'click' , handleFederation ) ;
70
60
document . querySelector ( 'dialog' ) . showModal ( ) ;
71
61
}
72
62
} ) ;
73
63
} else {
74
- document . querySelector ( 'form' ) . innerHTML = formHTML ;
75
64
document . querySelector ( 'form button' ) . addEventListener ( 'click' , handleFederation ) ;
76
65
document . querySelector ( 'dialog' ) . showModal ( ) ;
77
66
}
You can’t perform that action at this time.
0 commit comments