Update chrome.js

This commit is contained in:
Namhyeon Go 2021-09-27 09:18:50 +09:00 committed by GitHub
parent b7914adc5c
commit e6f63c7d99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -781,11 +781,14 @@ var ChromeObject = function() {
this.oAutoIt.Send("{SPACE}"); this.oAutoIt.Send("{SPACE}");
}; };
this.setValue = function(selector, value, repeat) { this.setValue = function(selector, value, searchIndex) {
var s = encodeURIComponent(value), i = 0; var searchIndex = (typeof searchIndex !== "undefined" ? searchIndex : 0);
while (i < repeat) { var s = encodeURIComponent(value);
if (searchIndex > 0) {
this.evaluate('Object.values(document.querySelectorAll("' + selector + '"))[' + searchIndex + '].value = decodeURIComponent("' + s + '");');
} else {
this.evaluate('document.querySelector("' + selector + '").value = decodeURIComponent("' + s + '")'); this.evaluate('document.querySelector("' + selector + '").value = decodeURIComponent("' + s + '")');
i++;
} }
}; };