Files
panel/resources/js/app.js
JoanFo a9cb16e042 Passkeys (#2192)
Co-authored-by: Lance Pioch <git@lance.sh>
2026-06-22 23:59:07 -04:00

18 lines
709 B
JavaScript

(() => {
if (navigator.clipboard && typeof navigator.clipboard.writeText === 'function') return;
navigator.clipboard = navigator.clipboard || {};
navigator.clipboard.writeText = async (text) =>
new Promise((resolve, reject) => {
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.left = '-9999px';
textarea.style.opacity = '0';
document.body.appendChild(textarea);
textarea.select();
const success = document.execCommand('copy');
document.body.removeChild(textarea);
success ? resolve() : reject('Fallback copy failed');
});
})();
import './passkeys/index.js';