mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
First draft
This commit is contained in:
parent
cc343440bc
commit
6f727f7408
1 changed files with 30 additions and 0 deletions
30
keepassxc-browser/content/webauthn.js
Normal file
30
keepassxc-browser/content/webauthn.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
(async () => {
|
||||
|
||||
|
||||
const webauthnCredentials = {
|
||||
async create(options) {
|
||||
console.log('Overridden create');
|
||||
|
||||
//await browser.runtime.sendMessage({ action: 'request_autotype', args: [ window.location.hostname ] });
|
||||
window.postMessage({ action: 'webauthn-create' }, window.location.origin);
|
||||
await waitForCreateResponse();
|
||||
},
|
||||
async get(options) {
|
||||
console.log('Overridden get');
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
Object.assign(navigator.credentials, webauthnCredentials);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
window.addEventListener('message', (ev) => {
|
||||
if (ev.data.action === 'webauthn-create-response') {
|
||||
console.log('Response received!');
|
||||
}
|
||||
});
|
||||
})();
|
||||
Loading…
Reference in a new issue