Download PreForm without giving out data to Formlabs

Allows the download of Preform without compiling the form with personal data

  1. // ==UserScript==
  2. // @name Download PreForm without giving out data to Formlabs
  3. // @namespace StephenP
  4. // @match https://formlabs.com/*/software/preform/*
  5. // @match https://formlabs.com/software/preform/*
  6. // @grant none
  7. // @version 1.0
  8. // @license copyleft
  9. // @author StephenP
  10. // @description Allows the download of Preform without compiling the form with personal data
  11. // ==/UserScript==
  12. const macButtons=document.querySelectorAll(".Button_button__NKkpa.Button_none__YiwlJ.Button_light__heSKx");//MAC
  13. const windowsButtons=document.querySelectorAll(".Button_button__NKkpa.Button_none__YiwlJ.Button_dark__k2aro");//WINDOWS
  14. for(let mb of macButtons){
  15. let nmb=mb.cloneNode(true);
  16. nmb.addEventListener("click",function(){document.location.href="https://formlabs.com/download-preform-mac"});
  17. mb.parentNode.appendChild(nmb);
  18. mb.style.display="none";
  19. }
  20. for(let wb of windowsButtons){
  21. let nwb=wb.cloneNode(true);
  22. nwb.addEventListener("click",function(){document.location.href="https://formlabs.com/download-preform-windows"});
  23. wb.parentNode.appendChild(nwb);
  24. wb.style.display="none";
  25. }/*Other method, working but not used right now
  26. var i=setInterval(checkForm,500);
  27.  
  28. function checkForm(){
  29. let form=document.getElementById("form_Preform_Download");
  30. if(form){
  31. autoDownload(form);
  32. clearInterval(i);
  33. }
  34. }
  35. function autoDownload(form){
  36. const requiredFields=form.querySelectorAll("[required]");
  37. for(let f of requiredFields){
  38. f.removeAttribute("required");
  39. }
  40. const submitButton=form.querySelector("[type=submit]");
  41. if(submitButton){
  42. submitButton.click();
  43. }
  44. }*/