Youtube polymer engine fixes

Some fixes for Youtube polymer engine

目前為 2020-06-18 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Youtube polymer engine fixes
// @description  Some fixes for Youtube polymer engine
// @namespace    bo.gd.an[at]rambler.ru
// @version      0.1
// @match        https://www.youtube.com/*
// @compatible   firefox 56
// @author       Bogudan
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
	// hide "guide" menu
	var guide_button=document.getElementById('guide-button');
	if(guide_button){
		var tmp=guide_button.getElementsByTagName('button');
		if(tmp.length) {
			tmp=tmp[0].attributes;
			if(tmp&&tmp['aria-pressed'].value=='true')
				guide_button.click();
		    }
	    }
	//var contents_div=document.getElementById('contents');if(contents_div)contents_div.style.setProperty('--ytd-rich-grid-items-per-row','6'); -- fixed through ytd-rich-item-renderer style
	// styles
	var style_element=document.createElement('style');
	style_element.type='text/css';
	style_element.innerHTML=
		// decrease text sizes
		'#video-title.ytd-rich-grid-video-renderer,#text.ytd-channel-name,#metadata-line.ytd-video-meta-block{font-size:14px!important;line-height:1.2em!important}'+
		// fix: home page thumbnails size (1/3 of original image sizes)
		'ytd-rich-item-renderer{width:240px!important}'+
		// fix: "not interested" placeholder bigger than original element by about 40%
		'paper-button.style-blue-text{padding:0!important}';
	document.body.appendChild(style_element);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址