Update chrome.js

This commit is contained in:
Namhyeon Go 2021-08-10 20:48:38 +09:00 committed by GitHub
parent 922dd56410
commit 3c1eefa68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -490,6 +490,15 @@ var ChromeObject = function() {
};
};
this.getElementPosition = function(selector) {
var result = this.getEvaluatedValue('(function() { var el = document.querySelector("' + selector + '").getBoundingClientRect(); return [el.left, el.top].join(","); })();');
var pos = result.split(',');
return {
"x": parseInt(pos[0]),
"y": parseInt(pos[1])
};
};
this.getPageHeight = function() {
var height = 0;
@ -596,6 +605,8 @@ var ChromeObject = function() {
var s = encodeURIComponent(value);
return this.evaluate('document.querySelector("' + selector + '").value = decodeURIComponent("' + s + '")');
};
this.
this.create();
};