Skip to content

Instantly share code, notes, and snippets.

@Aikufurr
Last active November 9, 2021 12:28
Show Gist options
  • Save Aikufurr/a22cd17692ce053eb2539b8509aa0b30 to your computer and use it in GitHub Desktop.
Save Aikufurr/a22cd17692ce053eb2539b8509aa0b30 to your computer and use it in GitHub Desktop.
Removes the album cover from covering the whole screen and adds the like/dislike buttons back
// ==UserScript==
// @name Fix half width
// @namespace http://tamprmonkey.net/
// @version 1.2
// @description Removes the album cover from covering the whole screen and adds the like/dislike buttons back
// @author Aikufurr
// @match https://music.youtube.com/*
// @icon https://www.google.com/s2/favicons?domain=youtube.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
let config = {
"enable-album-cover": false,
"enable-like_dislike": true,
"refresh-interval_ms": 10000
};
function fix() {
if (!!!config["enable-album-cover"]) {
document.getElementById("main-panel").style.display = "none";
}
if (!!config["enable-like_dislike"]) {
document.getElementById("like-button-renderer").style.display = "block";
}
document.getElementById("right-controls").style.width = "";
document.getElementsByClassName("thumbnail-image-wrapper style-scope ytmusic-player-bar")[0].style.display = "none";
}
setTimeout(function() {fix()}, 5000);
var currentPage = location.href;
setInterval(function() {
if (currentPage != location.href && location.href.startsWith("https://music.youtube.com/watch?v=")) {
currentPage = location.href;
fix();
}
}, 5000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment