Restores normal thumbnails size
目前為
// ==UserScript==
// @name YouTube Normal Thumbnails
// @namespace http://greasyfork.org
// @version 0.2
// @description Restores normal thumbnails size
// @author NeoCortex
// @match https://www.youtube.com/
// @grant none
// ==/UserScript==
(function() {
const target = document.querySelector('ytd-rich-grid-renderer'),
config = {
attributes: true,
childList: false,
subtree: false
},
fixStyle = function() {
target.style.cssText =
target.style.cssText.replace(
/\-\-ytd\-rich\-grid\-items\-per\-row\:\s*\d{1,3}\;/,
'--ytd-rich-grid-items-per-row: 5;'
);
},
callback = function(mutationsList, observer) {
for (let mutation of mutationsList) {
if (mutation.attributeName == 'style') {
observer.disconnect();
fixStyle();
observer.observe(target, config);
}
}
};
fixStyle();
const observer = new MutationObserver(callback);
observer.observe(target, config);
var s = document.createElement('style');
s.innerHTML = 'ytd-rich-grid-video-renderer[mini-mode] #video-title.ytd-rich-grid-video-renderer {font-size: 1.3rem;}';
document.body.appendChild(s);
})();