add: background.js for automatic code input

This commit is contained in:
2026-03-18 12:33:21 +01:00
parent becc4f9445
commit e8a14e7e69
8 changed files with 3748 additions and 56 deletions

View File

@@ -1,25 +0,0 @@
// eslint-disable-next-line no-undef
const api = typeof browser !== "undefined" ? browser : chrome;
api.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === "autofill") {
const input = document.getElementById('input2factor');
const button = document.getElementById('btn-login');
if (input) {
input.focus();
input.value = request.code;
input.dispatchEvent(new Event('input', { bubbles: true }));
input.dispatchEvent(new Event('change', { bubbles: true }));
if (button) {
setTimeout(() => {
button.click();
}, 150);
}
sendResponse({ status: "bomba" });
}
}
return true;
});