Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 44 additions & 22 deletions extension/authenticator.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,58 @@
<meta charset="UTF-8">
<title>WebAuthnLinux Authenticator</title>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
padding: 20px;
text-align: center;
}

.status {
margin: 20px 0;
font-weight: bold;
}

.error {
color: red;
}
body {
width: 300px;
margin: 0;
padding: 16px;
font-family: system-ui, sans-serif;
text-align: center;
background: #fff;
}
.icon {
width: 48px;
height: 48px;
margin: 0 auto 10px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background: #eef3ff;
}
.icon svg { width: 26px; height: 26px; }
.icon.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(66,133,244,0.35); }
50% { box-shadow: 0 0 0 8px rgba(66,133,244,0); }
}
h1 { font-size: 14px; margin: 0 0 4px; font-weight: 600; }
p#status { font-size: 12px; color: #555; margin: 0 0 12px; min-height: 16px; }
p#status.error { color: #c5221f; }
button {
display: none;
width: 100%;
padding: 8px;
border: none;
border-radius: 6px;
background: #1a73e8;
color: #fff;
font-size: 13px;
cursor: pointer;
}
</style>
</head>

<body>
<h2>WebAuthnLinux Authenticator</h2>
<div id="status" class="status">Waiting for requests...</div>
<div id="action-area">
<button id="unlock-btn" style="display:none; padding: 10px 20px; font-size: 16px; cursor: pointer;">Unlock with
Fingerprint</button>
<div class="icon pulse" id="icon">
<img src="fingerprint-webauthn.svg" alt="" width="48" height="48">
</div>

<h1 id="title">Verify it's you</h1>
<p id="status">Touch the fingerprint reader…</p>
<button id="retry-btn">Try again</button>
<script src="js/cbor.js"></script>
<script src="js/webauthn-tools.js"></script>
<script src="js/falcon.js"></script>
<script src="js/webauthn-authenticator.js"></script>
<script src="authenticator.js"></script>
</body>

</html>
</html>
261 changes: 162 additions & 99 deletions extension/authenticator.js

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
console.log("PARSED CREDENTIAL:", credential);
} catch (e) {
console.error("FAILED TO PARSE CREDENTIAL:", e);
}
}
}

//
Expand Down Expand Up @@ -116,7 +116,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
// Clear pending request after completion?
// Maybe wait a bit or clear it now. Let's clear it to be clean.
// Clear request after completion
pendingRequest = null;
pendingRequest = null;
} else {
// Do not fallback to active tab.
// The active tab may not be the tab that initiated WebAuthn.
Expand All @@ -134,16 +134,20 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
pendingRequest.requestingTabId = sender.tab.id;
}

// Open the authenticator popup
chrome.windows.create({
url: "authenticator.html",
type: "popup",
width: 400,
height: 600,
focused: true
}, (window) => {
if(window)
popupWindowId = window.id;
const tabId = sender.tab.id;
const windowId = sender.tab.windowId;
pendingRequest.requestingTabId = tabId;

// Point the toolbar action's popup at the request bubble, only for this tab.
chrome.action.setPopup({ tabId, popup: 'authenticator.html' });
chrome.action.setBadgeBackgroundColor({ tabId, color: '#f0a500' });
chrome.action.setBadgeText({ tabId, text: ' ' });
chrome.action.setTitle({ tabId, title: 'WebAuthnLinux: verification requested for ' + (sender.tab.url || '') });

// Open it without requiring a click (Firefox 149+; falls back to
// requiring the user to click the toolbar icon on older Firefox).
chrome.action.openPopup({ windowId }).catch((e) => {
console.warn('WebAuthnLinux: openPopup() failed - user must click the toolbar icon manually.', e);
});

sendResponse({ started: true });
Expand Down
91 changes: 91 additions & 0 deletions extension/fingerprint-webauthn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extension/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extension/icons/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extension/icons/icon_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extension/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extension/icons/store_icon_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.