1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

Chrome tab background performance fixes (#977)

* Add listener to detect when in background and disable polling.

* Remove polling.
This commit is contained in:
Fraser Mince 2019-11-07 10:37:43 -07:00 committed by Fred Chasen
parent d9c2559b21
commit 589f5ce9e5

View file

@ -386,7 +386,6 @@ class Contents {
* @private
*/
listeners() {
this.imageLoadListeners();
this.mediaQueryListeners();
@ -448,9 +447,7 @@ class Contents {
var width, height;
// Test size again
clearTimeout(this.expanding);
requestAnimationFrame(this.resizeCheck.bind(this));
this.expanding = setTimeout(this.resizeListeners.bind(this), 350);
requestAnimationFrame(this.resizeCheck.bind(this));
}
/**