<input type="text" id="input">
<script>
    if (window.internals)
        internals.withUserGesture(() => { input.focus(); });

    const options = {
        publicKey: {
            rp: {
                name: "localhost",
            },
            user: {
                name: "John Appleseed",
                id: new Uint8Array(16),
                displayName: "Appleseed",
            },
            challenge: new Uint8Array(16),
            pubKeyCredParams: [{ type: "public-key", alg: -7 }],
            timeout: 100,
        }
    };

    navigator.credentials.create(options).then(credential => {
        window.webkit.messageHandlers.testHandler.postMessage("Succeeded!");
    }, error => {
        // The first call will consume the freebie, the second will give the no user gesture error.
        navigator.credentials.create(options).then(credential => {
            window.webkit.messageHandlers.testHandler.postMessage("Succeeded!");
        }, error => {
            window.webkit.messageHandlers.testHandler.postMessage(error.message);
        });
        window.webkit.messageHandlers.testHandler.postMessage(error.message);
    });
</script>
