Greasy Fork is available in English.
Cleanup hdrezka: change content width, change player size, remove blocks like telegram, social, rating, support, status, vk
当前为
// ==UserScript==
// @name hdrezka-cleanup
// @namespace http://tampermonkey.net/
// @version 0.6
// @description Cleanup hdrezka: change content width, change player size, remove blocks like telegram, social, rating, support, status, vk
// @author rub4ek
// @match https://rezka.ag/*
// @grant GM_addStyle
// @run-at document-start
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// ==/UserScript==
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;
}
/* Style for content item cover */
.b-content__inline_item-cover {
border-color: transparent;
}
/* Style status */
.b-post__status_wrapper {
width: auto;
margin: 10px 10px 12px 13px;
}
/* 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 rating block */
.b-post__rating_table {
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 ads */
.b-content__main > .b-post__mixedtext + div[style],
.b-post__rating_table + div[style],
.b-player > a[target='_blank'] {
display: none !important;
}
`)
function HDRC_resizePlayer() {
var $contentMain = $(".b-content__main");
var $playerHolder = $(".b-player__holder_cdn");
var $playerContainer = $(".b-player__container_cdn");
var iw = $playerHolder.width();
var ih = $playerHolder.height();
var nw = $contentMain.width();
if (iw >= 360 && ih > 0 && nw > iw) {
var ratio = iw / ih;
var nh = nw / ratio;
$playerHolder
.width(nw)
.height(nh);
$playerContainer
.width(nw)
.height(nh);
console.log("hdrezka cleanup: player resized from" + iw + "x" + ih + " to " + nw + "x" + nh + ".");
}
}
function HDRC_onDocumentStart() {
HDRC_resizePlayer();
}
function HDRC_onDocumentEnd() {
HDRC_resizePlayer();
}
document.addEventListener("DOMContentLoaded", HDRC_onDocumentEnd);
HDRC_onDocumentStart();