Advertisement
AHOHNMYC

MP4 killer

Jul 20th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         MP4 killer
  3. // @namespace    2ch
  4. // @version      0.0.1
  5. // @description  Remove all MP4
  6. // @author       AHOHNMYC
  7. // @match        https://2ch.hk/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. function killMP4(){
  12.     let iterator = document.evaluate('//a[contains(@href,"mp4")]/../../..', document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null),
  13.         t, a = [];
  14.     while (( t = iterator.iterateNext() )) a.push(t);
  15.     a.forEach( el=>el.remove() );
  16. }
  17. new MutationObserver(killMP4).observe(document.getElementById('ABU-alertbox'), {childList: true});
  18. killMP4();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement