Reason AnyClip Die

Removes annoying AnyClip Video on Reason.com.

  1. // ==UserScript==
  2. // @name Reason AnyClip Die
  3. // @namespace ReasonAnyClipDie
  4. // @version 0.1
  5. // @description Removes annoying AnyClip Video on Reason.com.
  6. // @author shellster
  7. // @match https://reason.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var MutationObserver = window.MutationObserver;
  15. var myObserver = new MutationObserver (mutationHandler);
  16. var obsConfig = {
  17. childList: true, attributes: true,
  18. subtree: true, attributeFilter: ['class']
  19. };
  20.  
  21. myObserver.observe (document, obsConfig);
  22.  
  23. function mutationHandler (mutationRecords) {
  24. mutationRecords.forEach ( function (mutation) {
  25.  
  26. if (mutation.type == "childList"
  27. && typeof mutation.addedNodes == "object"
  28. && mutation.addedNodes.length
  29. )
  30. {
  31. for (var J = 0, L = mutation.addedNodes.length; J < L; ++J) {
  32. checkForAD(mutation.addedNodes[J]);
  33. }
  34. }
  35. else if (mutation.type == "attributes") {
  36. checkForAD(mutation.target);
  37. }
  38. } );
  39. }
  40.  
  41. function checkForAD(node) {
  42. //-- Only process element nodes
  43. if (node.nodeType === 1) {
  44. if(node.className .toLowerCase().indexOf('anyclip-') != -1)
  45. {
  46. try
  47. {
  48. node.parentNode.removeChild(node);
  49. }
  50. catch(ex){}
  51. }
  52. }
  53. }
  54.  
  55. function walkTheDOM(node, func) {
  56. func(node);
  57. node = node.firstChild;
  58. while (node) {
  59. walkTheDOM(node, func);
  60. node = node.nextSibling;
  61. }
  62. }
  63.  
  64. walkTheDOM(document.body, checkForAD);
  65. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址