From 0ba56c271dffe6126d911f65b2dd41f41005f0f0 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 10 Sep 2023 13:12:35 +0200 Subject: [PATCH] hardcode defautl css string somewhere else --- src/ext/lib/video-data/VideoData.ts | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/ext/lib/video-data/VideoData.ts b/src/ext/lib/video-data/VideoData.ts index a3a9893..41f681e 100644 --- a/src/ext/lib/video-data/VideoData.ts +++ b/src/ext/lib/video-data/VideoData.ts @@ -25,6 +25,14 @@ import { ExtensionStatus } from './ExtensionStatus'; */ class VideoData { private baseCssName: string = 'uw-ultrawidify-base-wide-screen'; + private baseVideoCss = `.uw-ultrawidify-base-wide-screen { + margin: 0px 0px 0px 0px !important; + width: initial !important; + align-self: start !important; + justify-self: start !important; + max-height: initial !important; + max-width: initial !important; + }`; //#region flags arSetupComplete: boolean = false; @@ -161,19 +169,7 @@ class VideoData { if (!this.mutationObserver) { this.setupMutationObserver(); } - this.eventBus.send( - 'inject-css', - ` - .uw-ultrawidify-base-wide-screen { - margin: 0px 0px 0px 0px !important; - width: initial !important; - align-self: start !important; - justify-self: start !important; - max-height: initial !important; - max-width: initial !important; - } - ` - ); + this.eventBus.send('inject-css', this.baseVideoCss); } catch (e) { console.error('Failed to inject base css!', e); }