change ads to be toggleable

This commit is contained in:
Send_Nukez 2021-10-09 08:45:47 +02:00
parent 3766db4ab4
commit 4ee54158a9
2 changed files with 33 additions and 16 deletions

View file

@ -258,6 +258,38 @@ DribbblishShared.config.register({
}
});
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",

View file

@ -1221,19 +1221,4 @@ html.right-expanded-cover.buddyfeed-visible .main-coverSlotExpanded-container {
.main-actionBar-ActionBarRow button:not(.main-playButton-primary) {
color: var(--spice-subtext);
}
/* Remove upgrade button*/
.main-topBar-UpgradeButton {
display: none;
}
/* Remove upgrade to premium button in user menu */
.main-contextMenu-menuItemButton[href="https://www.spotify.com/premium/"] {
display: none;
}
/* Remove ad placeholder in main screen */
.main-leaderboardComponent-container {
display: none;
}
}