Kinopoisk removing

Удаление фоновой рекламы на кинопоиске

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            Kinopoisk removing
// @namespace       FIX
// @version         0.1
// @description     Удаление фоновой рекламы на кинопоиске
// @author          raletag
// @copyright       2017, raletag
// @include         *://kinopoisk.ru/*
// @include         *://www.kinopoisk.ru/*
// @grant           none
// @run-at          document-start
// ==/UserScript==

(function() {
    'use strict';
    var MO = window.MutationObserver;
    if (!MO) {
        alert('"Kinopoisk removing" не поддерживается в данном браузере!');
        return;
    }
    var o = new MO(function (ms){
        ms.forEach(function (m) {
                m.addedNodes.forEach(function (n) {
                    if (n.nodeType === Node.ELEMENT_NODE && n.id == 'branding-style') {
                        console.log('Kinopoisk removing');
                        n.innerHTML = '';
                        o.disconnect();
                        var style = document.createElement("style");
                        style.innerHTML='#top_form, #top .png_block, #top .menu  {top: 10px!important;} .shadow {top: -200px;}';
                        (document.head||document.body||document.documentElement||document).appendChild(style);
                    }
                });
            });
    });
    o.observe(document, {childList: true, subtree: true});
})();