diff options
author | Ajay <[email protected]> | 2023-11-07 21:05:39 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2023-11-07 21:05:39 -0500 |
commit | 6d37180d005f8f1c7691e0567ea4802425ca7569 (patch) | |
tree | 3210131fbb6b39c9a6b46704fedbdaf58ea714ea /src | |
parent | 14d50b9e70133bae0012a8d86da5b2e440fa0297 (diff) | |
download | SponsorBlock-6d37180d005f8f1c7691e0567ea4802425ca7569.tar.gz SponsorBlock-6d37180d005f8f1c7691e0567ea4802425ca7569.zip |
Add option to hide clutter in popup
Diffstat (limited to 'src')
-rw-r--r-- | src/config.ts | 2 | ||||
-rw-r--r-- | src/popup.ts | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts index 95a36421..f13cd3ad 100644 --- a/src/config.ts +++ b/src/config.ts @@ -77,6 +77,7 @@ interface SBConfig { showDeArrowPromotion: boolean; showDeArrowInSettings: boolean; showZoomToFillError2: boolean; + cleanPopup: boolean; // Used to cache calculated text color info categoryPillColors: { @@ -320,6 +321,7 @@ const syncDefaults = { showDeArrowPromotion: false, showDeArrowInSettings: true, showZoomToFillError2: true, + cleanPopup: false, categoryPillColors: {}, diff --git a/src/popup.ts b/src/popup.ts index 234096fe..41fb9210 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -108,6 +108,10 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> { const PageElements: PageElements = {}; [ + "sbPopupLogo", + "sbYourWorkBox", + "videoInfo", + "sbFooter", "sponsorBlockPopupBody", "sponsorblockPopup", "sponsorStart", @@ -198,6 +202,16 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> { } PageElements.sbDonate.addEventListener("click", () => Config.config.donateClicked = Config.config.donateClicked + 1); + if (Config.config.cleanPopup) { + PageElements.sbPopupLogo.classList.add("hidden"); + PageElements.sbYourWorkBox.classList.add("hidden"); + PageElements.sbFooter.classList.add("hidden"); + PageElements.sponsorTimesDonateContainer.classList.add("hidden"); + PageElements.mainControls.classList.add("hidden"); + + PageElements.videoInfo.style.marginTop = "10px"; + } + if (Config.config.testingServer) { PageElements.sbBetaServerWarning.classList.remove("hidden"); PageElements.sbBetaServerWarning.addEventListener("click", function () { |