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