Skip to content

Auto copy to text box? #1364

Closed Answered by mymindstorm
Connor9220 asked this question in Q&A
Jan 16, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Here's our logic for autofill:

function pasteCode(code: string) {
const _inputBoxes = document.getElementsByTagName("input");
const inputBoxes: HTMLInputElement[] = [];
for (let i = 0; i < _inputBoxes.length; i++) {
if (
_inputBoxes[i].type === "text" ||
_inputBoxes[i].type === "number" ||
_inputBoxes[i].type === "tel" ||
_inputBoxes[i].type === "password"
) {
inputBoxes.push(_inputBoxes[i]);
}
}
if (!inputBoxes.length) {
return;
}
const identities = [
"2fa",
"otp",
"authenticator",
"factor",
"code",
"totp",
"…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Connor9220
Comment options

Answer selected by mymindstorm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants