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) {