05/07: updated extension after updating Advanced Settings to functioning
This commit is contained in:
@@ -167,7 +167,7 @@
|
||||
el.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
}
|
||||
|
||||
function doAutofill(username, password) {
|
||||
function doAutofill(username, password, autologin) {
|
||||
const pwFields = visiblePasswordFields();
|
||||
if (!pwFields.length) return;
|
||||
const pwField = pwFields[0];
|
||||
@@ -180,6 +180,24 @@
|
||||
el.style.outline = "";
|
||||
}, 1500);
|
||||
});
|
||||
// Autologin: submit the form automatically after filling.
|
||||
if (autologin) {
|
||||
const form = pwField.closest("form");
|
||||
if (form) {
|
||||
setTimeout(function () {
|
||||
// Prefer clicking a visible submit button so site-specific submit
|
||||
// handlers (React, Vue, etc.) fire correctly.
|
||||
var submitBtn = form.querySelector(
|
||||
'[type="submit"]:not([disabled])',
|
||||
);
|
||||
if (submitBtn) {
|
||||
submitBtn.click();
|
||||
} else {
|
||||
form.submit();
|
||||
}
|
||||
}, 400);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Icon button (fixed-position, outside the DOM tree of the field) ───────────
|
||||
@@ -1105,7 +1123,7 @@
|
||||
|
||||
chrome.runtime.onMessage.addListener(function (msg, _sender, sendResponse) {
|
||||
if (msg.type === "DO_AUTOFILL") {
|
||||
doAutofill(msg.username, msg.password);
|
||||
doAutofill(msg.username, msg.password, !!msg.autologin);
|
||||
sendResponse({ ok: true });
|
||||
}
|
||||
if (msg.type === "VAULT_UPDATED") {
|
||||
|
||||
Reference in New Issue
Block a user