Advertisement
Degritone

BBS ReCaptcha Fix

Apr 9th, 2024 (edited)
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         BBS ReCaptcha Fix
  3. // @version      1.0
  4. // @description  Fix the BBS's ReCaptcha
  5. // @author       Degritone
  6. // @match        *://dollars-bbs.org/*
  7. // @grant        none
  8. // @run-at       document-end
  9. // ==/UserScript==
  10.  
  11. window.nameWithoutCollision = window.location.href.match(/\.org\/.+?\//)[0].replace(".org","").replace("/","")+"/kareha.pl";
  12. window.self = window;
  13.  
  14. window.preview_post = function(formid,thread){
  15.   let form=document.getElementById(formid);
  16.   let preview=document.getElementById("preview"+thread);
  17.  
  18.   if(!form||!preview) return;
  19.  
  20.   preview.style.display="";
  21.   preview.innerHTML="<em>Loading...</em>";
  22.   let text;
  23.   text="task=preview";
  24.   text+="&comment="+encodeURIComponent(form.comment.value);
  25.   text+="&markup="+encodeURIComponent(form.markup.value);
  26.   if(thread) text+="&thread="+thread;
  27.  
  28.   let xmlhttp=get_xmlhttp();
  29.   xmlhttp.open("POST",nameWithoutCollision);
  30.   xmlhttp.onreadystatechange=function() {
  31.     if(xmlhttp.readyState==4) preview.innerHTML=xmlhttp.responseText;
  32.   }
  33.   if(is_ie()||xmlhttp.setRequestHeader) xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  34.   xmlhttp.send(text);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement