// ==UserScript== // @name HDrezka Cleanup // @name:en HDrezka Cleanup // @namespace http://tampermonkey.net/ // @version 0.8 // @description Cleanup HDrezka: change content width, change player size, remove blocks (telegram, social, support, vk, etc), restyle blocks (cover, status, rating, etc) // @description:en Cleanup HDrezka: change content width, change player size, remove blocks (telegram, social, support, vk, etc), restyle blocks (cover, status, rating, etc) // @author rub4ek // @match https://rezka.ag/* // @grant GM_addStyle // @run-at document-start // @downloadURL none // ==/UserScript== function HDRC_addStyle () { GM_addStyle(` /* Remove extra right padding for content page */ .b-content__columns { padding-right: 0; } /* Remove extra right padding on main content listing */ .b-content__inline_inner_mainprobar { padding-right: 0; } .b-content__inline_inner_mainprobar .b-content__inline_item { margin-left: 16px !important; } /* Style for content item */ .b-content__inline_item .b-content__inline_item-cover { border-color: transparent !important; } .b-content__inline_item .b-content__inline_item-cover .info { font-weight: normal; } .b-content__inline_item .b-content__inline_item-link{ font-weight: normal; } /* Style status */ .b-post__status_wrapper { width: auto; margin: 10px 10px 12px 13px; } /* Style and resize rating block */ .b-post__rating_table > tbody > tr > td.label{ display: none !important; } .b-post__rating_table > tbody > tr > td div.b-post__rating { float:right; margin-right: 10px; } /* Add player margin */ .b-player { margin-bottom: 20px; } /* Remove telegram info block */ .tg__info_block_wrapper { display: none !important; } /* Remove last episode info */ .b-post__lastepisodeout { display: none !important; } /* Remove support block */ .b-post__support_holder { display: none !important; } /* Remove social block */ .b-post__social_holder_wrapper { display: none !important; } /* Remove VK */ #vk_groups { display: none !important; } /* Remove some ads containers */ .b-content__main > .b-post__mixedtext + div[style], .b-content__main > .b-post__rating_table + div[style], .b-content__main > div > .b-player > a[target='_blank'] { display: none !important; } `); console.log(`HDRC: styles changed`); } function HDRC_resizePlayer() { var playerHolderElem = document.querySelector(".b-player__holder_cdn"); if (playerHolderElem !== null) { var contentMainElem = document.querySelector(".b-content__main"); var playerContainerElem = document.querySelector(".b-player__container_cdn"); var iw = playerHolderElem.offsetWidth; var ih = playerHolderElem.offsetHeight; var nw = contentMainElem.offsetWidth; if (iw >= 360 && ih > 0 && nw > iw) { var ratio = iw / ih; var nh = nw / ratio; playerHolderElem.style.width = nw + "px"; playerHolderElem.style.height = nh + "px"; playerContainerElem.style.width = nw + "px"; playerContainerElem.style.height = nh + "px"; console.log(`HDRC: player resized from ${iw}x${ih} to ${nw}x${nh}.`) } } } function HDRC_onDocumentStart() { HDRC_addStyle(); HDRC_resizePlayer(); } function HDRC_onDocumentEnd() { HDRC_resizePlayer(); } document.addEventListener("DOMContentLoaded", HDRC_onDocumentEnd); HDRC_onDocumentStart();