Kinopoisk removing

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

  1. // ==UserScript==
  2. // @name Kinopoisk removing
  3. // @namespace FIX
  4. // @version 0.1
  5. // @description Удаление фоновой рекламы на кинопоиске
  6. // @author raletag
  7. // @copyright 2017, raletag
  8. // @include *://kinopoisk.ru/*
  9. // @include *://www.kinopoisk.ru/*
  10. // @grant none
  11. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var MO = window.MutationObserver;
  17. if (!MO) {
  18. alert('"Kinopoisk removing" не поддерживается в данном браузере!');
  19. return;
  20. }
  21. var o = new MO(function (ms){
  22. ms.forEach(function (m) {
  23. m.addedNodes.forEach(function (n) {
  24. if (n.nodeType === Node.ELEMENT_NODE && n.id == 'branding-style') {
  25. console.log('Kinopoisk removing');
  26. n.innerHTML = '';
  27. o.disconnect();
  28. var style = document.createElement("style");
  29. style.innerHTML='#top_form, #top .png_block, #top .menu {top: 10px!important;} .shadow {top: -200px;}';
  30. (document.head||document.body||document.documentElement||document).appendChild(style);
  31. }
  32. });
  33. });
  34. });
  35. o.observe(document, {childList: true, subtree: true});
  36. })();