Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Ultimate Shitpost
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @include https://forums.somethingawful.com/showthread.php*
  8. // @include https://forums.somethingawful.com/newreply.php*
  9. // @grant none
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. console.log("RESTARTING!");
  16. var observation = document.head;
  17. var observer = new MutationObserver(function(){
  18. if(document.body){
  19. document.body.style.visibility='hidden'};
  20. observer=null;
  21. })
  22. observer.observe(observation, {subtree: true, childList: true});
  23. window.addEventListener('load', (event) => {
  24. console.log("FULLY LOADED");
  25. console.log(document.body.style.visibility);
  26. var userinfos = document.querySelectorAll("td.userinfo, p.editedby, td.postdate, td.postlinks, a.quote_link");
  27. for (let x of userinfos){
  28. x.parentNode.removeChild(x);
  29. }
  30. var threadamalgam = document.getElementById("thread").appendChild(document.createElement("table"));
  31. console.log(threadamalgam);
  32. threadamalgam.id = 'threadamalgam';
  33.  
  34. var postbodies = document.querySelectorAll("td.postbody");
  35. for (let x of postbodies){
  36. var y = document.getElementById("threadamalgam");
  37. var newrow=y.appendChild(document.createElement("tr"));
  38. newrow.appendChild(x);
  39. }
  40. var posts = document.querySelectorAll("table.post");
  41. for (let x of posts){
  42. x.parentNode.removeChild(x);
  43. }
  44. threadamalgam.className=("post");
  45. document.body.style.visibility="visible";
  46. })
  47.  
  48. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement