Merge 002e7ad851 into 7e3df43463
This commit is contained in:
commit
e35e152e28
|
|
@ -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))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue