Advertisement
AHOHNMYC

AnonFM Disqus comments

Dec 26th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        AnonFM Disqus comments
  3. // @namespace   FM_vestchtchaniye
  4. // @include     https://disqus.com/embed/comments/?base=default&f=anon-4*
  5. // @include     https://anon.fm/*
  6. // @version     0.0.1
  7. // @grant       none
  8. // ==/UserScript==
  9.  
  10. switch (location.host) {
  11.     case 'anon.fm':
  12.         /* Embed Disqus in anon.fm */
  13.         document.body.appendChild(document.createElement('div')).id = 'disqus_thread';
  14.         let s = document.createElement('script');
  15.         s.src = 'https://anon-4.disqus.com/embed.js';
  16.         document.head.appendChild(s);
  17.         break;
  18.  
  19.     case 'disqus.com':
  20.         /* Remove all this shit */
  21.         const shootList = [
  22.             '.nav',
  23.             '#footer',
  24.             '.auth-section > .connect',
  25.         ];
  26.  
  27.         const t = setInterval(() => {
  28.             if (!document.querySelector(shootList[0]))
  29.                 return;
  30.             clearInterval(t);
  31.             shootList.forEach(sel => document.querySelectorAll(sel).forEach(el => el.remove()));
  32.         }, 50);
  33.         break;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement