mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
Merge pull request #1077 from Araxeus/Add-option-to-remove-like-buttons
add option to hide the like buttons
This commit is contained in:
@ -19,6 +19,11 @@ const migrations = {
|
|||||||
...pluginOptions,
|
...pluginOptions,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (store.get("options.ForceShowLikeButtons")) {
|
||||||
|
store.delete("options.ForceShowLikeButtons");
|
||||||
|
store.set("options.likeButtons", 'force');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
">=1.17.0": (store) => {
|
">=1.17.0": (store) => {
|
||||||
setDefaultPluginOptions(store, "picture-in-picture");
|
setDefaultPluginOptions(store, "picture-in-picture");
|
||||||
|
|||||||
33
menu.js
33
menu.js
@ -93,12 +93,33 @@ const mainMenuTemplate = (win) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Force show like buttons",
|
label: "Like buttons",
|
||||||
type: "checkbox",
|
submenu: [
|
||||||
checked: config.get("options.ForceShowLikeButtons"),
|
{
|
||||||
click: (item) => {
|
label: "Default",
|
||||||
config.set("options.ForceShowLikeButtons", item.checked);
|
type: "radio",
|
||||||
},
|
checked: !config.get("options.likeButtons"),
|
||||||
|
click: () => {
|
||||||
|
config.set("options.likeButtons", '');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Force show",
|
||||||
|
type: "radio",
|
||||||
|
checked: config.get("options.likeButtons") === 'force',
|
||||||
|
click: () => {
|
||||||
|
config.set("options.likeButtons", 'force');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Hide",
|
||||||
|
type: "radio",
|
||||||
|
checked: config.get("options.likeButtons") === 'hide',
|
||||||
|
click: () => {
|
||||||
|
config.set("options.likeButtons", 'hide');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Theme",
|
label: "Theme",
|
||||||
|
|||||||
14
preload.js
14
preload.js
@ -135,11 +135,17 @@ function onApiLoaded() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force show like buttons
|
|
||||||
if (config.get("options.ForceShowLikeButtons")) {
|
// Hide / Force show like buttons
|
||||||
const likeButtons = document.querySelector('ytmusic-like-button-renderer')
|
const likeButtonsOptions = config.get("options.likeButtons");
|
||||||
|
if (likeButtonsOptions) {
|
||||||
|
const likeButtons = document.querySelector("ytmusic-like-button-renderer");
|
||||||
if (likeButtons) {
|
if (likeButtons) {
|
||||||
likeButtons.style.display = 'inherit';
|
likeButtons.style.display =
|
||||||
|
{
|
||||||
|
hide: "none",
|
||||||
|
force: "inherit",
|
||||||
|
}[likeButtonsOptions] || "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user