Advertisement Hide - Kino HDrezka

Выключает рекламу на ресурсе HDrezka

当前为 2022-07-15 提交的版本,查看 最新版本

// ==UserScript==
// @name           Advertisement Hide - Kino HDrezka
// @namespace      scriptomatika
// @author         mouse-karaganda
// @description    Выключает рекламу на ресурсе HDrezka
// @license        MIT
// @include        https://rezka.ag/*
// @require        https://greasyfork.org/scripts/379902-include-tools/code/Include%20Tools.js?version=1070353
// @version        2.1
// @grant          none
// ==/UserScript==

(function() {
    let $ = window.jQuery;
    let $$ = window.__krokodil;

    if ($$.mozDocumentDomainIs('rezka.ag')) {
        $$.renderStyle(
            'body.active-brand { background-color: #313131; background-color: #777; }',
            'body.active-brand.pp { padding-top: 0 !important; }'
        );
        // Убираем рекламный блок
        $$.missingElement('body.has-brand.active-brand > noindex > div > iframe', function(exists) {
            if (!exists) return;
            $$.del(this);
        });
    }

    if ($$.mozDocumentUrlPrefixIs('https://rezka.ag/search')) {
        $$.renderStyle(
            '.b-content__inline_inner_mainprobar { padding-right: 0 !important; }'
        );
        $$.missingElement('.b-content__inline_items + div[id]', function(exists) {
            if (!exists) return;
            $$.del(this);
        });
    }

    if ($$.mozDocumentUrlPrefixIs('https://rezka.ag/series') || 
        $$.mozDocumentUrlPrefixIs('https://rezka.ag/films')
    ) {
        $$.renderStyle(
            //'#vk_groups { position: fixed; left: -2000px; top: -2000px; }',
            '.b-content__main + div[id] { display: none; }',
            '.b-content__columns { padding-right: 0 !important; }',
            '#cdnplayer, #cdnplayer-container { width: 960px !important; height: calc(960px * 360 / 640) !important; }'
        );
        $$.missingElement('#vk_groups + div[id], .b-post__rating_table + div[id]', function(exists) {
            if (!exists) return;
            $$.each(this, function(elem) {
                $$.del(elem);
            });
        });
    }

    console.log('Advertisement Hide - Kino HDrezka 💬 2.1');
})();