mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
feat: option to force show like buttons
This commit is contained in:
25
menu.js
25
menu.js
@ -80,12 +80,25 @@ const mainMenuTemplate = (win) => {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Remove upgrade button",
|
||||
type: "checkbox",
|
||||
checked: config.get("options.removeUpgradeButton"),
|
||||
click: (item) => {
|
||||
config.setMenuOption("options.removeUpgradeButton", item.checked);
|
||||
},
|
||||
label: "Visual Tweaks",
|
||||
submenu: [
|
||||
{
|
||||
label: "Remove upgrade button",
|
||||
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",
|
||||
|
||||
14
preload.js
14
preload.js
@ -83,9 +83,17 @@ function onApiLoaded() {
|
||||
|
||||
// Remove upgrade button
|
||||
if (config.get("options.removeUpgradeButton")) {
|
||||
const upgradeButtton = document.querySelector('ytmusic-pivot-bar-item-renderer[tab-id="SPunlimited"]')
|
||||
if (upgradeButtton) {
|
||||
upgradeButtton.style.display = "none";
|
||||
const upgradeButton = document.querySelector('ytmusic-pivot-bar-item-renderer[tab-id="SPunlimited"]')
|
||||
if (upgradeButton) {
|
||||
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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user