Second draft

This commit is contained in:
varjolintu 2022-03-21 17:15:18 +02:00
parent 6f727f7408
commit 4a3eb6b84b
2 changed files with 18 additions and 1 deletions

View file

@ -843,3 +843,19 @@ browser.runtime.onMessage.addListener(async function(req, sender) {
}
}
});
// Webauthn
const webauthn = document.createElement('script');
webauthn.src = browser.runtime.getURL('content/webauthn.js');
document.documentElement.appendChild(webauthn);
window.addEventListener('message', (ev) => {
if (ev.data.action === 'webauthn-create') {
console.log('Request from: ', ev.origin);
// Send a test response after a delay
setInterval(() => {
window.postMessage({ action: 'webauthn-create-response' }, window.location.origin);
}, 2000);
}
});

View file

@ -136,7 +136,8 @@
"css/notification.css",
"css/pwgen.css",
"css/username.css",
"css/totp.css"
"css/totp.css",
"content/webauthn.js"
],
"permissions": [
"activeTab",