Advertisement
milutinke

Anime Srbija De Bloater

Feb 16th, 2022
1,492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Anime Srbija Debloater
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  Removes bloat on AnimeSrbija.com
  6. // @author       Dusan Milutinovic
  7. // @match        https://*.animesrbija.com/*
  8. // @icon         https://www.google.com/s2/favicons?domain=animesrbija.com
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     'use strict';
  14.  
  15.     // Remove all widgets except the player, the server chooser and the comments (do not remove comments at this stage)
  16.     Array.from(document.querySelectorAll('.widget')).forEach(node => {
  17.         const classes = Array.from(node.classList);
  18.  
  19.         if(!(classes.includes('player') || classes.includes('comment') || classes.includes('servers')))
  20.             node.remove()
  21.     });
  22.  
  23.     // Remove the comment section
  24.     Array.from(document.querySelectorAll('.widget')).forEach(node => {
  25.         const classes = Array.from(node.classList);
  26.  
  27.         if(classes.includes('comment')) {
  28.             let subNodes = Array.from(node.childNodes);
  29.  
  30.             if(subNodes.length < 1)
  31.                 return;
  32.  
  33.             if(!subNodes[1])
  34.                 return;
  35.  
  36.             if(subNodes[1].innerText.toLowerCase().includes('komentari') && !subNodes[1].innerText.toLowerCase().includes('server'))
  37.                 node.remove();
  38.         }
  39.     });
  40.  
  41.  
  42.     // Remove the Discord widget bot
  43.     const __windgetbot__ = document.querySelector('widgetbot');
  44.  
  45.     if( __windgetbot__)
  46.         __windgetbot__.remove();
  47. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement