Advertisement
jamescolin

RPM page5 settimeout

Feb 26th, 2022
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.   waitforformready();
  3.  
  4.   function waitforformready() {
  5.     let myform = document.querySelector("form");
  6.    
  7.     if ( myform == null ) {
  8.       setTimeout(waitforformready, 1000);
  9.     } else {
  10.       setautomagicallink();
  11.     }
  12.   }
  13.  
  14.   function setautomagicallink() {
  15.     let myaid = document.querySelector("[name='custom aid']").value.trim();
  16.     let mylink = document.querySelector("[name='custom link']").value.trim();
  17.     let myaffiliate = document.querySelector("[name='custom affiliate']").value.trim();
  18.     let mymailingboss = document.querySelector("[name='custom mailingboss']").value.trim();
  19.  
  20.     let myautomagicallink = 'https://w.rapidprofitmachine.com/?affiliate='+encodeURIComponent(myaffiliate)+'&aid='+myaid+'&mailingboss='+mymailingboss+'&link='+encodeURIComponent(mylink);
  21.    
  22.     let myinput = document.querySelector("[name='custom automagicallink']");
  23.     if (myautomagicallink != myinput.value) {
  24.         jameschangevalue(myinput,myautomagicallink);
  25.         myinput.setAttribute('value', myautomagicallink);
  26.     }
  27.     setTimeout(setautomagicallink, 500);
  28.   }
  29.  
  30.   function jameschangevalue(el,value){
  31.       var nativeInputValueSetter = Object.getOwnPropertyDescriptor(
  32.         window.HTMLInputElement.prototype,
  33.         "value"
  34.       ).set;
  35.       nativeInputValueSetter.call(el, value);
  36.       var inputEvent = new Event("input", { bubbles: true });
  37.       el.dispatchEvent(inputEvent);
  38.   }
  39. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement