From 653ed6481484a3337447a630cf4ac458b0fd1dbe Mon Sep 17 00:00:00 2001 From: Send_Nukez Date: Fri, 15 Oct 2021 07:28:50 +0200 Subject: [PATCH] fix hide ads always being enabled --- dribbblish.js | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/dribbblish.js b/dribbblish.js index 3575836..22b9972 100644 --- a/dribbblish.js +++ b/dribbblish.js @@ -359,36 +359,6 @@ DribbblishShared.config.register({ onChange: (val) => document.documentElement.style.setProperty("--sidebar-icons-hover-animation", val ? "1" : "0") }); -DribbblishShared.config.register({ - area: "Ads", - type: "checkbox", - key: "hideAds", - name: "Hide Ads", - description: `Hide ads / premium features (see: SpotifyNoPremium)`, - defaultValue: false, - onAppended: () => { - document.styleSheets[0].insertRule(/* css */ ` - /* Remove upgrade button*/ - body[hide-ads] .main-topBar-UpgradeButton { - display: none - } - `); - document.styleSheets[0].insertRule(/* css */ ` - /* Remove upgrade to premium button in user menu */ - body[hide-ads] .main-contextMenu-menuItemButton[href="https://www.spotify.com/premium/"] { - display: none - } - `); - document.styleSheets[0].insertRule(/* css */ ` - /* Remove ad placeholder in main screen */ - body[hide-ads] .main-leaderboardComponent-container { - display: none - } - `); - }, - onChange: (val) => document.body.setAttribute("hide-ads", val ? "" : null) -}); - waitForElement(["#main"], () => { DribbblishShared.config.register({ type: "select", @@ -433,6 +403,36 @@ waitForElement(["#main"], () => { } } }); + + DribbblishShared.config.register({ + area: "Ads", + type: "checkbox", + key: "hideAds", + name: "Hide Ads", + description: `Hide ads / premium features (see: SpotifyNoPremium)`, + defaultValue: false, + onAppended: () => { + document.styleSheets[0].insertRule(/* css */ ` + /* Remove upgrade button*/ + #main[hide-ads] .main-topBar-UpgradeButton { + display: none + } + `); + document.styleSheets[0].insertRule(/* css */ ` + /* Remove upgrade to premium button in user menu */ + #main[hide-ads] .main-contextMenu-menuItemButton[href="https://www.spotify.com/premium/"] { + display: none + } + `); + document.styleSheets[0].insertRule(/* css */ ` + /* Remove ad placeholder in main screen */ + #main[hide-ads] .main-leaderboardComponent-container { + display: none + } + `); + }, + onChange: (val) => document.getElementById("main").toggleAttribute("hide-ads", val) + }); }); function waitForElement(els, func, timeout = 100) {