Steve5451

Help me leave BLF 1.0

May 31st, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Help me leave BLF
  3. // @version      1.0
  4. // @description  Remove posting capability without logging out
  5. // @author       Steve5451
  6. // @match        https://forum.blockland.us/*
  7. // @namespace    http://thepotato.tk/
  8. // @updateURL    https://pastebin.com/raw/cRse87Ey
  9. // @downloadURL  https://pastebin.com/raw/cRse87Ey
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. var url = window.location.href;
  14.  
  15. if(url.includes("topic=")) {
  16.     var quickReply = document.getElementById("quickReplyExpand"),
  17.         replyButton = document.querySelectorAll("img[src*='reply.gif']");
  18.  
  19.     if(quickReply)
  20.         quickReply.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "none";
  21.  
  22.     if(replyButton) {
  23.         for(var i = 0, n = replyButton.length; i < n; ++i) {
  24.             replyButton[i].style.display = "none";
  25.         }
  26.     }
  27. } else if(url.includes("action=post")) {
  28.     var textbox = document.getElementsByClassName("editor")[0];
  29.     if(!textbox) return;
  30.  
  31.     textbox.parentNode.parentNode.parentNode.style.display = "none";
  32. } else if(url.includes("board=")) {
  33.     var topicButtons = document.querySelectorAll("img[src*='new_']");
  34.  
  35.     for(var i = 0, n = topicButtons.length; i < n; ++i) {
  36.         topicButtons[i].style.display = "none";
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment