justpaste.it skip redirect message

Skips the "you are going to leave justpaste.it

  1. // ==UserScript==
  2. // @name justpaste.it skip redirect message
  3. // @namespace skyline1
  4. // @version 0.1
  5. // @description Skips the "you are going to leave justpaste.it
  6. // @author skyline1
  7. // @match https://justpaste.it/redirect/*/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to find and click on the element
  16. function clickElement() {
  17. const targetClass = "redirectLink redirectLinkBold";
  18. const elements = document.getElementsByClassName(targetClass);
  19.  
  20. if (elements.length > 0) {
  21. elements[0].click(); // Click the first element with the specified class
  22. console.log("Clicked on the element.");
  23. } else {
  24. console.log("Element not found.");
  25. }
  26. }
  27.  
  28. // Retry every 1 second
  29. function retryClick() {
  30. setInterval(clickElement, 1000);
  31. }
  32.  
  33. // Start the retry process
  34. retryClick();
  35. })();