0

I am new to Greasemonkey and javascript but have found the script below, I want to execute it every 5 seconds.

javascript:$('.comments-stream .more:not(.dnone)').parent().find('.fa-minus').parent() .click();

Is there any way of doing this?

1 Answers1

1

Use setInterval. Notice how i removed the parentheses from the click function.

javascript:setInterval($('.comments-stream .more:not(.dnone)').parent().find('.fa-minus').parent() .click, 5000);

If you want to do more then just the click.

javascript:setInterval(function(){
    $('.comments-stream .more:not(.dnone)').parent().find('.fa-minus').parent() .click();
, 5000);
Farid Nouri Neshat
  • 29,438
  • 6
  • 74
  • 115
Poul Kruijt
  • 69,713
  • 12
  • 145
  • 149