Update chrome.js

This commit is contained in:
Namhyeon Go 2021-11-19 18:06:42 +09:00 committed by GitHub
parent 15a6be1ec1
commit 410d77ccdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -931,6 +931,11 @@ var ChromeObject = function() {
return this.getEvaluatedValue('window.innerHeight'); return this.getEvaluatedValue('window.innerHeight');
}; };
// formula: y > 0 and y + h < ih
this.isVisibleElementInViewport = function(elementPosition) {
return (elementPosition.y > 0 && (elementPosition.y + elementPosition.h < this.getWindowInnerHeight());
};
this.create(); this.create();
}; };