mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-24 12:35:05 +00:00
fix hide ads always being enabled
This commit is contained in:
parent
87d66e003a
commit
653ed64814
1 changed files with 30 additions and 30 deletions
|
|
@ -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: <a href="https://github.com/Daksh777/SpotifyNoPremium">SpotifyNoPremium</a>)`,
|
||||
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: <a href="https://github.com/Daksh777/SpotifyNoPremium">SpotifyNoPremium</a>)`,
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue