Skip to content

Commit 0a4b42f

Browse files
committed
CREDENTIAL: Remove hack from demo.
1 parent 73e50e6 commit 0a4b42f

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

demos/credential-management/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ <h1>Exciting Website</h1>
3131
</section>
3232
<dialog>
3333
<form>
34-
<!-- UGLY HACK: working around https://crbug.com/529272
34+
<button>Sign in via Federation.com</button>
35+
<hr>
3536
<label for="username">Username:</label>
3637
<input id="username" type="text" name="username" autocomplete="username"></input>
3738
<label for="password">Password:</label>
3839
<input id="password" type="password" name="password" autocomplete="new-password"></input>
3940
<input type="submit">
40-
-->
4141
</form>
4242
</dialog>
4343
</body>

demos/credential-management/script.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,18 @@ function processResponse(c) {
4949
* if no credential is provided).
5050
*/
5151
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-
6152
console.log("Clicked 'sign in!'");
6253
if (navigator.credentials) {
6354
navigator.credentials.get({
6455
password: true
6556
}).then(function (c) {
6657
processResponse(c);
6758
if (!c) {
68-
document.querySelector('form').innerHTML = formHTML;
6959
document.querySelector('form button').addEventListener('click', handleFederation);
7060
document.querySelector('dialog').showModal();
7161
}
7262
});
7363
} else {
74-
document.querySelector('form').innerHTML = formHTML;
7564
document.querySelector('form button').addEventListener('click', handleFederation);
7665
document.querySelector('dialog').showModal();
7766
}

0 commit comments

Comments
 (0)