From c07916362e3afd4fb9efb381b746da2ec3b11aa7 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 30 Mar 2021 20:38:16 +0200 Subject: [PATCH] log a lil bit less. Fix mutation observer callback --- src/ext/lib/video-data/VideoData.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ext/lib/video-data/VideoData.ts b/src/ext/lib/video-data/VideoData.ts index a034ad4..24cdf7c 100644 --- a/src/ext/lib/video-data/VideoData.ts +++ b/src/ext/lib/video-data/VideoData.ts @@ -385,7 +385,7 @@ class VideoData { if (mutation.type === 'attributes') { if( mutation.attributeName === 'class' && mutation.oldValue.indexOf('uw-ultrawidify-base-wide-screen') !== -1 - && mutation.oldValue.indexOf('uw-ultrawidify-base-wide-screen') === -1 + && !this.video.classList.contains('uw-ultrawidify-base-wide-screen') ) { // force the page to include our class in classlist, if the classlist has been removed // while classList.add() doesn't duplicate classes (does nothing if class is already added), @@ -396,8 +396,6 @@ class VideoData { confirmAspectRatioRestore = true; this.video.classList.add(this.userCssClassName); this.video.classList.add('uw-ultrawidify-base-wide-screen'); - - console.warn('our classname was removed by site! undoign!') } else if (mutation.attributeName === 'style') { confirmAspectRatioRestore = true; } @@ -405,7 +403,6 @@ class VideoData { } this.processDimensionsChanged(); - // console.info('video mutated. mutation list?', mutationList); } onVideoDimensionsChanged(mutationList, observer) {