AutoSubmitTdk

auto submitter for tdk website

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/479447/1277888/AutoSubmitTdk.js

  1. let input = document.getElementById("tdk-srch-input");
  2. let autocmp=document.getElementById("autocmp");
  3. autocmp.disabled=true;
  4. autocmp.style.pointerEvents = "none";
  5. autocmp.style.opacity = "0";
  6. // Execute a function when the user presses a key on the keyboard
  7.  
  8.  
  9. // Execute a function when the user presses a key on the keyboard
  10. input.addEventListener("keypress", function(event) {
  11. // If the user presses the "Enter" key on the keyboard
  12. input.addEventListener("keydown", function(event) {
  13. // If the user presses the "Ctrl+A" key combination
  14. if (event.ctrlKey && event.key === "a") {
  15. event.preventDefault();
  16. input.value = ""; // Clear the input value
  17. }
  18. });
  19. if (event.key != "Enter") {
  20. if ( event.key === "Alt" || event.key === "Tab") {
  21. return;
  22. //For shortcuts
  23. }
  24. else {
  25. event.preventDefault();
  26. // Cancel the default action, if needed
  27. setInterval(function() {
  28. var divElements = document.querySelectorAll("#maddeler0");
  29. if(divElements){
  30. divElements.forEach(function(divElement) {
  31. var innerFailedDivElement = divElement.querySelector("#bulunmayan-gts");
  32. var innerSuccesfulDivElement = divElement.querySelector("#bulunan-gts0");
  33. if (innerFailedDivElement.textContent.trim() === "Bu söz bulunamadı.") {
  34. divElement.remove();
  35. console.log("removed")
  36. }
  37. if(innerSuccesfulDivElement.textContent.trim() !==input.value){
  38. divElement.remove();
  39. console.log("removed succesful one")
  40. }
  41. });
  42. }
  43. }, 10);
  44. input.value=input.value+event.key;
  45. console.log("PressedEnter")
  46. document.getElementById("tdk-search-btn").click();
  47. // Trigger the button element with a click
  48.  
  49.  
  50. }
  51. }
  52. });
  53.  
  54.  
  55.  
  56.  
  57.  
  58.