feat: option to force show like buttons

This commit is contained in:
Araxeus
2022-04-06 19:48:58 +03:00
parent ea35da52c3
commit 0d3fa261a7
2 changed files with 30 additions and 9 deletions

25
menu.js
View File

@ -80,12 +80,25 @@ const mainMenuTemplate = (win) => {
}, },
}, },
{ {
label: "Remove upgrade button", label: "Visual Tweaks",
type: "checkbox", submenu: [
checked: config.get("options.removeUpgradeButton"), {
click: (item) => { label: "Remove upgrade button",
config.setMenuOption("options.removeUpgradeButton", item.checked); type: "checkbox",
}, checked: config.get("options.removeUpgradeButton"),
click: (item) => {
config.setMenuOption("options.removeUpgradeButton", item.checked);
},
},
{
label: "Force show like buttons",
type: "checkbox",
checked: config.get("options.ForceShowLikeButtons"),
click: (item) => {
config.set("options.ForceShowLikeButtons", item.checked);
},
},
],
}, },
{ {
label: "Single instance lock", label: "Single instance lock",

View File

@ -83,9 +83,17 @@ function onApiLoaded() {
// Remove upgrade button // Remove upgrade button
if (config.get("options.removeUpgradeButton")) { if (config.get("options.removeUpgradeButton")) {
const upgradeButtton = document.querySelector('ytmusic-pivot-bar-item-renderer[tab-id="SPunlimited"]') const upgradeButton = document.querySelector('ytmusic-pivot-bar-item-renderer[tab-id="SPunlimited"]')
if (upgradeButtton) { if (upgradeButton) {
upgradeButtton.style.display = "none"; upgradeButton.style.display = "none";
}
}
// Force show like buttons
if (config.get("options.ForceShowLikeButtons")) {
const likeButtons = document.querySelector('ytmusic-like-button-renderer')
if (likeButtons) {
likeButtons.style.display = 'inherit';
} }
} }
} }