jeudi 9 août 2018

if Button Exists then click on it

I searched and searched questions similar to my question but were either in other languages ​​or tested and did not answer so I had to ask a question. I wrote a plugin for Chrome Now it's a problem for the site I wrote the plugin Recently, 2 buttons have been added to the site

I want to write a function that constantly checks if there is a button (refresh_button) to do it click on it. And then a new page opens with a button named (play_button) inside it Check if it does exist. Click on it

here's my function for this work but its not working

var t_refreshBtn=document.getElementsByClassName("refresh_button")[0];
var t_playBtn=document.getElementsByClassName("play_button")[0];
var interval = 10;
var timer = window.setInterval(function(){
    if($('#refresh_button').length > 0){
    t_refreshBtn.click();
        }
     window.clearInterval(timer);

}, interval);




Aucun commentaire:

Enregistrer un commentaire