Advertisement
Guest User

Untitled

a guest
Dec 21st, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function customInterval(query, timeInSec = 1, p = true) {
  2.     if (elementExists(query) && p) {
  3.         const timer = setInterval(function() {
  4.             const element = document.querySelector(query);
  5.             element[element.tagName === 'FORM' ? 'submit' : 'click']();
  6.             clearInterval(timer);
  7.         }, timeInSec * 1000);
  8.     }
  9. }
  10. //example
  11. customInterval('a.btn-main.get-link', 5, !elementExists('#ytimer > .s-btn-f'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement