From 02b4b447805427d56b237edc179ab19ef2d095b5 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 31 Jan 2021 23:55:50 +0100 Subject: [PATCH] Additional anti-recursing measures --- src/ext/lib/video-data/PlayerData.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ext/lib/video-data/PlayerData.js b/src/ext/lib/video-data/PlayerData.js index b131d82..f0abd6d 100644 --- a/src/ext/lib/video-data/PlayerData.js +++ b/src/ext/lib/video-data/PlayerData.js @@ -85,11 +85,21 @@ class PlayerData { return ( window.innerHeight == window.screen.height && window.innerWidth == window.screen.width); } + // player size observer may not be strictly necessary here + _playerDimensionChangedInProgress = false; onPlayerDimensionsChanged(mutationList, observer, context) { + if (this._playerDimensionChangedInProgress) { + return; + } + + this._playerDimensionChangedInProgress = true; + if (this?.checkPlayerSizeChange()) { this.videoData.resizer.restore(); } + + this._playerDimensionChangedInProgress = false; }