Youtube polymer engine fixes

Some fixes for Youtube polymer engine

Od 18.06.2020.. Pogledajte najnovija verzija.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);
})();