Guest User

Untitled

a guest
Aug 4th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. // ==UserScript==
  2. // @name mass reply
  3. // @include http://boards.4channel.org/*
  4. // @include https://boards.4channel.org/*
  5. // @include http://boards.4chan.org/*
  6. // @include https://boards.4chan.org/*
  7. // @version 0.0.1.20200402141949
  8. // @namespace https://greasyfork.org/users/473762
  9. // @description Mass reply to everyone
  10. // ==/UserScript==
  11.  
  12. (function(){
  13. 'use strict';
  14. function addWH(qr){
  15. var wayheebtn = document.createElement("button");
  16. var wayheetext = document.createTextNode("CLICKE!!!");
  17. wayheebtn.setAttribute("style","color:#000000;font-size:23px;background-color:#FF0000");
  18. wayheebtn.onclick = function(){
  19. // var arr = Array.from(document.querySelectorAll(".postContainer")).map(e=>{ return ">>"+e.id.slice(2)+" " }).join("")
  20. var arr = Array.from(document.querySelectorAll(".postContainer")).map(e=>{ return ">>" + e.id.slice(2) })
  21. document.querySelector('[placeholder="Comment"]').value = arr.slice(Math.max(arr.length - 150, 0)).join(" ") + "\n";
  22. }
  23. wayheebtn.appendChild(wayheetext);
  24. qr.appendChild(wayheebtn);
  25. }
  26.  
  27. var checkqrexists = new MutationObserver(function(mutations, me) {
  28. var qr = document.getElementById('qr');
  29. if(qr){
  30. addWH(qr);
  31. me.disconnect();
  32. return;
  33. }
  34. });
  35.  
  36. checkqrexists.observe(document, { childList: true, subtree: true });
  37. })();
Advertisement
Add Comment
Please, Sign In to add comment