This commit is contained in:
John Fanjoy 2026-01-07 16:36:49 -08:00 committed by GitHub
commit e35e152e28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 5 deletions

View File

@ -365,18 +365,34 @@ def make_js_code(username, password):
}
};
function fillFirstForm() {
var forms = document.getElementsByTagName("form");
function checkForIframeForms(doc, recursive = true) {
doc || (doc = document);
const iframes = doc.getElementsByTagName('iframe');
for (const frame of iframes) {
if (fillFirstForm(frame.contentDocument, false)) return true;
}
return false;
}
function fillFirstForm(doc, recursive = true) {
doc || (doc = document);
var forms = doc.getElementsByTagName("form");
let success = false;
for (i = 0; i < forms.length; i++) {
if (hasPasswordField(forms[i])) {
loadData2Form(forms[i]);
return;
return true;
}
}
alert("No Credentials Form found");
if (recursive) success = checkForIframeForms(doc, false);
return success;
};
fillFirstForm()
function findAndFillFirstForm () {
if (!fillFirstForm()) { alert("No Credentials Form found"); }
};
findAndFillFirstForm()
""".splitlines()) % (json.dumps(username), json.dumps(password))