mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-15 22:21:04 +00:00
Update chrome.js
This commit is contained in:
parent
6c48902cca
commit
224cd05c81
|
@ -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() {
|
this.getPageHeight = function() {
|
||||||
var height = 0;
|
var height = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user