Commit 74e81194 74e8119415a186f2d7e9a90ec4ed467697beeafc by Nicolas Perriault

closes #5 - added input field focus() and blur() event support to form filling

1 parent 0c2c4666
Showing 1 changed file with 10 additions and 0 deletions
......@@ -1005,6 +1005,11 @@
this.log("invalid field type; only HTMLElement and NodeList are supported", "error");
}
this.log('set "' + field.getAttribute('name') + '" field value to ' + value, "debug");
try {
field.focus();
} catch (e) {
__utils__.log("Unable to focus() input field " + field.getAttribute('name') + ": " + e, "warning");
}
var nodeName = field.nodeName.toLowerCase();
switch (nodeName) {
case "input":
......@@ -1059,6 +1064,11 @@
out = 'unsupported field type: ' + nodeName;
break;
}
try {
field.blur();
} catch (err) {
__utils__.log("Unable to blur() input field " + field.getAttribute('name') + ": " + err, "warning");
}
return out;
};
};
......