hardcode defautl css string somewhere else

This commit is contained in:
Tamius Han 2023-09-10 13:12:35 +02:00
parent bd1216c275
commit 0ba56c271d

View File

@ -25,6 +25,14 @@ import { ExtensionStatus } from './ExtensionStatus';
*/ */
class VideoData { class VideoData {
private baseCssName: string = 'uw-ultrawidify-base-wide-screen'; 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 //#region flags
arSetupComplete: boolean = false; arSetupComplete: boolean = false;
@ -161,19 +169,7 @@ class VideoData {
if (!this.mutationObserver) { if (!this.mutationObserver) {
this.setupMutationObserver(); this.setupMutationObserver();
} }
this.eventBus.send( this.eventBus.send('inject-css', this.baseVideoCss);
'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;
}
`
);
} catch (e) { } catch (e) {
console.error('Failed to inject base css!', e); console.error('Failed to inject base css!', e);
} }