Update chrome.js

This commit is contained in:
Namhyeon Go 2021-08-20 16:53:12 +09:00 committed by GitHub
parent 6c48902cca
commit 224cd05c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -615,6 +615,25 @@ var ChromeObject = function() {
}
};
this.getNestedElementIndex = function(selector, subSelector, searchText) {
var s = '';
s += '(function() {'
+ ' var elements = Object.values(document.querySelectorAll("' + selector + '"));'
+ ' var result = -1;'
+ ' for (var i = 0; i < elements.length; i++) {'
+ ' if (x.querySelector("' + subSelector + '").innerText.indexOf(decodeURIComponent("' + encodeURIComponent(searchText) + '")) > -1) {'
+ ' result = i;'
+ ' break;'
+ ' }'
+ ' }'
+ ' return result;'
+ '})()'
;
return parseInt(this.getEvaluatedValue(s));
};
this.getPageHeight = function() {
var height = 0;