Update chrome.js

This commit is contained in:
Namhyeon Go 2021-12-04 05:49:38 +09:00 committed by GitHub
parent 9efe02e902
commit adc7127775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -994,6 +994,10 @@ var ChromeObject = function() {
return parseInt(this.getEvaluatedValue('window.innerHeight'));
};
this.getDocumentScrollTop = function() {
return parseInt(this.getEvaluatedValue('document.documentElement.scrollTop'));
};
// formula: y > 0 and y + h < ih
this.isVisibleElementInViewport = function(elementPosition) {
return (elementPosition.y > 0 && (elementPosition.y + elementPosition.h < this.getWindowInnerHeight()));